Ir para conteúdo
  • 0

Script Reset System


carlosvorpagel

Pergunta

Bom eu uso este Script de reset no meu otserv,

 

 

Mais gostaria que ele mostrasse os RESETS no look (ex: 22:10 You see Marcello [Reset 2] (Level 8). He is an elder druid.;) e tambem no RANK de reset (!rank reset),

 

se alguem puder fazer isso agradeço.

function onSay(cid, words, param, channel)

 

config = {

RemainingLvl=100,

exper=15694800,

pid=getPlayerGUID(cid),

batle="no"

}

 

function getPlayerResets(cid)

resets = getPlayerStorageValue(cid,1020)

if resets < 0 then

resets = 0

-- addValue(value)' [Adiciona numero de resets.]

end

return resets

end

 

if (config.batle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then

doPlayerSendTextMessage(cid,22,"Você Precisa estar sem Battle para Resetar.")

return TRUE

end

 

if (getPlayerStorageValue(cid, 11548) >= os.time()) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED,"Por medidas de segurança você só pode utilizar este comando em " .. (getPlayerStorageValue(cid, 11548)-os.time()+(0)) .. " segundos.")

return TRUE

end

doPlayerPopupFYI(cid, success)

addEvent(addValue, coNdConf.resetConf.time*1000, value)

else

doPlayerPopupFYI(cid, success)

addEvent(addValue, coNdConf.resetConf.time*1000, value)

addEvent(doTeleportThing, coNdConf.resetConf.time*900, cid, getTownTemplePosition(getPlayerTown(cid)))

return true

end

end

 

 

----------------------------------------------------------------------------------------------------------------------------------------

if getPlayerStorageValue(cid,1020) < 85 then

if getPlayerLevel(cid) >= 990 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 990 ou mais para poder resetar.")

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if getPlayerStorageValue(cid,1020) < 80 then

if getPlayerLevel(cid) >= 950 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 950 ou mais para poder resetar.")

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if getPlayerStorageValue(cid,1020) < 75 then

if getPlayerLevel(cid) >= 880 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 880 ou mais para poder resetar.")

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if getPlayerStorageValue(cid,1020) < 70 then

if getPlayerLevel(cid) >= 830 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 830 ou mais para poder resetar.")

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if getPlayerStorageValue(cid,1020) < 65 then

if getPlayerLevel(cid) >= 770 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 770 ou mais para poder resetar.")

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if getPlayerStorageValue(cid,1020) < 60 then

if getPlayerLevel(cid) >= 720 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 720 ou mais para poder resetar.")

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if getPlayerStorageValue(cid,1020) < 55 then

if getPlayerLevel(cid) >= 700 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 700 ou mais para poder resetar.")

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if getPlayerStorageValue(cid,1020) < 50 then

if getPlayerLevel(cid) >= 680 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 680 ou mais para poder resetar.")

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if getPlayerStorageValue(cid,1020) < 45 then

if getPlayerLevel(cid) >= 650 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 650 ou mais para poder resetar.")

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if getPlayerStorageValue(cid,1020) < 40 then

if getPlayerLevel(cid) >= 630 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 630 ou mais para poder resetar.")

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if getPlayerStorageValue(cid,1020) < 35 then

if getPlayerLevel(cid) >= 550 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 550 ou mais para poder resetar.")

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if getPlayerStorageValue(cid,1020) < 30 then

if getPlayerLevel(cid) >= 510 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 510 ou mais para poder resetar.")

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if getPlayerStorageValue(cid,1020) < 25 then

if getPlayerLevel(cid) >= 500 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 500 ou mais para poder resetar.")

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if getPlayerStorageValue(cid,1020) < 20 then

if getPlayerLevel(cid) >= 465 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 465 ou mais para poder resetar.")

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if getPlayerStorageValue(cid,1020) < 15 then

if getPlayerLevel(cid) >= 360 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 360 ou mais para poder resetar.")

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if getPlayerStorageValue(cid,1020) < 10 then

if getPlayerLevel(cid) >= 355 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 355 ou mais para poder resetar.")

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if getPlayerStorageValue(cid,1020) < 5 then

if getPlayerLevel(cid) >= 350 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 350 ou mais para poder resetar.")

end

