Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. wrap like this:
  2. if limit("Aegis_notification", 5) then
  3. send("gt one minute left on my aegis!")
  4. end
  5.  
  6. function limit(cmd, seconds)
  7. local cts = getEpoch()
  8.  
  9. if cmd_limit == nil then
  10. cmd_limit = {}
  11. end
  12.  
  13. local cok = 0
  14. if cmd_limit[cmd] == nil then
  15. cok = 1
  16. else
  17. local cdiff = cts - cmd_limit[cmd]
  18. if cdiff > seconds then
  19. cok = 1
  20. end
  21. end
  22.  
  23. if cok == 0 then
  24. return false
  25. end
  26.  
  27. cmd_limit[cmd] = cts
  28. return true
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement