local q = require 'lib.samp.events'
local time_for_timer = os.clock()
local time = 20 -- время таймера
local server_Message = false
function main()
if not isSampLoaded() and isSampAvailable() then return end
while not isSampAvailable() do wait(0) end
sampAddChatMessage("{F8F9F9}(Activation command is /cartimer)", -1)
sampRegisterChatCommand("cartimer", cmd)
sampRegisterChatCommand("ctinfo", cmd_car_timer_info)
Timer()
while true do
wait(-1)
end
end
function Timer()
lua_thread.create(function()
while server_Message do
wait(0)
if os.clock() >= time_for_timer then
sampAddChatMessage('The timer has passed', -1)
server_Message = false
end
end
end)
end
function q.onServerMessage(c, s)
if s:find("If I see this") then
time_for_timer = os.clock() + time
server_Message = true
end
end