Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local cfg = {
- storage = 12129, -- Storage que salva reset
- kick_seconds = 3, -- Segundos antes de kickar o player
- reset_effect = CONST_ME_SOUND_GREEN, -- Efeito ao Resetar
- reset_multiply = 1000, -- Ex: Cada reset precisará de 1000 leveis a mais para o próximo
- level_multiply = 4200, -- Exp para o Level 8 (Consulte na Tabela a Quantidade para Level Desejado)
- }
- function onSay(cid, words, param)
- if not hasCondition(cid, CONDITION_INFIGHT) then
- sto = getPlayerStorageValue(cid, cfg.storage)
- if sto < 1 then
- if getPlayerLevel(cid) >= cfg.reset_multiply then
- doPlayerResetBySwatt(cid)
- setPlayerStorageValue(cid, cfg.storage, 1)
- doPlayerSendTextMessage(cid, , "You have make your first reset succesfully, your character be kicked in "..cfg.kick_seconds.." seconds.")
- else
- doPlayerSendCancel(cid, "You need level "..cfg.reset_multiply.." to do your first reset.")
- end
- else
- if getPlayerLevel(cid) >= ((sto+1) * cfg.reset_multiply) then
- doPlayerResetBySwatt(cid)
- setPlayerStorageValue(cid, cfg.storage, sto+1)
- doPlayerSendTextMessage(cid, , "You have been reset for "..(sto+1).." succesfully, your character be kicked in "..cfg.kick_seconds.." seconds.")
- else
- doPlayerSendCancel(cid, "You need level "..((sto+1) * cfg.reset_multiply).." to do your first reset.")
- end
- end
- else
- doPlayerSendCancel(cid, "You can't stay infight to execute this command.")
- end
- return true
- end
- function doPlayerResetBySwatt(cid)
- getHealth, getMana = getCreatureMaxHealth(cid), getCreatureMaxMana(cid)
- remove_exp = getPlayerExperience(cid)
- doPlayerAddExp(cid, -remove_exp)
- doPlayerAddExp(cid, cfg.level_multiply)
- setCreatureMaxHealth(cid, getHealth)
- setCreatureMaxMana(cid, getMana)
- doSendMagicEffect(getThingPos(cid), cfg.reset_effect)
- addEvent(doRemoveCreature, cfg.kick_seconds * 1000, cid)
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement