Ir para conteúdo

Reset System


netflat

Posts Recomendados

Bom meu sistema de reset tem dois níveis:

 

lvl 350 - 1 a 14 resets

lvl 450 - 14 resets+

 

queria adicionar mais um nível:

 

lvl 500 - 24 resets+

 

script:

 

function onSay(cid, words, param)

config = {
RemainingLvl=8, -- level que ficará depois de ser resetado.
exper=4200, -- experiencia que ficará depois de ser resetado.
pid=getPlayerGUID(cid), -- não mecha
redskull="yes", -- players com red skull podem resetar? ("yes" or "no").
bat="yes" --players precisam estar sem fight pra resetarem? ("yes" or "no").
}

function getResets(cid)
reset = getPlayerStorageValue(cid,1020)
if reset < 0 then
reset = 0
end
return reset
end

if(config.redskull == "no") and (getCreatureSkullType(cid) == 4) then
doPlayerSendTextMessage(cid,22,"Apenas player sem red skull podem resetar.")
return true
end

if(config.prot == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == false) then
doPlayerSendTextMessage(cid,22,"Você precisa estar em protection zone pra poder resetar.")
return true
end

if(config.bat == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == true) then
doPlayerSendTextMessage(cid,22,"Você precisa estar sem battle pra poder resetar.")
return true
end

if getPlayerStorageValue(cid,1020) > 14 then
if getPlayerLevel(cid) >= 450 then
setPlayerStorageValue(cid,1020,getResets(cid)+1)
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, "You need to have level 450 or more you may be reset.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end

elseif getPlayerLevel(cid) >= 350 then
setPlayerStorageValue(cid,1020,getResets(cid)+1)
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, "You need to have level 350 or more you may be reset.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
return true
end

Link para o comentário
Compartilhar em outros sites

function onSay(cid, words, param) 

config = { 
RemainingLvl=8, -- level que ficará depois de ser resetado. 
exper=4200, -- experiencia que ficará depois de ser resetado. 
pid=getPlayerGUID(cid), -- não mecha 
redskull="yes", -- players com red skull podem resetar? ("yes" or "no"). 
bat="yes" --players precisam estar sem fight pra resetarem? ("yes" or "no"). 
} 

function getResets(cid) 
reset = getPlayerStorageValue(cid,1020) 
if reset < 0 then 
reset = 0 
end 
return reset 
end 

if(config.redskull == "no") and (getCreatureSkullType(cid) == 4) then 
doPlayerSendTextMessage(cid,22,"Apenas player sem red skull podem resetar.") 
return true 
end 

if(config.prot == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == false) then 
doPlayerSendTextMessage(cid,22,"Você precisa estar em protection zone pra poder resetar.") 
return true 
end 

if(config.bat == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == true) then 
doPlayerSendTextMessage(cid,22,"Você precisa estar sem battle pra poder resetar.") 
return true 
end 


