Lua HUD Прочее Info Ped/Car

histor

Известный
Автор темы
175
111
Версия SA-MP
  1. Любая
Приветствую пользователей Blast Hk!
Представляю вам простенький скрипт, который показывает информацию о вашем персонаже, а также транспортном средстве!
Выглядит минималистично и ничего лишнего в скрипте нет
1641981941098.png
1641981950380.png
 

Вложения

  • info.lua
    2 KB · Просмотры: 62

copypaste_scripter

Известный
1,218
223
cделай активацию по команде пожалуйста
Lua:
script_name('info')
script_author('histor')
script_description('helper for witchers')
script_version('1')
require "lib.moonloader"
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local prf = "{808080}[{8B0000}info{808080}] : "
local sampev = require 'lib.samp.events'
local activated = false
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    wait(1000)
    sampAddChatMessage(" ", -1)
    sampAddChatMessage(prf.."Скрипт {8B0000}активен{808080}! Версия : {8B0000}1", -1)
    sampAddChatMessage(prf.."Автор: {8B0000}histor#8461{808080}. Активация {8B0000}//info {808080}!", -1)
    sampAddChatMessage(" ", -1)
    local font = renderCreateFont("Arial", 8, 5)
   
    sampRegisterChatCommand('/info', function()
        activated = not activated
    end)
   
    while true do
        wait(0)
        if isCharSittingInAnyCar(PLAYER_PED) and activated then
            local x, y, z = getCharCoordinates(PLAYER_PED)
            local hpped = getCharHealth(PLAYER_PED)
            local armorped = getCharArmour(PLAYER_PED)
            local x1, y1 = convert3DCoordsToScreen(x,y,z)
            local veh = storeCarCharIsInNoSave(PLAYER_PED)
            local x, y, z = getCarCoordinates(veh)
            local hpcar = getCarHealth(veh)
            local _, idcar = sampGetVehicleIdByCarHandle(veh)
            local a, b = getCarColours(veh)
            local x1, y1 = convert3DCoordsToScreen(x,y,z)
            renderFontDrawText(font, 'hp: ['..hpped..']\narm: ['..armorped..']', x1-70, y1, -1)
            renderFontDrawText(font, 'hpcar: ['..hpcar..']\nid: ['..idcar..']\ncolor: ['..a..'|'..b..']', x1, y1, -1)
        end
        if not isCharSittingInAnyCar(PLAYER_PED) and activated then
            local x, y, z = getCharCoordinates(PLAYER_PED)
            local hpped = getCharHealth(PLAYER_PED)
            local armorped = getCharArmour(PLAYER_PED)
            local x1, y1 = convert3DCoordsToScreen(x,y,z)
            renderFontDrawText(font, 'hp: ['..hpped..']\narm: ['..armorped..']', x1-25, y1, -1)
        end
    end
end

Активация по команде в чат " //info " если какие то проблемы то пиши с личные сообщения на форуме

строки из твоего скрипта:
Lua:
local sampev = require 'lib.samp.events' -- 10 line

-- 6-8 line
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8

мог бы и убрать уж
хД он как я, если работает пусть будет, ну типо а вдруг надо) думаю он о лишнее имел ввиду вредительские функции в скрипте

1642049926369.png


немного поменял для себя :)
 
Последнее редактирование: