Ir para conteúdo

[Encerrado] Erro No Log - Pda


GuhPk

Posts Recomendados

Pessoal, uso server base Pda, e esta aparecendo este erro:

 

 

[11/12/2012 14:37:31] data/creaturescripts/scripts/recompenselvl.lua:10: in function <data/creaturescripts/scripts/recompenselvl.lua:1>

[11/12/2012 14:37:31] [C]: in function 'doPlayerAddExp'

[11/12/2012 14:37:31] data/creaturescripts/scripts/pokeexp.lua:5: in function 'playerAddExp'

[11/12/2012 14:37:31] data/creaturescripts/scripts/pokeexp.lua:10: in function 'giveExpToPlayer'

[11/12/2012 14:37:31] data/creaturescripts/scripts/pokeexp.lua:95: in function <data/creaturescripts/scripts/pokeexp.lua:41>

 

Script:

 

 

 

 

local balls = {11826, 11828, 11829, 11831, 11832, 11834, 11835, 11837,

11737, 11739, 11740, 11742, 11743, 11745, 11746, 11748}

 

local function playerAddExp(cid, exp)

doPlayerAddExp(cid, exp)

doSendAnimatedText(getThingPos(cid), exp, 215)

end

 

local function giveExpToPlayer(pk, expTotal, givenexp, expstring) --alterado v2.7

playerAddExp(pk, expTotal)

local firstball = getPlayerSlotItem(pk, 8)

 

if not isInParty(pk) and firstball and getItemAttribute(firstball.uid, expstring) and getItemAttribute(firstball.uid, expstring) > 0 then

local percent = getItemAttribute(firstball.uid, expstring) <= 1 and getItemAttribute(firstball.uid, expstring) or 1

local gainexp = math.ceil(percent * givenexp)

doItemSetAttribute(firstball.uid, expstring, 0)

givePokemonExp(pk, firstball, expTotal) --alterado v2.7

elseif isInParty(pk) and firstball.uid ~= 0 then

givePokemonExp(pk, firstball, expTotal*3) --alterado v2.7

end

 

for b = 1, #balls do

local pokes = getItemsInContainerById(getPlayerSlotItem(pk, 3).uid, balls)

if #pokes >= 1 then

for _, uid in pairs (pokes) do

if not isInParty(pk) and getItemAttribute(uid, expstring) and getItemAttribute(uid, expstring) > 0 then

local percent = getItemAttribute(uid, expstring) <= 1 and getItemAttribute(uid, expstring) or 1

local gainexp = math.ceil(percent * givenexp)

doItemSetAttribute(uid, expstring, 0)

givePokemonExpInBp(pk, uid, gainexp, balls) --alterado v2.7

elseif isInParty(pk) and getItemAttribute(uid, expstring) and getItemAttribute(uid, expstring) > 0 then

givePokemonExpInBp(pk, uid, expTotal*3, balls)

end

end

end

end

end

 

 

 

function onDeath(cid, corpse, deathList)

 

--if not isCreature(cid) then return true end

if isSummon(cid) or not deathList or corpse.itemid == 0 or getCreatureName(cid) == "Evolution" then return true end

 

-------------Edited Golden Arena------------------------- --alterado v2.7 \/\/

if getPlayerStorageValue(cid, 22546) == 1 then

setGlobalStorageValue(22548, getGlobalStorageValue(22548)-1)

doItemSetAttribute(corpse.uid, "golden", 1)

end

if getPlayerStorageValue(cid, 22546) == 1 and getGlobalStorageValue(22548) <= 0 then

local wave = getGlobalStorageValue(22547)

for _, sid in ipairs(getPlayersOnline()) do

if isPlayer(sid) and getPlayerStorageValue(sid, 22545) == 1 then

if getGlobalStorageValue(22547) < #wavesGolden+1 then

doPlayerSendTextMessage(sid, 21, "Wave "..wave.." will begin in "..timeToWaves.."seconds!")

