Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wrap like this:
- if limit("Aegis_notification", 5) then
- send("gt one minute left on my aegis!")
- end
- function limit(cmd, seconds)
- local cts = getEpoch()
- if cmd_limit == nil then
- cmd_limit = {}
- end
- local cok = 0
- if cmd_limit[cmd] == nil then
- cok = 1
- else
- local cdiff = cts - cmd_limit[cmd]
- if cdiff > seconds then
- cok = 1
- end
- end
- if cok == 0 then
- return false
- end
- cmd_limit[cmd] = cts
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement