Ir para conteúdo

[Encerrado] [Fishing] - Erro!


didogunner

Posts Recomendados

O player não consegue usar o objeto "you cannot use this object." 21:48 You can't fish yet.

 

Gostaria de saber como "renovar" deixar o player sem essa msg de erro!

 

Erro!

 

[31/01/2013 18:38:17] [Error - Action Interface]

[31/01/2013 18:38:17] In a timer event called from:

[31/01/2013 18:38:17] data/actions/scripts/tools/fishing.lua:onUse

[31/01/2013 18:38:17] Description:

[31/01/2013 18:38:17] data/actions/scripts/tools/fishing.lua:104: attempt to index field '?' (a nil value)

[31/01/2013 18:38:17] stack traceback:

[31/01/2013 18:38:17] data/actions/scripts/tools/fishing.lua:104: in function <data/actions/scripts/tools/fishing.lua:91>

 

Segue meu fishing.lua

 

 

local condition = createConditionObject(CONDITION_INFIGHT)

setConditionParam(condition, CONDITION_PARAM_TICKS, 60000)

function onUse(cid, item, fromPos, itemEx, toPos)

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

return doPlayerSendCancel(cid, 'You cannot fish in protection zone')

end

doAddCondition(cid, condition)

 

d0 =

{

[0] = {pokemon = 'Magikarp'},

}

 

d20 =

{

[0] = {pokemon = 'Magikarp'},

[1] = {pokemon = 'Horsea'},

[2] = {pokemon = 'Poliwag'},

[3] = {pokemon = 'Krabby'},

}

 

d40 =

{

[0] = {pokemon = 'Magikarp'},

[1] = {pokemon = 'Horsea'},

[2] = {pokemon = 'Poliwag'},

[3] = {pokemon = 'Goldeen'},

[4] = {pokemon = 'Krabby'},

[5] = {pokemon = 'Tentacool'},

}

 

d60 =

{

[0] = {pokemon = 'Magikarp'},

[1] = {pokemon = 'Horsea'},

[2] = {pokemon = 'Poliwag'},

[3] = {pokemon = 'Goldeen'},

[4] = {pokemon = 'Krabby'},

[5] = {pokemon = 'Tentacool'},

[6] = {pokemon = 'Seaking'},

}

 

d80 =

{

[0] = {pokemon = 'Magikarp'},

[1] = {pokemon = 'Horsea'},

[2] = {pokemon = 'Poliwag'},

[3] = {pokemon = 'Goldeen'},

[4] = {pokemon = 'Krabby'},

[5] = {pokemon = 'Tentacool'},

[6] = {pokemon = 'Seaking'},

[7] = {pokemon = 'Starmie'},

[8] = {pokemon = 'Kingler'},

[9] = {pokemon = 'Seadra'},

}

 

d100 =

{

[0] = {pokemon = 'Magikarp'},

[1] = {pokemon = 'Horsea'},

[2] = {pokemon = 'Poliwag'},

[3] = {pokemon = 'Goldeen'},

[4] = {pokemon = 'Krabby'},

[5] = {pokemon = 'Tentacool'},

[6] = {pokemon = 'Seaking'},

[7] = {pokemon = 'Starmie'},

[8] = {pokemon = 'Kingler'},

[9] = {pokemon = 'Seadra'},

[10] = {pokemon = 'Starmie'},

[11] = {pokemon = 'Kingler'},

[12] = {pokemon = 'Seadra'},

 

}

local config = {

waters = {4614, 4615, 4616, 4617, 4618, 4619, 4608, 4609, 4610, 4611, 4612, 4613, 7236, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825},

}

 

if (getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 63215) >= 1) and not canFishWhileSurfingOrFlying then

doPlayerSendCancel(cid, "You can't fish while surfing/flying.")

return true

end

 

local skill = getPlayerSkillLevel(cid, 6)

local playerpos = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}

 

 

function Effect()

doSendMagicEffect(toPos, 2)

end

 

function Say()

if skill >= 0 and skill < 20 then

local random = math.random(0, 0)

doSendMagicEffect(getThingPos(cid), 173)

doSendMagicEffect(toPos, 53)

doSummonCreature(d0[random].pokemon, playerpos)

setPlayerStorageValue(cid, 171833, -1)

doPlayerAddSkillTry(cid, 6, 1)

 

elseif skill >= 20 and skill < 40 then

local random = math.random(0, 4)

doSendMagicEffect(getThingPos(cid), 173)

doSendMagicEffect(toPos, 53)

doSummonCreature(d20[random].pokemon, playerpos)

setPlayerStorageValue(cid, 171833, -1)

doPlayerAddSkillTry(cid, 6, 1)

 

elseif skill >= 40 and skill < 60 then

local random = math.random(0, 5)

doSendMagicEffect(getThingPos(cid), 173)

doSendMagicEffect(toPos, 53)

doSummonCreature(d40[random].pokemon, playerpos)

setPlayerStorageValue(cid, 171833, -1)

