Meu sistema de reset não é por storage.. segue ele abaixo..
local reqConfig = {
needPz = true,
needPremium = false,
noWhiteSkull = false,
noRedSkull = false,
noBattle = false
}
local resetConfig = {
level = 717217,
toLevel = 100,
delay = 2
}
function onSay(cid, words, param)
local function doReset(cid)
local pid = getPlayerGUID(cid)
local resets = getPlayerResets(cid)
if isCreature(cid) then
doRemoveCreature(cid)
end
local level_query = "UPDATE `players` SET `level` = ".. (resetConfig.toLevel) ..", `experience` = 0 WHERE `id` = ".. pid ..";"
local reset_query = "UPDATE `players` SET `reset` = ".. (resets + 1) .." WHERE `id` = ".. pid ..";"
local look_query = "UPDATE `players` SET `description` = '[Reset ".. (resets + 1) .."]' WHERE `players`.`id` = ".. pid ..";"
db.executeQuery(level_query);db.executeQuery(reset_query);db.executeQuery(look_query);
return true
end
if getPlayerLevel(cid) < resetConfig.level then
doPlayerSendCancel(cid, "Desculpe, você não level ".. resetConfig.level .." para resetar.")
elseif reqConfig.needPz == true and not getTilePzInfo(getThingPosition(cid)) then
doPlayerSendCancel(cid, "Desculpe, você precisa estar em protection zone para resetar.")
elseif reqConfig.needPremium == true and not isPremium(cid) then
doPlayerSendCancel(cid, "Desculpe, você precisa ser premium account para resetar.")
elseif reqConfig.noWhiteSkull == true and getCreatureSkullType(cid) == 3 then
doPlayerSendCancel(cid, "Desculpe, você não pode resetar pois está com White Skull.")
elseif reqConfig.noRedSkull == true and getCreatureSkullType(cid) == 4 then
doPlayerSendCancel(cid, "Desculpe, você não pode resetar pois está com Red Skull.")
elseif reqConfig.noBattle == true and getCreatureCondition(cid, CONDITION_INFIGHT) then
doPlayerSendCancel(cid, "Desculpe, você não pode resetar pois está com Battle.")
else
doPlayerPopupFYI(cid, "Parabéns!\n\nAgora você tem ".. (getPlayerResets(cid) + 1) .." resets.\n\nVocê será deslogado em ".. resetConfig.delay .." segundos.")
addEvent(doReset, resetConfig.delay*1000, cid)
end
return true
end