Ir para conteúdo

[Pedido] Lv Para Um Iten


sloanbr

Posts Recomendados

Ola! aqui otStriker dono do Projeto Pokemon Server

 

Estou com uma duvida n estou conseguindo coloca para ter um certo LV para usar uma pokeball

Script do Go/Back

de um dos pokes

 

function onUse(cid, item, frompos, item2, topos)

dofile("./petconfig.lua")

 

 

 

function doPlayerAddSummon(cid, name, pos)

local MyCreature = doSummonCreature("crystal onix", pos)

doConvinceCreature(cid, MyCreature)

return MyCreature

end

 

 

local myPet = ""

local myPetUid = 0

 

 

if isExhausted(cid) == 1 then

return 0

end

if getPlayerStorageValue(cid, storages.petMag) == -1 then

setPlayerStorageValue(cid, storages.petMag, 0)

end

if isCreature(getPlayerStorageValue(cid, storages.petUid)) == 0 then

if getTilePzInfo(getCreaturePosition(cid)) == 0 then

if getPlayerStorageValue(cid, storages.petIsOnline) == 1 or getPlayerStorageValue(cid, storages.petIsOnline) == -1 then

for i = 1, #pets do

if isInArray(pets.vocations, getPlayerVocation(cid)) == 1 then

for k = 1, #pets.pets do

if pets.pets[k].level <= getPlayerLevel(cid) then

myPet = pets.pets[k].name

break

end

end

break

end

end

myPetUid = doPlayerAddSummon(cid, myPet, getCreaturePosition(cid))

if myPetUid ~= -1 then

setPlayerStorageValue(cid, storages.petUid, myPetUid)

if getPlayerStorageValue(cid, storages.petDamage) ~= 0 and getPlayerStorageValue(cid, storages.petDamage) ~= -1 then

if getPlayerStorageValue(cid, storages.petDamage) < getCreatureMaxHealth(getPlayerStorageValue(cid, storages.petUid)) then

doCreatureAddHealth(getPlayerStorageValue(cid, storages.petUid), getPlayerStorageValue(cid, storages.petDamage)*-1)

end

end

doChangeSpeed(myPetUid, getCreatureBaseSpeed(cid) - getCreatureBaseSpeed(myPetUid))

doCreatureSay(cid, "Crystal Onix Mostre um pouco da sua força Vai!", TALKTYPE_SAY)

addMana({cid = cid})

setPlayerStorageValue(cid, storages.petIsOnline, 2)

doSendMagicEffect(getCreaturePosition(myPetUid), 37)

else

doPlayerSendCancel(cid, 'Not enought room.')

end

else

doPlayerSendCancel(cid, 'Your <span class="highlight">pet</span> died! You have to revive it.')

end

else

doPlayerSendCancel(cid, 'You cannot summon your <span class="highlight">pet</span> in PZ.')

end

else

local daPet = getPlayerStorageValue(cid, storages.petUid)

setPlayerStorageValue(cid, storages.petDamage, getCreatureMaxHealth(daPet) - getCreatureHealth(daPet))

doCreatureSay(cid, "Isso ae Crystal Onix Bom trabalho Volte!", TALKTYPE_SAY)

setPlayerStorageValue(cid, storages.petIsOnline, 1)

doSendMagicEffect(getCreaturePosition(daPet), 37)

doRemoveCreature(daPet)

end

return setExhausted(cid)

end

 

Esse e um go/back do Crystal Onix id da pokeball dele e 2515

so que ate lv 8 pode usa queria colocar um certo lv para usar e n sei colocar se alguem souber +REP obrigado

Link para o comentário
Compartilhar em outros sites

function onUse(cid, item, frompos, item2, topos) 
dofile("./petconfig.lua")


function doPlayerAddSummon(cid, name, pos)
local MyCreature = doSummonCreature("crystal onix", pos) 
doConvinceCreature(cid, MyCreature)
return MyCreature
end


local myPet = ""
local myPetUid = 0


if isExhausted(cid) == 1 then
return 0
end
if getPlayerStorageValue(cid, storages.petMag) == -1 then
setPlayerStorageValue(cid, storages.petMag, 0)
end

local level = 50

if getPlayerLevel(cid) >= level then
if isCreature(getPlayerStorageValue(cid, storages.petUid)) == 0 then
if getTilePzInfo(getCreaturePosition(cid)) == 0 then
if getPlayerStorageValue(cid, storages.petIsOnline) == 1 or getPlayerStorageValue(cid, storages.petIsOnline) == -1 then
for i = 1, #pets do
if isInArray(pets[i].vocations, getPlayerVocation(cid)) == 1 then
for k = 1, #pets[i].pets do 
if pets[i].pets[k].level <= getPlayerLevel(cid) then
myPet = pets[i].pets[k].name
break
end
end
break
end
end
myPetUid = doPlayerAddSummon(cid, myPet, getCreaturePosition(cid))
if myPetUid ~= -1 then
setPlayerStorageValue(cid, storages.petUid, myPetUid)
if getPlayerStorageValue(cid, storages.petDamage) ~= 0 and getPlayerStorageValue(cid, storages.petDamage) ~= -1 then
if getPlayerStorageValue(cid, storages.petDamage) < getCreatureMaxHealth(getPlayerStorageValue(cid, storages.petUid)) then
doCreatureAddHealth(getPlayerStorageValue(cid, storages.petUid), getPlayerStorageValue(cid, storages.petDamage)*-1)
end
end
doChangeSpeed(myPetUid, getCreatureBaseSpeed(cid) - getCreatureBaseSpeed(myPetUid))
doCreatureSay(cid, "Crystal Onix Mostre um pouco da sua força Vai!", TALKTYPE_SAY)
addMana({cid = cid})
setPlayerStorageValue(cid, storages.petIsOnline, 2)
doSendMagicEffect(getCreaturePosition(myPetUid), 37)
else
doPlayerSendCancel(cid, 'Not enought room.')
end
else 
doPlayerSendCancel(cid, 'Your <span class="highlight">pet</span> died! You have to revive it.')
end
else
doPlayerSendCancel(cid, 'You cannot summon your <span class="highlight">pet</span> in PZ.')
end 
else
local daPet = getPlayerStorageValue(cid, storages.petUid)
setPlayerStorageValue(cid, storages.petDamage, getCreatureMaxHealth(daPet) - getCreatureHealth(daPet))
doCreatureSay(cid, "Isso ae Crystal Onix Bom trabalho Volte!", TALKTYPE_SAY)
setPlayerStorageValue(cid, storages.petIsOnline, 1)
doSendMagicEffect(getCreaturePosition(daPet), 37)
doRemoveCreature(daPet)
end
else
doPlayerSendCancel(cid, 'Você não tem level suficiente para usar o item.')
end
return setExhausted(cid)
end

Link para o comentário
Compartilhar em outros sites

AFF FUNFO VEIO MAIS TIPO EU QUERIA QUE APARECE UMA MENSAGEM TIPO VOCE N TEM LEVEL PARA USAR O CRYSTAL ONIX SO QUE APARECE YOU CANOT USE OBJECT MAAIS COM O RESETO FUNFO NORMAL

 

agora me ensina instalar esse sistema noos go/back para eu colocar ne todos os go/back ja dei rep

Link para o comentário
Compartilhar em outros sites

  • 2 weeks later...

Facilitando pra você...

embaixo de

function doPlayerAddSummon(cid, name, pos)

coloque

local level = 10
local errormsg = "You cannot use this pokemon"
if getPlayerLevel(cid) < level then
return doPlayerSendCancel(cid, errormsg)
end

 

tenta isso ;)

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

×
×
  • Criar Novo...