таймер для SAMP

Russian228

Известный
Автор темы
244
40
Желательно чтобы оповещение вылазило в чате или в любом месте на экране, а не звуковое, есть такое?
 

nsevxy

Участник
38
13
cmd - /timer
author - @SnOoWmaN
timer.lua:
function main()
if not isSampLoaded() and not isSampfuncsLoaded then return end
    while not isSampAvailable() do wait(500) end
 
    sampRegisterChatCommand('timer',
    function(param)
        timertime = os.time() + tonumber(param)
    end)
 
    while true do
        wait(0)
        if timertime >= os.time() then
            timeInSeconds = timertime - os.time()
            minutes = math.floor(timeInSeconds / 60)
            seconds = math.floor(timeInSeconds - minutes * 60)
            printStringNow(string.format('%02d:%02d', minutes, seconds), 1000)
        end
    end
end