end

-- Resets Vips --

----------------------------------------------------------------------------------------------------------------------------------------

if isPremium(cid) == TRUE then

if getPlayerStorageValue(cid,1020) < 85 then

if getPlayerLevel(cid) >= 950 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 950 ou mais para poder resetar.")

end

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if isPremium(cid) == TRUE then

if getPlayerStorageValue(cid,1020) < 80 then

if getPlayerLevel(cid) >= 880 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 880 ou mais para poder resetar.")

end

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if isPremium(cid) == TRUE then

if getPlayerStorageValue(cid,1020) < 75 then

if getPlayerLevel(cid) >= 800 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 800 ou mais para poder resetar.")

end

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if isPremium(cid) == TRUE then

if getPlayerStorageValue(cid,1020) < 70 then

if getPlayerLevel(cid) >= 750 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 750 ou mais para poder resetar.")

end

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if isPremium(cid) == TRUE then

if getPlayerStorageValue(cid,1020) < 65 then

if getPlayerLevel(cid) >= 730 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 730 ou mais para poder resetar.")

end

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if isPremium(cid) == TRUE then

if getPlayerStorageValue(cid,1020) < 60 then

if getPlayerLevel(cid) >= 690 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 690 ou mais para poder resetar.")

end

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if isPremium(cid) == TRUE then

if getPlayerStorageValue(cid,1020) < 55 then

if getPlayerLevel(cid) >= 650 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 650 ou mais para poder resetar.")

end

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if isPremium(cid) == TRUE then

if getPlayerStorageValue(cid,1020) < 50 then

if getPlayerLevel(cid) >= 600 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 600 ou mais para poder resetar.")

end

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if isPremium(cid) == TRUE then

if getPlayerStorageValue(cid,1020) < 45 then

if getPlayerLevel(cid) >= 540 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 540 ou mais para poder resetar.")

end

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if isPremium(cid) == TRUE then

if getPlayerStorageValue(cid,1020) < 40 then

if getPlayerLevel(cid) >= 520 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 520 ou mais para poder resetar.")

end

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if isPremium(cid) == TRUE then

if getPlayerStorageValue(cid,1020) < 35 then

if getPlayerLevel(cid) >= 500 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 500 ou mais para poder resetar.")

end

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if isPremium(cid) == TRUE then

if getPlayerStorageValue(cid,1020) < 30 then

if getPlayerLevel(cid) >= 480 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 480 ou mais para poder resetar.")

end

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if isPremium(cid) == TRUE then

if getPlayerStorageValue(cid,1020) < 25 then

if getPlayerLevel(cid) >= 470 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 470 ou mais para poder resetar.")

end

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if isPremium(cid) == TRUE then

if getPlayerStorageValue(cid,1020) < 20 then

if getPlayerLevel(cid) >= 360 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 360 ou mais para poder resetar.")

end

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if isPremium(cid) == TRUE then

if getPlayerStorageValue(cid,1020) < 15 then

if getPlayerLevel(cid) >= 355 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 355 ou mais para poder resetar.")

end

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if isPremium(cid) == TRUE then

if getPlayerStorageValue(cid,1020) < 10 then

if getPlayerLevel(cid) >= 340 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 340 ou mais para poder resetar.")

end

end

end

----------------------------------------------------------------------------------------------------------------------------------------

if isPremium(cid) == TRUE then

if getPlayerStorageValue(cid,1020) < 5 then

if getPlayerLevel(cid) >= 330 then

setPlayerStorageValue(cid,1020,getPlayerResets(cid)+1)

setPlayerStorageValue(cid,11548,os.time()+30)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)

db.executeQuery("UPDATE `players` SET `resets` = `resets` + 1 WHERE `id` = "..config.pid)

else

doPlayerSendCancel(cid,"Você precisa ter level 330 ou mais para poder resetar.")

end

end

end

return true

end

Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

  • 0

Use esse reset system que amostra

 

http://www.xtibia.com/forum/topic/138026-talk-action-advanced-reset-system/page__st__20

 

e o rank reset aki

 

function getPlayerNameByGUID2(n)
    local c = db.getResult("SELECT `name` FROM `players` WHERE `id` = "..n..";")
    if c:getID() == -1 then
		    return "SQL_ERROR["..n.."]"
    end
		    return c:getDataString("name")
    end
