Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local config = {
- exhaustStorage = 12345,
- triesStorage = 12346,
- warningStorage = 12347,
- warningTries = 5,
- banWarning = 3,
- banTime = 3600*24,
- }
- function onDirection(cid, old, current)
- if not(exhaustion.check(cid, config.exhaustStorage)) then
- exhaustion.make(cid, config.exhaustStorage, 1)
- return TRUE
- end
- local tries = getCreatureStorage(cid, config.triesStorage)
- if ((tries+1) < config.warningTries) then
- doCreatureSetStorage(cid, config.triesStorage, tries+1)
- exhaustion.make(cid, config.exhaustStorage, 1)
- return TRUE
- end
- local warnings = getCreatureStorage(cid, config.warningStorage)
- if ((warnings+1) < config.banWarning) then
- 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.")
- doCreatureSetStorage(cid, config.triesStorage, 0)
- doCreatureSetStorage(cid, config.warningStorage, (warnings+1))
- else
- doCreatureSetStorage(cid, config.triesStorage, 0)
- doCreatureSetStorage(cid, config.warningStorage, 0)
- doAddAccountBanishment(getPlayerAccountId(cid), getPlayerGUID(cid), (os.time() + config.banTime))
- if (isPlayer(cid)) then
- doRemoveCreature(cid)
- end
- end
- return TRUE
- end
Add Comment
Please, Sign In to add comment