Guest User

Untitled

a guest
Jun 24th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. local config = {
  2.  
  3. exhaustStorage = 12345,
  4. triesStorage = 12346,
  5. warningStorage = 12347,
  6. warningTries = 5,
  7. banWarning = 3,
  8. banTime = 3600*24,
  9. }
  10.  
  11. function onDirection(cid, old, current)
  12. if not(exhaustion.check(cid, config.exhaustStorage)) then
  13. exhaustion.make(cid, config.exhaustStorage, 1)
  14. return TRUE
  15. end
  16. local tries = getCreatureStorage(cid, config.triesStorage)
  17. if ((tries+1) < config.warningTries) then
  18. doCreatureSetStorage(cid, config.triesStorage, tries+1)
  19. exhaustion.make(cid, config.exhaustStorage, 1)
  20. return TRUE
  21. end
  22. local warnings = getCreatureStorage(cid, config.warningStorage)
  23. if ((warnings+1) < config.banWarning) then
  24. doPlayerPopupFYI(cid, "You have changed the direction of 5 times at an interval of less than 1 second.\nPlease stop, because it's your "..(warnings+1).." warning, otherwise you will be banned.")
  25. doCreatureSetStorage(cid, config.triesStorage, 0)
  26. doCreatureSetStorage(cid, config.warningStorage, (warnings+1))
  27. else
  28. doCreatureSetStorage(cid, config.triesStorage, 0)
  29. doCreatureSetStorage(cid, config.warningStorage, 0)
  30. doAddAccountBanishment(getPlayerAccountId(cid), getPlayerGUID(cid), (os.time() + config.banTime))
  31. if (isPlayer(cid)) then
  32. doRemoveCreature(cid)
  33. end
  34. end
  35. return TRUE
  36. end
Add Comment
Please, Sign In to add comment