doPlayerAddSkillTry(cid, 6, 1)

 

elseif skill >= 60 and skill < 80 then

local random = math.random(0, 6)

doSendMagicEffect(getThingPos(cid), 173)

doSendMagicEffect(toPos, 53)

doSummonCreature(d60[random].pokemon, playerpos)

setPlayerStorageValue(cid, 171833, -1)

doPlayerAddSkillTry(cid, 6, 1)

 

elseif skill >= 80 and skill < 100 then

local random = math.random(0, 9)

doSendMagicEffect(getThingPos(cid), 173)

doSendMagicEffect(toPos, 53)

doSummonCreature(d80[random].pokemon, playerpos)

setPlayerStorageValue(cid, 171833, -1)

doPlayerAddSkillTry(cid, 6, 1)

 

elseif skill >= 100 then

local random = math.random(0, 12)

doSendMagicEffect(getThingPos(cid), 173)

doSendMagicEffect(toPos, 53)

doSummonCreature(d100[random].pokemon, playerpos)

setPlayerStorageValue(cid, 171833, -1)

doPlayerAddSkillTry(cid, 6, 1)

end

end

 

if(isInArray(config.waters, itemEx.itemid)) and getPlayerStorageValue(cid, 171833) >= 1 then

doPlayerSendTextMessage(cid, 27, "You can't fish yet.")

return false

end

 

if(isInArray(config.waters, itemEx.itemid)) and getPlayerStorageValue(cid, 171833) <= 0 then

setPlayerStorageValue(cid, 171833, 1)

doSendMagicEffect(toPos, CONST_ME_LOSEENERGY)

doSendMagicEffect(toPos, CONST_ME_LOSEENERGY)

for i = 1,3 do

addEvent(Effect,750*i,cid)

end

addEvent(Say,3000)

return true

end

return true

end

 

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

O player não consegue usar o objeto "you cannot use this object." 21:48 You can't fish yet.

 

Gostaria de saber como "renovar" deixar o player sem essa msg de erro!

 

Erro!

 

[31/01/2013 18:38:17] [Error - Action Interface]

[31/01/2013 18:38:17] In a timer event called from:

[31/01/2013 18:38:17] data/actions/scripts/tools/fishing.lua:onUse

[31/01/2013 18:38:17] Description:

[31/01/2013 18:38:17] data/actions/scripts/tools/fishing.lua:104: attempt to index field '?' (a nil value)

[31/01/2013 18:38:17] stack traceback:

[31/01/2013 18:38:17] data/actions/scripts/tools/fishing.lua:104: in function <data/actions/scripts/tools/fishing.lua:91>

 

Segue meu fishing.lua

 

 

local condition = createConditionObject(CONDITION_INFIGHT)

setConditionParam(condition, CONDITION_PARAM_TICKS, 60000)

function onUse(cid, item, fromPos, itemEx, toPos)

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

return doPlayerSendCancel(cid, 'You cannot fish in protection zone')

end

doAddCondition(cid, condition)

 

d0 =

{

[0] = {pokemon = 'Magikarp'},

}

 

d20 =

{

[0] = {pokemon = 'Magikarp'},

[1] = {pokemon = 'Horsea'},

[2] = {pokemon = 'Poliwag'},

[3] = {pokemon = 'Krabby'},

}

 

d40 =

{

[0] = {pokemon = 'Magikarp'},

[1] = {pokemon = 'Horsea'},

[2] = {pokemon = 'Poliwag'},

[3] = {pokemon = 'Goldeen'},

[4] = {pokemon = 'Krabby'},

[5] = {pokemon = 'Tentacool'},

}

 

d60 =

{

[0] = {pokemon = 'Magikarp'},

[1] = {pokemon = 'Horsea'},

[2] = {pokemon = 'Poliwag'},

[3] = {pokemon = 'Goldeen'},

[4] = {pokemon = 'Krabby'},

[5] = {pokemon = 'Tentacool'},

[6] = {pokemon = 'Seaking'},

}

 

d80 =

{

[0] = {pokemon = 'Magikarp'},

[1] = {pokemon = 'Horsea'},

[2] = {pokemon = 'Poliwag'},

[3] = {pokemon = 'Goldeen'},

[4] = {pokemon = 'Krabby'},

[5] = {pokemon = 'Tentacool'},

[6] = {pokemon = 'Seaking'},

[7] = {pokemon = 'Starmie'},

[8] = {pokemon = 'Kingler'},

[9] = {pokemon = 'Seadra'},

}

 

d100 =

{

[0] = {pokemon = 'Magikarp'},

[1] = {pokemon = 'Horsea'},

[2] = {pokemon = 'Poliwag'},

[3] = {pokemon = 'Goldeen'},

[4] = {pokemon = 'Krabby'},

[5] = {pokemon = 'Tentacool'},

[6] = {pokemon = 'Seaking'},

[7] = {pokemon = 'Starmie'},

[8] = {pokemon = 'Kingler'},

[9] = {pokemon = 'Seadra'},

[10] = {pokemon = 'Starmie'},

[11] = {pokemon = 'Kingler'},

[12] = {pokemon = 'Seadra'},

 

}

