Помогите с LUA Скриптингом

hol0s

Активный
Автор темы
165
25
что не так? (суть: хочу вывести рядом хп)
Lua:
require("lib.moonloader")
local display = true
local font = renderCreateFont("Arial", 20, 15)

function main()
    sampRegisterChatCommand("hud", cmd_hud)
    while true do
        wait(0)
        renderFontDrawText(font, "$" .. getPlayerMoney(PLAYER_HANDLE), 1200, 50, -1)
        renderFontDrawText(font, "H" .. getCharHealth(pedHandle_ped))
    end
end

function cmd_hud()
    display = not display
    displayHud(display)
end
 

William_Chkhalo

Участник
125
14
Нет, реально не получается. Постоянно крашит почему-то. Хочу посмотреть, как это правильно сделать всё
Lua:
script_name('Numeric HP')
script_author('deddosouru')
script_version('pervaya lol')
function main()
    while true do wait(0)
        while not isPlayerPlaying(PLAYER_HANDLE) do wait(0) end
        useRenderCommands(true) -- use lua render
        setTextCentre(true) -- set text centered
        setTextScale(1.2, 1.5) -- x y size
        setTextColour(255--[[r]], 255--[[g]], 255--[[b]], 255--[[a]])
        setTextEdge(1--[[outline size]], 0--[[r]], 0--[[g]], 0--[[b]], 255--[[a]])
        displayTextWithNumber(578.0, 68.5, 'NUMBER', getCharHealth(PLAYER_PED))
        if getCharArmour(PLAYER_PED) > 0 then
            setTextCentre(true) -- set text centered
            setTextScale(1.2, 1.5) -- x y size
            setTextColour(255--[[r]], 255--[[g]], 255--[[b]], 255--[[a]])
            setTextEdge(1--[[outline size]], 0--[[r]], 0--[[g]], 0--[[b]], 255--[[a]])
            displayTextWithNumber(578.0, 47.0, 'NUMBER', getCharArmour(PLAYER_PED))
        end
    end
end

IMG_20231126_202913_492.jpg


Вот скрин. Если что скрипт не мой
 
  • Вау
Реакции: Hinаta

percheklii

Известный
749
279
Скинь, пожалуйста. Пытался без mimgui сделать, но что-то не получается :(
Пример:
Использование:
 

Hinаta

Известный
782
352
Пример:
Использование:
Да мне ж это всё не надо, я просто на код Вильяма хотел глянуть, а он даже не его оказался