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