ZeNit91 11 Postado Março 21, 2013 Share Postado Março 21, 2013 (editado) Opa galera olha eu aki dinovo hahah. Estou postado apenas os que nao consego resolver por conta, resumindo ta virando rotina haha Quando vou ver o rank no quadro me depara com esse erro. Lembrando que a tabela no mysql ja esta certa, começou a dar isso depois da primeira arena que bugo e nao foi finalizada. [21/03/2013 18:54:31] [Error - Action Interface] [21/03/2013 18:54:31] data/actions/scripts/Quadro_Golden_Rank.lua:onUse [21/03/2013 18:54:31] Description: [21/03/2013 18:54:31] (luaGetPlayerNameByGUID) Player not found [21/03/2013 18:54:31] [Error - Action Interface] [21/03/2013 18:54:31] data/actions/scripts/Quadro_Golden_Rank.lua:onUse [21/03/2013 18:54:31] Description: [21/03/2013 18:54:31] data/lib/Golden Arena.lua:134: attempt to concatenate a nil value [21/03/2013 18:54:31] stack traceback: [21/03/2013 18:54:31] data/lib/Golden Arena.lua:134: in function 'getRankGolden' [21/03/2013 18:54:31] data/actions/scripts/Quadro_Golden_Rank.lua:4: in function <data/actions/scripts/Quadro_Golden_Rank.lua:1> Quadro_Golden_Rank function onUse(cid, item, fromPosition, itemEx, toPosition) if item.actionid == 55356 then local str = getRankGolden() if str ~= "" then doShowTextDialog(cid, 6527, str) --alterado v2.7 else doShowTextDialog(cid, 6527, "A error are occored! Sorry...") print("A Error occored with the Rank of the Golden Arena!") end return true end end Golden Arena.lua (lib) --[[storages 22545 = player q entra na arena (normal) 22546 = monstros na arena (normal) 22547 = waves (global) 22548 = qnts monstros tem na arena (global) 22549 = nome dos players q vao pra arena (global) 22550 = qnts players tem na arena (global) 22551 = waves para cada player (normal) ]] ------------------------------------------------------------------------------------------------------------------ function doWave(start) if getGlobalStorageValue(22550) >= 1 and getGlobalStorageValue(22548) <= 0 then local wave = getGlobalStorageValue(22547) <= 0 and 1 or getGlobalStorageValue(22547) local players = creaturesInGolden(GoldenUpper, GoldenLower, true) --pega os players na golden for i = 1, #posisGolden do if wavesGolden[wave] ~= "" then local monster = doSummonCreature(wavesGolden[wave], posisGolden) doSetMonsterPassive(monster) doWildAttackPlayer(monster, players[math.random(#players)]) doSendMagicEffect(getThingPos(monster), 21) setPlayerStorageValue(monster, 22546, 1) local sto = getGlobalStorageValue(22548) <= 0 and 0 or getGlobalStorageValue(22548) setGlobalStorageValue(22548, sto+1) end end for a = 1, #players do setPlayerStorageValue(players[a], 22551, wave) end setGlobalStorageValue(22547, wave+1) end end ------------------------------------------------------------------------------------------------------------------ function puxaParticipantes() local s = "" if getGlobalStorageValue(22549) ~= -1 then s = string.explode(getGlobalStorageValue(22549), ",") end if type(s) ~= 'table' or s == "" then print("Golden Arena will not begin, because no player are registered!") return true end for i = 1, #s do local sid = getPlayerByName(s) if isCreature(sid) then doTeleportThing(sid, getClosestFreeTile(sid, posGolden)) --pos pra onde os players vao ser teleportados quando a golden começar! doSendMagicEffect(getThingPos(sid), 21) if #getCreatureSummons(sid) >= 1 then doTeleportThing(getCreatureSummons(sid)[1], getClosestFreeTile(getCreatureSummons(sid)[1], posGolden)) --pos pra onde os pokes dos players serao teleportados! doSendMagicEffect(getThingPos(getCreatureSummons(sid)[1]), 21) end setPlayerStorageValue(sid, 22545, 1) setGlobalStorageValue(22550, (getGlobalStorageValue(22550) <= 0 and 0 or getGlobalStorageValue(22550))+1) end end setGlobalStorageValue(22549, -1) end ------------------------------------------------------------------------------------------------------------------ function endGoldenArena(onStart) for sto = 22547, 22550 do setGlobalStorageValue(sto, -1) end addEvent(creaturesInGolden, 150, GoldenUpper, GoldenLower, false, true, true) if not onStart then print("The Golden Arena are finished!") end end ------------------------------------------------------------------------------------------------------------------ function creaturesInGolden(upper, lower, player, remove, clean) -- function by Vodkart and edited by Slicer local players = {} for x = upper.x - 1, lower.x + 1 do for y = upper.y - 1, lower.y + 1 do local pos = {x = x, y = y, z = upper.z} local m = getTopCreature(pos).uid if remove ~= false and m ~= 0 and ehMonstro(m) then doRemoveCreature(m) end if clean ~= false then doCleanTile(pos, false) end if player ~= false and m ~= 0 and isPlayer(m) and getPlayerStorageValue(m, 22545) == 1 then table.insert(players, m) end end end if player ~= false then return players end end ------------------------------------------------------------------------------------------------------------------ function installRankGolden() if db.executeQuery("ALTER TABLE `players` ADD `Golden` integer not null default 0;") then if db.executeQuery("UPDATE `players` SET `Golden` = '10000' WHERE `id` = 1;") then local dir = "data/globalevents/scripts/start.lua" local arq = io.open(dir, "w") local base = 'function onStartup()\n\ndb.executeQuery("UPDATE `players` SET `online` = 0 WHERE `world_id` = " .. getConfigValue("worldId") .. ";")\n' base = base..'endGoldenArena(true)\n\nreturn true\nend' arq:write(base) arq:close() print("Table 'Golden' added with success!") end end return true end ------------------------------------------------------------------------------------------------------------------ function getPlayerRecordWaves(cid) if not isCreature(cid) then return 0 end local pid = getPlayerGUID(cid) local query = db.getResult("SELECT `Golden` FROM `players` WHERE `id` = "..pid..";") if query:getID() == -1 then return 0 end return query:getDataInt("Golden") end ------------------------------------------------------------------------------------------------------------------ function setPlayerRecordWaves(cid) if not isCreature(cid) then return false end local waves = getPlayerStorageValue(cid, 22551) local acc = getPlayerGUID(cid) if waves > getPlayerRecordWaves(cid) then if db.executeQuery("UPDATE `players` SET `Golden` = '"..waves.."' WHERE `id` = "..acc..";") then setPlayerStorageValue(cid, 22551, -1) return true end end return false end ------------------------------------------------------------------------------------------------------------------ function getRankGolden() local query = db.getResult("SELECT `id`, `Golden` FROM `players` ORDER BY `Golden` DESC;") local str = "Rank of the Golden Arena:\n\n" if query:getID() ~= -1 then for i = 1, 10 do if not(query:next()) or query:getDataInt("Golden") == 0 then str = str..""..i.."° None - 0 wave.\n" else local s = tonumber(query:getDataInt("Golden")) > 1 and "s" or "" str = str..""..i.."° "..getPlayerNameByGUID(query:getDataString("id")).." - "..query:getDataInt("Golden").." wave"..s..".\n" end end query:free() end return str end ------------------------------------------------------------------------------------------------------------------ Lembrando que ainda estou com duvidas aki tbm http://www.xtibia.co...-pokes-estatus/ Editado Março 21, 2013 por Zerons Link para o comentário https://xtibia.com/forum/topic/210330-encerrado-golden-quadro-erro/ Compartilhar em outros sites More sharing options...
Roksas 846 Postado Março 21, 2013 Share Postado Março 21, 2013 No caso o código é pra ver o ranking da golden arena?Se for e ela não tiver funcionando, é isso. Não ta achando a função getGoldenRank na lib, e ela ta no script dessa tal golden *-* Tem de arrumar ela. Link para o comentário https://xtibia.com/forum/topic/210330-encerrado-golden-quadro-erro/#findComment-1490900 Compartilhar em outros sites More sharing options...
Slicer 1070 Postado Março 21, 2013 Share Postado Março 21, 2013 (editado) /\ n sei aonde q tu viu q n ta achando o script u,U @topic sei la mano... esse script n foi feito para mySQL entao eh complicado... o erro ta nessa parte... getPlayerNameByGUID(query:getDataString("id")) soh q n faz sentido da erro.. a n ser q em mySQL n seja desse jeito q pega uma informaçao... ou, ele requer um int... tenta ir em lib/golden arena.lua e ache isso.. table.insert(str, i.."° "..getPlayerNameByGUID(query:getDataString("id")).." - "..query:getDataInt("Golden").." wave"..s..".\n") e troca para.. table.insert(str, i.."° "..getPlayerNameByGUID(query:getDataInt("id")).." - "..query:getDataInt("Golden").." wave"..s..".\n") se n der... good luck ;x Editado Março 21, 2013 por Slicer Link para o comentário https://xtibia.com/forum/topic/210330-encerrado-golden-quadro-erro/#findComment-1490938 Compartilhar em outros sites More sharing options...
ZeNit91 11 Postado Março 21, 2013 Autor Share Postado Março 21, 2013 Esta colocado só dar um olhada No caso o código é pra ver o ranking da golden arena?Se for e ela não tiver funcionando, é isso. Não ta achando a função getGoldenRank na lib, e ela ta no script dessa tal golden *-* Tem de arrumar ela. esta colocado só dar um olhada, ficarei grato se puder me ajuda =) /\ n sei aonde q tu viu q n ta achando o script u,U @topic sei la mano... esse script n foi feito para mySQL entao eh complicado... o erro ta nessa parte... getPlayerNameByGUID(query:getDataString("id")) soh q n faz sentido da erro.. a n ser q em mySQL n seja desse jeito q pega uma informaçao... ou, ele requer um int... tenta ir em lib/golden arena.lua e ache isso.. table.insert(str, i.."° "..getPlayerNameByGUID(query:getDataString("id")).." - "..query:getDataInt("Golden").." wave"..s..".\n") e troca para.. table.insert(str, i.."° "..getPlayerNameByGUID(query:getDataInt("id")).." - "..query:getDataInt("Golden").." wave"..s..".\n") se n der... good luck ;x Slicer da um olhada no codigo e me fala se encontra algo coloquei no inicio. Link para o comentário https://xtibia.com/forum/topic/210330-encerrado-golden-quadro-erro/#findComment-1490945 Compartilhar em outros sites More sharing options...
Slicer 1070 Postado Março 22, 2013 Share Postado Março 22, 2013 mano ja te flei qual eh o problema, se isso n resolver n sei oq pode ser.. good luck Link para o comentário https://xtibia.com/forum/topic/210330-encerrado-golden-quadro-erro/#findComment-1491034 Compartilhar em outros sites More sharing options...
ZeNit91 11 Postado Março 22, 2013 Autor Share Postado Março 22, 2013 Resolvido pode fexar. Link para o comentário https://xtibia.com/forum/topic/210330-encerrado-golden-quadro-erro/#findComment-1491457 Compartilhar em outros sites More sharing options...
Roksas 846 Postado Março 22, 2013 Share Postado Março 22, 2013 Tópico movido para a seção de dúvidas e pedidos resolvidos. Link para o comentário https://xtibia.com/forum/topic/210330-encerrado-golden-quadro-erro/#findComment-1491467 Compartilhar em outros sites More sharing options...
Stigal 585 Postado Abril 21, 2018 Share Postado Abril 21, 2018 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 https://xtibia.com/forum/topic/210330-encerrado-golden-quadro-erro/#findComment-1734033 Compartilhar em outros sites More sharing options...
Posts Recomendados