if getPlayerStorageValue(cid,1020) > 24 then 
if getPlayerLevel(cid) >= 500 then 
setPlayerStorageValue(cid,1020,getResets(cid)+1) 
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, "You need to have level 500 or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
end
else
doPlayerSendCancel(cid, "You need to have 24 reset or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end

if getPlayerStorageValue(cid,1020) > 14 then 
if getPlayerLevel(cid) >= 450 then 
setPlayerStorageValue(cid,1020,getResets(cid)+1) 
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, "You need to have level 450 or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
end
else
doPlayerSendCancel(cid, "You need to have 14 resets or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end

if getPlayerLevel(cid) >= 350 then 
setPlayerStorageValue(cid,1020,getResets(cid)+1) 
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, "You need to have level 350 or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
end 
return TRUE 
end 

Link para o comentário
Compartilhar em outros sites

hum valeu, vo testa aqui depois do almoço

 

ahh e se eu quiser colocar mais stages é so botar isso aqe?

 

if getPlayerStorageValue(cid,1020) > 24 then 
if getPlayerLevel(cid) >= 500 then 
setPlayerStorageValue(cid,1020,getResets(cid)+1) 
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, "You need to have level 500 or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
end
else
doPlayerSendCancel(cid, "You need to have 24 reset or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end

Link para o comentário
Compartilhar em outros sites

ta certo?

 

 

 

function onSay(cid, words, param)

config = {
RemainingLvl=8,
exper=4200,
pid=getPlayerGUID(cid),
redskull="yes",
prot="yes",
bat="yes"
}

function getResets(cid)
reset = getPlayerStorageValue(cid,1020)
if reset < 0 then
reset = 0
end
return reset
end

if(config.redskull == "no") and (getCreatureSkullType(cid) == 4) then
doPlayerSendTextMessage(cid,22,"Apenas player sem red skull podem resetar.")
return true
end

if(config.prot == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == false) then
doPlayerSendTextMessage(cid,22,"Você precisa estar em protection zone pra poder resetar.")
return true
end

if(config.bat == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == true) then
doPlayerSendTextMessage(cid,22,"Você precisa estar sem battle pra poder resetar.")
return true
end
----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1020) > 79 then 
if getPlayerLevel(cid) >= 780 then 
setPlayerStorageValue(cid,1020,getResets(cid)+1) 
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, "You need to have level 780 or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
end
else
doPlayerSendCancel(cid, "You need to have 79 reset or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1020) > 74 then 
if getPlayerLevel(cid) >= 730 then 
setPlayerStorageValue(cid,1020,getResets(cid)+1) 
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, "You need to have level 730 or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
end
else
doPlayerSendCancel(cid, "You need to have 74 reset or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1020) > 69 then 
if getPlayerLevel(cid) >= 680 then 
setPlayerStorageValue(cid,1020,getResets(cid)+1) 
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, "You need to have level 680 or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
end
else
doPlayerSendCancel(cid, "You need to have 69 reset or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1020) > 64 then 
if getPlayerLevel(cid) >= 630 then 
setPlayerStorageValue(cid,1020,getResets(cid)+1) 
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, "You need to have level 630 or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
end
else
doPlayerSendCancel(cid, "You need to have 64 reset or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1020) > 59 then 
if getPlayerLevel(cid) >= 590 then 
setPlayerStorageValue(cid,1020,getResets(cid)+1) 
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, "You need to have level 590 or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
end
else
doPlayerSendCancel(cid, "You need to have 59 reset or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1020) > 54 then 
if getPlayerLevel(cid) >= 550 then 
setPlayerStorageValue(cid,1020,getResets(cid)+1) 
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, "You need to have level 550 or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
end
else
doPlayerSendCancel(cid, "You need to have 54 reset or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1020) > 49 then 
if getPlayerLevel(cid) >= 510 then 
setPlayerStorageValue(cid,1020,getResets(cid)+1) 
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, "You need to have level 510 or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
end
else
doPlayerSendCancel(cid, "You need to have 49 reset or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1020) > 44 then 
if getPlayerLevel(cid) >= 480 then 
setPlayerStorageValue(cid,1020,getResets(cid)+1) 
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, "You need to have level 480 or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
end
else
doPlayerSendCancel(cid, "You need to have 44 reset or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1020) > 39 then 
if getPlayerLevel(cid) >= 450 then 
setPlayerStorageValue(cid,1020,getResets(cid)+1) 
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, "You need to have level 450 or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
end
else
doPlayerSendCancel(cid, "You need to have 39 reset or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1020) > 34 then 
if getPlayerLevel(cid) >= 430 then 
setPlayerStorageValue(cid,1020,getResets(cid)+1) 
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, "You need to have level 430 or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
end
else
doPlayerSendCancel(cid, "You need to have 34 reset or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1020) > 29 then 
if getPlayerLevel(cid) >= 410 then 
setPlayerStorageValue(cid,1020,getResets(cid)+1) 
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, "You need to have level 410 or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
end
else
doPlayerSendCancel(cid, "You need to have 29 reset or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1020) > 24 then 
if getPlayerLevel(cid) >= 390 then 
setPlayerStorageValue(cid,1020,getResets(cid)+1) 
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, "You need to have level 390 or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
end
else
doPlayerSendCancel(cid, "You need to have 24 reset or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1020) > 19 then 
if getPlayerLevel(cid) >= 380 then 
setPlayerStorageValue(cid,1020,getResets(cid)+1) 
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, "You need to have level 380 or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
end
else
doPlayerSendCancel(cid, "You need to have 19 reset or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1020) > 14 then 
if getPlayerLevel(cid) >= 365 then 
setPlayerStorageValue(cid,1020,getResets(cid)+1) 
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, "You need to have level 365 or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
end
else
doPlayerSendCancel(cid, "You need to have 14 reset or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
----------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1020) > 9 then 
if getPlayerLevel(cid) >= 360 then 
setPlayerStorageValue(cid,1020,getResets(cid)+1) 
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, "You need to have level 360 or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
end
else
doPlayerSendCancel(cid, "You need to have 9 reset or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerStorageValue(cid,1020) > 4 then 
if getPlayerLevel(cid) >= 355 then 
setPlayerStorageValue(cid,1020,getResets(cid)+1) 
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, "You need to have level 355 or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
end
else
doPlayerSendCancel(cid, "You need to have 4 resets or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
----------------------------------------------------------------------------------------------------------------------------------------
if getPlayerLevel(cid) >= 350 then 
setPlayerStorageValue(cid,1020,getResets(cid)+1) 
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, "You need to have level 350 or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
end 
return TRUE

 

 

 

Se eu remover isso aqe:

 

else
doPlayerSendCancel(cid, "You need to have 79 reset or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end

 

o script vai funcionar normal ainda?

Link para o comentário
Compartilhar em outros sites

Não remova o "end", remova apenas isso:

else
doPlayerSendCancel(cid, "You need to have 79 reset or more you may be reset.") 
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)

Abraços...

Link para o comentário
Compartilhar em outros sites

Vlw Doidin

 

bom eu não tinha testado ainda mais quando testei e ficava aparecendo que precisava de lvl 350 pra reseta =/ (eu tinha 16 resets)

 

e não aparecia erro no GUI '-'

Editado por Cykotitan
Link para o comentário
Compartilhar em outros sites

Observando o script, eu percebi que não há diferença alguma entre os resets de lvl 350 e os outros...

Ou seja, não fará diferença alguma o jogador possuir o lvl necessário pois sempre resetará para o mesmo ponto inicial. Não há motivo para colocar stages sem algum benefício...

 

 

 

flw

Link para o comentário
Compartilhar em outros sites

  • 3 weeks later...
×
×
  • Criar Novo...