require "lib.moonloader"
local huy = require("samp.events")
local piska = 0
local oX = 290
local oY = 100
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
while true do
timer = os.time() + piska
sampTextdrawCreate(222, os.date("%H:%M:%S", timer), oX, oY)
sampTextdrawSetLetterSizeAndColor(222, 0.5, 2.2, 0xFFff6347) -- 0.5 - X; 2.2 - Y
sampTextdrawSetOutlineColor(222, 0.5, 0xFF000000)
sampTextdrawSetAlign(222, 1)
sampTextdrawSetStyle(222, 2)
wait(500)
end
end
function huy.onShowDialog(dialogId,style,title,button1,button2,text)
if string.match(text, "Текущее время") then
chislo, mesyac, god = string.match(text, "Сегодняшняя дата: {2EA42E}(%d+):(%d+):(%d+)")
chas, minuti, sekundi = string.match(text, "Текущее время: {345690}(%d+):(%d+):(%d+)")
datetime = {year = god,month = mesyac,day = chislo,hour = chas,min = minuti,sec = sekundi}
piska = tostring(os.time(datetime)) - os.time()
end
end