local font = renderCreateFont("Arial", 15, 5)
local resX, resY = getScreenResolution()
function main()
    while not isSampAvailable() do wait(0) end
    while true do
        wait(0)
        renderFontDrawText(font, ("%.0f"):format(require'memory'.getfloat(0xB7CB50, true)), 15, resY - 30 , 0xFFFF0000)
    end
end 
             
             
            local font = renderCreateFont("Arial", 15, 5)
local resX, resY = getScreenResolution()
function main()
    while not isSampAvailable() do wait(0) end
    while true do
        wait(0)
        renderFontDrawText(font, ("%.0f"):format(require'memory'.getfloat(0xB7CB50, true)), 15, resY - 30 , 0xFFFF0000)
    end
endА как сделать выключение через elseLua:local font = renderCreateFont("Arial", 15, 5) local resX, resY = getScreenResolution() function main() while not isSampAvailable() do wait(0) end while true do wait(0) renderFontDrawText(font, ("%.0f"):format(require'memory'.getfloat(0xB7CB50, true)), 15, resY - 30 , 0xFFFF0000) end end
 
             
             
            текст рендерится в цикле, поэтому else не нужноА как сделать выключение через else
local font = renderCreateFont("Arial", 15, 5)
local resX, resY = getScreenResolution()
local active = true
function main()
    while not isSampAvailable() do wait(0) end
    sampRegisterChatCommand('fps', function()
        active = not active
        sampAddChatMessage(active and 'Fps: on' or 'Fps: off', -1)
    end)
    while true do
        wait(0)
        if active then
            renderFontDrawText(font, ("%.0f"):format(require'memory'.getfloat(0xB7CB50, true)), 15, resY - 30 , 0xFFFF0000)
        end
    end
endтекст рендерится в цикле, поэтому else не нужно
Lua:local font = renderCreateFont("Arial", 15, 5) local resX, resY = getScreenResolution() local active = true function main() while not isSampAvailable() do wait(0) end sampRegisterChatCommand('fps', function() active = not active sampAddChatMessage(active and 'Fps: on' or 'Fps: off', -1) end) while true do wait(0) if active then renderFontDrawText(font, ("%.0f"):format(require'memory'.getfloat(0xB7CB50, true)), 15, resY - 30 , 0xFFFF0000) end end end
function main()
    while not isSampAvailable() do wait(0) end
    sampRegisterChatCommand('fps', function()
        active = not active
        sampAddChatMessage(active and 'Fps: on' or 'Fps: off', -1)
    end)
    while true do
        wait(0)
    if elements.checkboxes.nst.v then
            renderFontDrawText(font, ("%.0f"):format(require'memory'.getfloat(0xB7CB50, true)), 15, resY - 30 , 0xFFFF0000)
        end
    end
end 
             
             
            daТАк?Lua:function main() while not isSampAvailable() do wait(0) end sampRegisterChatCommand('fps', function() active = not active sampAddChatMessage(active and 'Fps: on' or 'Fps: off', -1) end) while true do wait(0) if elements.checkboxes.nst.v then renderFontDrawText(font, ("%.0f"):format(require'memory'.getfloat(0xB7CB50, true)), 15, resY - 30 , 0xFFFF0000) end end end
 
             
             
            скрипт крашится? если да то кинь мунлогНе работает нажимаю галочку и не показывает фпс
[23:01:37.069642] (system) Loading script "D:\!GTA\moonloader\proc ozu1.8.lua"... (id:5)скрипт крашится? если да то кинь мунлог
local font = renderCreateFont('Arial', 15, 5)
local resX, _ = getScreenResolution()
local showPerSecond = 10 -- количество раз, когда обновлять FPS на экране
local active = true
function main()
    while not isSampAvailable() do wait(0) end
    sampRegisterChatCommand('fps', function()
        active = not active
        sampAddChatMessage(active and 'Fps: on' or 'Fps: off', -1)
    end)
    local prevTime = os.clock()
    local prevFps = os.clock() - 1 / showPerSecond
    local FPS
    while true do
        wait(0)
        Time = os.clock()
        if active then
            if Time - prevFps >= 1 / showPerSecond then
                FPS = 1 / (Time - prevTime)
                prevFps = Time
            end
            renderFontDrawText(font, tostring(math.ceil(FPS)), resX - 40, 12, 0xFFFFFFFF)
        end
        prevTime = Time
    end
endМожно еще вот так.Lua:local font = renderCreateFont("Arial", 15, 5) local resX, resY = getScreenResolution() local active = true function main() while not isSampAvailable() do wait(0) end sampRegisterChatCommand('fps', function() active = not active sampAddChatMessage(active and 'Fps: on' or 'Fps: off', -1) end) local prevTime = os.clock() while true do wait(0) Time = os.clock() if active then FPS = 1 / (Time - prevTime) renderFontDrawText(font, tostring(FPS), 15, resY - 30 , 0xFFFF0000) end prevTime = Time end end
Попробуй новый код, я изменил сообщение. Должно быть справа сверху, чекай скриншот, у меня все работает. Мб у тебя 2
main()?не не работаетПопробуй новый код, я изменил сообщение. Должно быть справа сверху, чекай скриншот, у меня все работает. Мб у тебя 2main()?
Попробуй новый код, я изменил сообщение. Должно быть справа сверху, чекай скриншот, у меня все работает. Мб у тебя 2main()?
    if elements.checkboxes.nst.v then
    while true do
        wait(0)
            renderFontDrawText(font, ("%.0f"):format(require'memory'.getfloat(0xB7CB50, true)), 15, resY - 30 , 0xFFFF0000)
        end
    end