Скрипт который показывает через сколько будет респ. каров

Maver

Участник
Автор темы
50
3
Ищу скрипт который будет считывать сообщение от админа по типу "Через 30сек пройдет респавн каров" и скрипт должет выводить табличку на экран с таймером в 30 сек
 
Решение
Lua:
require 'lib.moonloader'
require 'lib.sampfuncs'
local SE = require 'lib.samp.events'

local ugTimer = 0


function SE.onServerMessage(color, text)
    if(string.find(text, "ТВОЙ ТЕКСТ")) then
        ugTimer = os.time() + 30
        return true
    end
end

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then
        return
    end
    while not isSampAvailable() do wait(100) end
    renderFont = renderCreateFont("Tahoma", 14, FCR_BORDER + FCR_BOLD)
    sw, sh = getScreenResolution()
    lua_thread.create(drawUgTimer)
  
    while true do
        wait(0)
    end
end


function drawUgTimer()
    while true do
        wait(0)
        if(ugTimer >= os.time())then
            local timer = ugTimer - os.time()...

markiz.desead

Потрачен
580
464
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Точно такого таймера нет, но могу порекомендовать альтернативу. В .ini файле настаиваешь под себя и когда придет время, активируешб

 

Shizuru.

Участник
82
30
Lua:
require 'lib.moonloader'
require 'lib.sampfuncs'
local SE = require 'lib.samp.events'

local ugTimer = 0


function SE.onServerMessage(color, text)
    if(string.find(text, "ТВОЙ ТЕКСТ")) then
        ugTimer = os.time() + 30
        return true
    end
end

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then
        return
    end
    while not isSampAvailable() do wait(100) end
    renderFont = renderCreateFont("Tahoma", 14, FCR_BORDER + FCR_BOLD)
    sw, sh = getScreenResolution()
    lua_thread.create(drawUgTimer)
  
    while true do
        wait(0)
    end
end


function drawUgTimer()
    while true do
        wait(0)
        if(ugTimer >= os.time())then
            local timer = ugTimer - os.time()
            local text = ""
            local minute, second = math.floor(timer / 60), timer % 60
            text = string.format("До респавна: %02d:%02d", minute, second)
            if(minute < 1 and second <= 15 and second % 2 > 0) then
                text = "{f4b800}" .. text
            end
            renderFontDrawText(renderFont, text, sw * 0.24, sh * 0.95, 0xFFf4b800)
        end
    end
end
Вот, вместо "ТВОЙ ТЕКСТ" напиши свой
 
  • Нравится
Реакции: markiz.desead