doPlayerSendTextMessage(sid, 28, "Wave "..wave.." will begin in "..timeToWaves.."seconds!")

addEvent(creaturesInGolden, 100, GoldenUpper, GoldenLower, false, true, true)

addEvent(doWave, timeToWaves*1000)

elseif getGlobalStorageValue(22547) == #wavesGolden+1 then

doPlayerSendTextMessage(sid, 20, "You have win the golden arena! Take your reward!")

doPlayerAddItem(sid, 2152, getPlayerStorageValue(sid, 22551)*2) --recompensa no final da golden!

setPlayerStorageValue(sid, 22545, -1)

doTeleportThing(sid, getClosestFreeTile(sid, posBackGolden), false)

setPlayerRecordWaves(sid)

end

end

end

if getGlobalStorageValue(22547) == #wavesGolden+1 then

endGoldenArena()

end

end

--------------------------------------------------- /\/\

 

local givenexp = getWildPokemonExp(cid)

local expstring = ""..cid.."expEx"

local killer = getItemAttribute(corpse.uid, "corpseowner")

 

if givenexp > 0 then

for a = 1, #deathList do

local pk = deathList[a]

if isCreature(pk) then

local list = getSpectators(getThingPosWithDebug(pk), 30, 30, false)

local expTotal = math.floor(playerExperienceRate * givenexp * getDamageMapPercent(pk, cid))

local party = getPartyMembers(pk)

 

if isInParty(pk) and getPlayerStorageValue(pk, 4875498) <= -1 then

expTotal = math.floor(expTotal/#party) --alterado v2.6.1

for i = 1, #party do

if isInArray(list, party) then

giveExpToPlayer(party, expTotal, givenexp, expstring)--alterado v2.7

end

end

else

giveExpToPlayer(pk, expTotal, givenexp, expstring) --alterado v2.7

end

 

end

end

end

 

if isNpcSummon(cid) then

local master = getCreatureMaster(cid)

doSendMagicEffect(getThingPos(cid), getPlayerStorageValue(cid, 10000))

doCreatureSay(master, getPlayerStorageValue(cid, 10001), 1)

doRemoveCreature(cid)

return false

end

 

 

doItemSetAttribute(corpse.uid, "offense", getPlayerStorageValue(cid, 1011))

doItemSetAttribute(corpse.uid, "defense", getPlayerStorageValue(cid, 1012))

doItemSetAttribute(corpse.uid, "speed", getPlayerStorageValue(cid, 1013))

doItemSetAttribute(corpse.uid, "vitality", getPlayerStorageValue(cid, 1014))

doItemSetAttribute(corpse.uid, "spattack", getPlayerStorageValue(cid, 1015))

doItemSetAttribute(corpse.uid, "level", getLevel(cid))

doItemSetAttribute(corpse.uid, "gender", getPokemonGender(cid))

return true

end

 

 

 

Alguém ai sabe arrumar? =]

Link para o comentário
Compartilhar em outros sites

Vi uma linha errada, Não testei e não sei se é só isso mas...

 

 

local balls = {11826, 11828, 11829, 11831, 11832, 11834, 11835, 11837,

11737, 11739, 11740, 11742, 11743, 11745, 11746, 11748}

 

local function playerAddExp(cid, exp)

doPlayerAddExp(cid, exp)

doSendAnimatedText(getThingPos(cid), exp, 215)

end

 

local function giveExpToPlayer(pk, expTotal, givenexp, expstring) --alterado v2.7

doPlayerAddExp(pk, expTotal)

local firstball = getPlayerSlotItem(pk, 8)

 

if not isInParty(pk) and firstball and getItemAttribute(firstball.uid, expstring) and getItemAttribute(firstball.uid, expstring) > 0 then

local percent = getItemAttribute(firstball.uid, expstring) <= 1 and getItemAttribute(firstball.uid, expstring) or 1

local gainexp = math.ceil(percent * givenexp)

doItemSetAttribute(firstball.uid, expstring, 0)

