- 442
- 88
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
- Версия MoonLoader
- .027.0-preview
Крч когда появляется окно диалоговое, запускается таймер с миллисекундами. Как сделать так, чтоб когда окно закрывало пропадал таймер и сброс был до 0?
Код:
local vk = require 'vkeys'
local sampev = require('samp.events')
local timertime, reservetime, enabled, paused = 0, 0, false, false
function main()
if not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
while true do
wait(0)
end
end
function sampev.onShowDialog(dialogId, dialogStyle, dialogTitle, okButtonText, cancelButtonText, dialogText)
if dialogId == 722 then
if enabled then
if paused then
timertime = os.clock() - reservetime + timertime
reservetime = 0
else
reservetime = os.clock()
end
paused = not paused
else
timertime = os.clock()
enabled = true
end
if enabled and not paused then
printStringNow(string.format("%02i:%06.3f", math.floor((os.clock() - timertime) / 60), os.clock() - timertime - math.floor((os.clock() - timertime) / 60) * 60), 5000)
end
end
end