local config = {

waters = {4614, 4615, 4616, 4617, 4618, 4619, 4608, 4609, 4610, 4611, 4612, 4613, 7236, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825},

}

 

if (getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 63215) >= 1) and not canFishWhileSurfingOrFlying then

doPlayerSendCancel(cid, "You can't fish while surfing/flying.")

return true

end

 

local skill = getPlayerSkillLevel(cid, 6)

local playerpos = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}

 

 

function Effect()

doSendMagicEffect(toPos, 2)

end

 

function Say()

if skill >= 0 and skill < 20 then

local random = math.random(0, 0)

doSendMagicEffect(getThingPos(cid), 173)

doSendMagicEffect(toPos, 53)

doSummonCreature(d0[random].pokemon, playerpos)

setPlayerStorageValue(cid, 171833, -1)

doPlayerAddSkillTry(cid, 6, 1)

 

elseif skill >= 20 and skill < 40 then

local random = math.random(0, 4)

doSendMagicEffect(getThingPos(cid), 173)

doSendMagicEffect(toPos, 53)

doSummonCreature(d20[random].pokemon, playerpos)

setPlayerStorageValue(cid, 171833, -1)

doPlayerAddSkillTry(cid, 6, 1)

 

elseif skill >= 40 and skill < 60 then

local random = math.random(0, 5)

doSendMagicEffect(getThingPos(cid), 173)

doSendMagicEffect(toPos, 53)

doSummonCreature(d40[random].pokemon, playerpos)

setPlayerStorageValue(cid, 171833, -1)

doPlayerAddSkillTry(cid, 6, 1)

 

elseif skill >= 60 and skill < 80 then

local random = math.random(0, 6)

doSendMagicEffect(getThingPos(cid), 173)

doSendMagicEffect(toPos, 53)

doSummonCreature(d60[random].pokemon, playerpos)

setPlayerStorageValue(cid, 171833, -1)

doPlayerAddSkillTry(cid, 6, 1)

 

elseif skill >= 80 and skill < 100 then

local random = math.random(0, 9)

doSendMagicEffect(getThingPos(cid), 173)

doSendMagicEffect(toPos, 53)

doSummonCreature(d80[random].pokemon, playerpos)

setPlayerStorageValue(cid, 171833, -1)

doPlayerAddSkillTry(cid, 6, 1)

 

elseif skill >= 100 then

local random = math.random(0, 12)

doSendMagicEffect(getThingPos(cid), 173)

doSendMagicEffect(toPos, 53)

doSummonCreature(d100[random].pokemon, playerpos)

setPlayerStorageValue(cid, 171833, -1)

doPlayerAddSkillTry(cid, 6, 1)

end

end

 

if(isInArray(config.waters, itemEx.itemid)) and getPlayerStorageValue(cid, 171833) >= 1 then

doPlayerSendTextMessage(cid, 27, "You can't fish yet.")

return false

end

 

if(isInArray(config.waters, itemEx.itemid)) and getPlayerStorageValue(cid, 171833) <= 0 then

setPlayerStorageValue(cid, 171833, 1)

doSendMagicEffect(toPos, CONST_ME_LOSEENERGY)

doSendMagicEffect(toPos, CONST_ME_LOSEENERGY)

for i = 1,3 do

addEvent(Effect,750*i,cid)

end

addEvent(Say,3000)

return true

end

return true

end

 

 

e.e amigo veja se no actions.xml esta a ID do item certo! ou sua vara esteja configurada no dat editor como Usavel!

Link para o comentário
Compartilhar em outros sites

Ta certo sim man, o fishing funciona normalmente, ai do nada da isso em um player! e eu não sei nem como deixar ele com o action funcionando novamente fica nessa "you cannot use this object." 21:48 You can't fish yet.

 

<action itemid="2580" event="script" value="tools/fishing.lua" allowfaruse="1"/>

Link para o comentário
Compartilhar em outros sites

@Slicer

 

Continua o erro ;(

bom eu vou usar o seu... que ja vem no server

só tem 2 coisas

queria saber como funciona, skill = o quanto de fish que tem que ter pra pescar certo? e o level seria? o level que o player tem que ter?

 

E outra coisa, o skills estão subindo muitoooo lerdo aonde arrumo isso? no conf.lua ta 50x e ta lerdo ainda ;X

 

 

local fishing = {

["Magikarp"] = {skill = 0, level = -2},

}

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

level soh funciona pro serv como lvl.. eh ate q lvl o poke pescado pode vir... no serv sem lvl ele n serve para nd...

 

vai em XML/vocations.xml... vais achar.. fishing="3.0" .. diminua isso.. para no maximo "1.0"!

Link para o comentário
Compartilhar em outros sites

  • 2 weeks later...
  • 5 years later...
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.
Link para o comentário
Compartilhar em outros sites

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