givePokemonExp(pk, firstball, expTotal) --alterado v2.7

elseif isInParty(pk) and firstball.uid ~= 0 then

givePokemonExp(pk, firstball, expTotal*3) --alterado v2.7

end

 

for b = 1, #balls do

local pokes = getItemsInContainerById(getPlayerSlotItem(pk, 3).uid, balls)

if #pokes >= 1 then

for _, uid in pairs (pokes) do

if not isInParty(pk) and getItemAttribute(uid, expstring) and getItemAttribute(uid, expstring) > 0 then

local percent = getItemAttribute(uid, expstring) <= 1 and getItemAttribute(uid, expstring) or 1

local gainexp = math.ceil(percent * givenexp)

doItemSetAttribute(uid, expstring, 0)

givePokemonExpInBp(pk, uid, gainexp, balls) --alterado v2.7

elseif isInParty(pk) and getItemAttribute(uid, expstring) and getItemAttribute(uid, expstring) > 0 then

givePokemonExpInBp(pk, uid, expTotal*3, balls)

end

end

end

end

end

 

 

 

function onDeath(cid, corpse, deathList)

 

--if not isCreature(cid) then return true end

if isSummon(cid) or not deathList or corpse.itemid == 0 or getCreatureName(cid) == "Evolution" then return true end

 

-------------Edited Golden Arena------------------------- --alterado v2.7 \/\/

if getPlayerStorageValue(cid, 22546) == 1 then

setGlobalStorageValue(22548, getGlobalStorageValue(22548)-1)

doItemSetAttribute(corpse.uid, "golden", 1)

end

if getPlayerStorageValue(cid, 22546) == 1 and getGlobalStorageValue(22548) <= 0 then

local wave = getGlobalStorageValue(22547)

for _, sid in ipairs(getPlayersOnline()) do

if isPlayer(sid) and getPlayerStorageValue(sid, 22545) == 1 then

if getGlobalStorageValue(22547) < #wavesGolden+1 then

doPlayerSendTextMessage(sid, 21, "Wave "..wave.." will begin in "..timeToWaves.."seconds!")

doPlayerSendTextMessage(sid, 28, "Wave "..wave.." will begin in "..timeToWaves.."seconds!")

addEvent(creaturesInGolden, 100, GoldenUpper, GoldenLower, false, true, true)

addEvent(doWave, timeToWaves*1000)

elseif getGlobalStorageValue(22547) == #wavesGolden+1 then

doPlayerSendTextMessage(sid, 20, "You have win the golden arena! Take your reward!")

doPlayerAddItem(sid, 2152, getPlayerStorageValue(sid, 22551)*2) --recompensa no final da golden!

setPlayerStorageValue(sid, 22545, -1)

doTeleportThing(sid, getClosestFreeTile(sid, posBackGolden), false)

setPlayerRecordWaves(sid)

end

end

end

if getGlobalStorageValue(22547) == #wavesGolden+1 then

endGoldenArena()

end

end

--------------------------------------------------- /\/\

 

local givenexp = getWildPokemonExp(cid)

local expstring = ""..cid.."expEx"

local killer = getItemAttribute(corpse.uid, "corpseowner")

 

if givenexp > 0 then

for a = 1, #deathList do

local pk = deathList[a]

if isCreature(pk) then

local list = getSpectators(getThingPosWithDebug(pk), 30, 30, false)

local expTotal = math.floor(playerExperienceRate * givenexp * getDamageMapPercent(pk, cid))

local party = getPartyMembers(pk)

 

if isInParty(pk) and getPlayerStorageValue(pk, 4875498) <= -1 then

