local state = false
local time = os.clock()
function main()
repeat wait(0) until isSampAvailable()
sampRegisterChatCommand("action", function() state = not state
sampAddChatMessage((state and 'Вкл' or 'Выкл'), -1)
end)
while true do
wait(0)
if state then
if os.clock() - time >= 300 then -- Задержка - В секундах.
sampIsChatInputActive()
-- действие
time = os.clock()
end
end
end
end