function onSay(cid, words, param)
    local max = 10
    local letters_to_next = 20
local skills = {
    ['fist'] = 0,
    ['club'] = 1,
    ['sword'] = 2,
    ['axe'] = 3,
    ['distance'] = 4,
    ['shielding'] = 5,
    ['fishing'] = 6,
    ['dist'] = 4,
    ['shield'] = 5,
    ['fish'] = 6,
}
    local name_now
    local name = "Highscore for level\n"
    local rkn = 0
    local no_break = 0
		    param = string.lower(param)
		    dofile('config.lua')
   if param == "" or param == "level" and ( param ~= "magic" and param == "ml") and skills[param] == nil then
		    name = name.."\n"
		    name = name.."Rank Level - Nome do Jogador\n"
    local v = db.getResult("SELECT `name`, `level`, `experience` FROM `players` WHERE `group_id` <= 2 ORDER BY `experience` DESC LIMIT 0,"..(max)..";")
    repeat
		    no_break = no_break +1
    if v:getID() == -1 then
    break
    end
		    rkn = rkn+1
		    name_now, l = v:getDataString("name"), string.len(v:getDataString("name"))
		    space = ""
    for i=1, letters_to_next-l do
		    space = space.." "
    end
		    name = name..rkn..". "..v:getDataInt("level") .."  -  "..name_now..space.." ".."\n"
    if no_break >= 20 then
    break
    end
    until v:next() == false
    elseif param == "magic" or param == "ml" then
		    name = name.."\n"
		    name = name.."Rank Magic - Nome do Jogador\n"
    local v = db.getResult("SELECT `name`, `level`, `maglevel` FROM `players` WHERE `group_id` <= 2 ORDER BY `maglevel` DESC LIMIT 0,"..(max)..";")
    repeat
    if v:getID() == -1 then
    break
    end
		    rkn = rkn+1
		    name_now, l = v:getDataString("name"), string.len(v:getDataString("name"))
		    space = ""
    for i=1, letters_to_next-l do
		    space = space.." "
    end
		    name = name..rkn..". "..v:getDataInt("maglevel").."  -  "..name_now..space.." ".." ".."".."\n"
    until v:next() == false
    elseif param == "reset" or param == "resets" then
		    name = name.."\n"
		    name = name.."Rank Reset - Nome do Jogador\n"
    local v = db.getResult("SELECT `player_id`, `value` FROM `player_storage` WHERE `key` = 1020 ORDER BY cast(value as INTEGER) DESC;")
    local kk = 0
    repeat
    if kk == max or v:getID() == -1 then
    break
    end
		    kk = kk+1
		    name_now, l = getPlayerNameByGUID2(v:getDataInt("player_id")), string.len(getPlayerNameByGUID2(v:getDataInt("play er_id")))
		    space = ""
    for i=1, letters_to_next-l do
		    space = space.." "
    end
    if name_now == nil then
		    name_now = 'sql error['..v:getDataInt("player_id")..']'
    end
		    name = name..kk..". "..v:getDataInt("value").."  -  "..name_now..space.." \n"
    until v:next() == false
    elseif skills[param] ~= nil then
		    name = name.."\n"
		    name = name.."Rank "..param.." fighting - Nome do Jogador\n"
    local v = db.getResult("SELECT `player_id`, `value` FROM `player_skills` WHERE `skillid` = "..skills[param].." ORDER BY `value` DESC;")
    local kk = 0
    repeat
    if kk == max or v:getID() == -1 then
    break
    end
		    kk = kk+1
		    name_now, l = getPlayerNameByGUID2(v:getDataInt("player_id")), string.len(getPlayerNameByGUID2(v:getDataInt("play er_id")))
		    space = ""
    for i=1, letters_to_next-l do
		    space = space.." "
    end
    if name_now == nil then
		    name_now = 'sql error['..v:getDataInt("player_id")..']'
    end
		    name = name..kk..". "..v:getDataInt("value").."  -  "..name_now..space.." \n"
    until v:next() == false
    end
    if name ~= "Highscore\n" then
		    doPlayerPopupFYI(cid, name)
    end
    return TRUE
end

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...