SU

Max Level

Por Subwat, 23 de abr. de 2011 em Archived

script
9
1.7k
SubwatS
23 de abril de 2011 às 15:19

bom eu to com um probleminha,eu criei um comando que se o player atinge o level maximo q é 717217 ele usa o comando !max e vai pro lvl 717218,só que tem um pequeno detalhe,qualquer player independente do lvl está conseguindo usar o comando e assim chegar ao lvl 717218.

 

quero que só quem é 717217 possa usar o comando,nem level maior nem level menor,único e exclusivamente para este level.

 

segue abaixo meu script.

 

-- Subwat Scripting--
function onSay(cid, words, param)
             maximum = {     
             player = getPlayerGUID(cid),         
             lvlmax = 717218,                       -- Level que o player vai ficar apos usar o comando.
       }

if getPlayerLevel(cid) <= 717217 and getPlayerStorageValue(cid,15915) then 
doPlayerSendCancel(cid, 'voce nao atingiu o level 717217 ou ja usou este comando.')
else
setPlayerStorageValue(cid, 15915)
doRemoveCreature(cid) 
db.executeQuery("UPDATE `players` SET `level` = "..maximum.lvlmax..", `experience` = 0 WHERE `id` = "..maximum.player) 
end
end 

 

 

 

 

quem ajudar leva um rep+ e um beijo na testa se quizer.

KimoszinK
24 de abril de 2011 às 00:22

Removido!

Editado Abril 24 por Kimoszin

24 de abril de 2011 às 00:32

-- Subwat Scripting--
function onSay(cid, words, param)
             maximum = {     
             player = getPlayerGUID(cid),         
             lvlmax = 717218,                       -- Level que o player vai ficar apos usar o comando.
       }

if getPlayerLevel(cid) ~= 717217 or getPlayerStorageValue(cid,15915) == 1 then 
doPlayerSendCancel(cid, 'voce nao atingiu o level 717217 ou ja usou este comando.')
else
setPlayerStorageValue(cid, 15915, 1)
doRemoveCreature(cid) 
db.executeQuery("UPDATE `players` SET `level` = "..maximum.lvlmax..", `experience` = 0 WHERE `id` = "..maximum.player) 
end
end

 

O comando getPlayerStorageValue sem comparação só ira retornar FALSE se o storage tiver valor nil, portanto, é necessário fazer a comparação.

 

Já o comando setPlayerStorageValue deve colocar algum valor a um storage.

 

Se você fez a Query certa, o script deve funcionar. Até mais.

Editado Abril 24 por Demonbholder

SubwatS
24 de abril de 2011 às 08:08

funcionou perfeitamente,muito obrigado minha amiga demonBholder, Um rep+ pra tu,mas quando o player morre ele volta pro lvl 1 oO

o que será isso?

24 de abril de 2011 às 19:42

retired.

Editado Abril 24 por Demonbholder

SubwatS
24 de abril de 2011 às 20:25

vou testar se nao funcionar vo bater em vc.

 

@edit nao funcionou ..

 

 

 

 

 

 

vo ti bater ashashuuhsa ,arruma ae :p

24 de abril de 2011 às 20:35

Ahhh, faz por login então:

 

 

function onLogin(cid)

             maximum = {     
             player = getPlayerGUID(cid),         
             lvlmax = 717217,                       -- Level que o player vai ficar apos usar o comando.
       }

if getPlayerLevel(cid) == 1 and getPlayerStorageValue(cid,15915) == 1 then 
doRemoveCreature(cid) 
db.executeQuery("UPDATE `players` SET `level` = "..maximum.lvlmax..", `experience` = 0 WHERE `id` = "..maximum.player) 
end
return TRUE
end

 

Edita a experiência que ele ficaria quando ele morre.

TedescooT
24 de abril de 2011 às 20:43

Me ajuda ae ? :D

 

http://www.xtibia.com/forum/topic/155583-pedido-de-script/

 

 

@topic

 

o gean o script que você falo que não funcionou o que você postou lá no começo , aqui funfo normal ;d

Só pra avisar e.e

SubwatS
24 de abril de 2011 às 21:50

vou testar miguxo