expTotal = math.floor(expTotal/#party) --alterado v2.6.1

for i = 1, #party do

if isInArray(list, party) then

giveExpToPlayer(party, expTotal, givenexp, expstring)--alterado v2.7

end

end

else

AddExptoPlayer(pk, expTotal, givenexp, expstring) --alterado v2.7

end

 

end

end

end

 

if isNpcSummon(cid) then

local master = getCreatureMaster(cid)

doSendMagicEffect(getThingPos(cid), getPlayerStorageValue(cid, 10000))

doCreatureSay(master, getPlayerStorageValue(cid, 10001), 1)

doRemoveCreature(cid)

return false

end

 

 

doItemSetAttribute(corpse.uid, "offense", getPlayerStorageValue(cid, 1011))

doItemSetAttribute(corpse.uid, "defense", getPlayerStorageValue(cid, 1012))

doItemSetAttribute(corpse.uid, "speed", getPlayerStorageValue(cid, 1013))

doItemSetAttribute(corpse.uid, "vitality", getPlayerStorageValue(cid, 1014))

doItemSetAttribute(corpse.uid, "spattack", getPlayerStorageValue(cid, 1015))

doItemSetAttribute(corpse.uid, "level", getLevel(cid))

doItemSetAttribute(corpse.uid, "gender", getPokemonGender(cid))

return true

end

 

 

Link para o comentário
Compartilhar em outros sites

Ainda está com o erro...

 

 

 

[12/12/2012 09:52:57] [Error - CreatureScript Interface]

[12/12/2012 09:52:57] data/creaturescripts/scripts/pokeexp.lua:onDeath

[12/12/2012 09:52:57] Description:

[12/12/2012 09:52:57] data/creaturescripts/scripts/pokeexp.lua:95: attempt to call global 'AddExptoPlayer' (a nil value)

[12/12/2012 09:52:57] stack traceback:

[12/12/2012 09:52:57] data/creaturescripts/scripts/pokeexp.lua:95: in function <data/creaturescripts/scripts/pokeexp.lua:41>

Link para o comentário
Compartilhar em outros sites

Se tem certeza que o seu pokeexp ta certo? Você não renomeio erraddo? meu pokeexp está assim:

 

 

local function playerAddExp(cid, exp)

doPlayerAddExp(cid, exp)

doSendAnimatedText(getThingPos(cid), exp, 215)

end

 

 

function onDeath(cid, corpse, deathList)

 

--if not isCreature(cid) then return true end

if isSummon(cid) or not deathList or corpse.itemid == 0 or getCreatureName(cid) == "Evolution" then return true end

 

-------------Edited Golden Arena------------------------- --alterado v1.7 \/\/

if getPlayerStorageValue(cid, 22546) == 1 then

setGlobalStorageValue(22548, getGlobalStorageValue(22548)-1)

doItemSetAttribute(corpse.uid, "golden", 1)

end

if getPlayerStorageValue(cid, 22546) == 1 and getGlobalStorageValue(22548) <= 0 then

local wave = getGlobalStorageValue(22547)

for _, sid in ipairs(getPlayersOnline()) do

if isPlayer(sid) and getPlayerStorageValue(sid, 22545) == 1 then

if getGlobalStorageValue(22547) < #wavesGolden+1 then

doPlayerSendTextMessage(sid, 21, "Wave "..wave.." will begin in "..timeToWaves.."seconds!")

doPlayerSendTextMessage(sid, 28, "Wave "..wave.." will begin in "..timeToWaves.."seconds!")

addEvent(creaturesInGolden, 100, GoldenUpper, GoldenLower, false, true, true)

addEvent(doWave, timeToWaves*1000)

elseif getGlobalStorageValue(22547) == #wavesGolden+1 then

doPlayerSendTextMessage(sid, 20, "You have win the golden arena! Take your reward!")

doPlayerAddItem(sid, 2152, getPlayerStorageValue(sid, 22551)*2) --recompensa, a storage ali eh qnts waves o player guento!

setPlayerStorageValue(sid, 22545, -1)

doTeleportThing(sid, getClosestFreeTile(sid, posBackGolden), false)

setPlayerRecordWaves(sid)

end

end

end

if getGlobalStorageValue(22547) == #wavesGolden+1 then

endGoldenArena()

end

end

--------------------------------------------------- /\/\

local givenexp = getWildPokemonExp(cid)

local killer = getItemAttribute(corpse.uid, "corpseowner")

 

if givenexp > 0 then

for a = 1, #deathList do

local pk = deathList[a]

---

local list = getSpectators(getThingPosWithDebug(pk), 30, 30, false)

if isCreature(pk) then

local expTotal = math.floor(playerExperienceRate * givenexp * getDamageMapPercent(pk, cid))

local party = getPartyMembers(pk)

if isInParty(pk) and getPlayerStorageValue(pk, 4875498) <= -1 then

expTotal = math.floor(expTotal/#party) --alterado v1.6.1

for i = 1, #party do

if isInArray(list, party) then

playerAddExp(party, expTotal)

end

end

else

playerAddExp(pk, expTotal)

end

end

end

end

 

if isNpcSummon(cid) then

local master = getCreatureMaster(cid)

doSendMagicEffect(getThingPos(cid), getPlayerStorageValue(cid, 10000))

doCreatureSay(master, getPlayerStorageValue(cid, 10001), 1)

doRemoveCreature(cid)

return false

end

 

doItemSetAttribute(corpse.uid, "level", getPokemonLevel(cid))

doItemSetAttribute(corpse.uid, "gender", getPokemonGender(cid))

return true

end

 

 

 

Mas se estiver, é por que o server não tem essa função então add isso e ve se funciona agr

 


local function AddExpToPlayer(pk, expTotal, givenexp, expstring)
doPlayerAddExp(cid, exp)
doSendAnimatedText(getThingPos(cid), exp, 215)
end

:

Obs: Não testei, foi uma sugestão, mas testa.

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

Não testei mas...

 

 

local balls = {11826, 11828, 11829, 11831, 11832, 11834, 11835, 11837,

11737, 11739, 11740, 11742, 11743, 11745, 11746, 11748}

 

local function playerAddExp(cid, exp)

doPlayerAddExp(cid, exp)

doSendAnimatedText(getThingPos(cid), exp, 215)

end

 

local function giveExpToPlayer(pk, expTotal, givenexp, expstring) --alterado v2.7

doPlayerAddExp(pk, expTotal)

local firstball = getPlayerSlotItem(pk, 8)

 

if not isInParty(pk) and firstball and getItemAttribute(firstball.uid, expstring) and getItemAttribute(firstball.uid, expstring) > 0 then

local percent = getItemAttribute(firstball.uid, expstring) <= 1 and getItemAttribute(firstball.uid, expstring) or 1

local gainexp = math.ceil(percent * givenexp)

doItemSetAttribute(firstball.uid, expstring, 0)

givePokemonExp(pk, firstball, expTotal) --alterado v2.7

elseif isInParty(pk) and firstball.uid ~= 0 then

givePokemonExp(pk, firstball, expTotal*3) --alterado v2.7

end

 

for b = 1, #balls do

local pokes = getItemsInContainerById(getPlayerSlotItem(pk, 3).uid, balls)

if #pokes >= 1 then

for _, uid in pairs (pokes) do

if not isInParty(pk) and getItemAttribute(uid, expstring) and getItemAttribute(uid, expstring) > 0 then

local percent = getItemAttribute(uid, expstring) <= 1 and getItemAttribute(uid, expstring) or 1

local gainexp = math.ceil(percent * givenexp)

doItemSetAttribute(uid, expstring, 0)

givePokemonExpInBp(pk, uid, gainexp, balls) --alterado v2.7

elseif isInParty(pk) and getItemAttribute(uid, expstring) and getItemAttribute(uid, expstring) > 0 then

givePokemonExpInBp(pk, uid, expTotal*3, balls)

end

end

end

end

end

 

 

 

function onDeath(cid, corpse, deathList)

 

--if not isCreature(cid) then return true end

if isSummon(cid) or not deathList or corpse.itemid == 0 or getCreatureName(cid) == "Evolution" then return true end

 

-------------Edited Golden Arena------------------------- --alterado v2.7 \/\/

if getPlayerStorageValue(cid, 22546) == 1 then

setGlobalStorageValue(22548, getGlobalStorageValue(22548)-1)

doItemSetAttribute(corpse.uid, "golden", 1)

end

if getPlayerStorageValue(cid, 22546) == 1 and getGlobalStorageValue(22548) <= 0 then

local wave = getGlobalStorageValue(22547)

for _, sid in ipairs(getPlayersOnline()) do

if isPlayer(sid) and getPlayerStorageValue(sid, 22545) == 1 then

if getGlobalStorageValue(22547) < #wavesGolden+1 then

doPlayerSendTextMessage(sid, 21, "Wave "..wave.." will begin in "..timeToWaves.."seconds!")

doPlayerSendTextMessage(sid, 28, "Wave "..wave.." will begin in "..timeToWaves.."seconds!")

addEvent(creaturesInGolden, 100, GoldenUpper, GoldenLower, false, true, true)

addEvent(doWave, timeToWaves*1000)

elseif getGlobalStorageValue(22547) == #wavesGolden+1 then

doPlayerSendTextMessage(sid, 20, "You have win the golden arena! Take your reward!")

doPlayerAddItem(sid, 2152, getPlayerStorageValue(sid, 22551)*2) --recompensa no final da golden!

setPlayerStorageValue(sid, 22545, -1)

doTeleportThing(sid, getClosestFreeTile(sid, posBackGolden), false)

setPlayerRecordWaves(sid)

end

end

end

if getGlobalStorageValue(22547) == #wavesGolden+1 then

endGoldenArena()

end

end

--------------------------------------------------- /\/\

 

local function AddExpToPlayer(pk, expTotal, givenexp, expstring)

doPlayerAddExp(cid, exp)

doSendAnimatedText(getThingPos(cid), exp, 215)

end

 

 

 

local givenexp = getWildPokemonExp(cid)

local expstring = ""..cid.."expEx"

local killer = getItemAttribute(corpse.uid, "corpseowner")

 

if givenexp > 0 then

for a = 1, #deathList do

local pk = deathList[a]

if isCreature(pk) then

local list = getSpectators(getThingPosWithDebug(pk), 30, 30, false)

local expTotal = math.floor(playerExperienceRate * givenexp * getDamageMapPercent(pk, cid))

local party = getPartyMembers(pk)

 

if isInParty(pk) and getPlayerStorageValue(pk, 4875498) <= -1 then

expTotal = math.floor(expTotal/#party) --alterado v2.6.1

for i = 1, #party do

if isInArray(list, party) then

giveExpToPlayer(party, expTotal, givenexp, expstring)--alterado v2.7

end

end

else

AddExptoPlayer(pk, expTotal, givenexp, expstring) --alterado v2.7

end

 

end

end

end

 

if isNpcSummon(cid) then

local master = getCreatureMaster(cid)

doSendMagicEffect(getThingPos(cid), getPlayerStorageValue(cid, 10000))

doCreatureSay(master, getPlayerStorageValue(cid, 10001), 1)

doRemoveCreature(cid)

return false

end

 

 

doItemSetAttribute(corpse.uid, "offense", getPlayerStorageValue(cid, 1011))

doItemSetAttribute(corpse.uid, "defense", getPlayerStorageValue(cid, 1012))

doItemSetAttribute(corpse.uid, "speed", getPlayerStorageValue(cid, 1013))

doItemSetAttribute(corpse.uid, "vitality", getPlayerStorageValue(cid, 1014))

doItemSetAttribute(corpse.uid, "spattack", getPlayerStorageValue(cid, 1015))

doItemSetAttribute(corpse.uid, "level", getLevel(cid))

doItemSetAttribute(corpse.uid, "gender", getPokemonGender(cid))

return true

end

 

qualquer coisa se estiver errado, Slicer corrige.

Link para o comentário
Compartilhar em outros sites

  • 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...