MUTAN0 1 Postado Janeiro 25, 2009 Share Postado Janeiro 25, 2009 (editado) Gente, ta dando uns erros estranhos no arquivo data/creaturescripts/scripts/playerdeath.lua... Acontece da seguinte forma: Lua Script Error: [CreatureScript Interface]data/creaturescripts/scripts/playerdeath.lua:onDeath data/creaturescripts/scripts/playerdeath.lua:10: attempt to index global 'luasql ' (a nil value) stack traceback: data/creaturescripts/scripts/playerdeath.lua:10: in function <data/creat urescripts/scripts/playerdeath.lua:3> PLAYER has logged out. PLAYER has logged in. Ai no caso quando o PLAYER desloga (logged out) é pq ele morreu, e quando loga (logged in) no santuario. Eu percebi que por isso as mortes dos players não são salvas. Script playerdeath.lua: dofile("./config.lua")function onDeath(cid, corpse, killer) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You are dead.") if deathListEnabled == "yes" then if sqlType == "mysql" then env = assert(luasql.mysql()) con = assert(env:connect(mysqlDatabase, mysqlUser, mysqlPass, mysqlHost, mysqlPort)) else -- sqlite env = assert(luasql.sqlite3()) con = assert(env:connect(sqliteDatabase)) end local byPlayer = FALSE if killer == FALSE then killerName = "field item" else if isPlayer(killer) == TRUE then byPlayer = TRUE end killerName = getCreatureName(killer) end assert(con:execute("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", '" .. escapeString(killerName) .. "', " .. byPlayer .. ");")) local cursor = assert(con:execute("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";")) local deathRecords = numRows(cursor) if sqlType == "mysql" then while deathRecords > maxDeathRecords do delete = assert(con:execute("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1;")) deathRecords = deathRecords - 1 end else while deathRecords > maxDeathRecords do delete = assert(con:execute("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1);")) deathRecords = deathRecords - 1 end end con:close() env:close() end end Aguardo ajuda :smile_positivo: Valeu. Abraços. Editado Janeiro 25, 2009 por MUTAN0 Link para o comentário https://xtibia.com/forum/topic/106100-playerdeathlua-erro/ Compartilhar em outros sites More sharing options...
tibiaa4e 86 Postado Janeiro 25, 2009 Share Postado Janeiro 25, 2009 (editado) Por que parece que tiraram o Luasql Pessoal do tfs eh anormal mesmo Então temos que esperar eles refazerem o death em c++ Editado Janeiro 25, 2009 por tibiaa4e Link para o comentário https://xtibia.com/forum/topic/106100-playerdeathlua-erro/#findComment-683724 Compartilhar em outros sites More sharing options...
MUTAN0 1 Postado Janeiro 25, 2009 Autor Share Postado Janeiro 25, 2009 Hmm, então o jeito é esperar... Valeu. @Tibiaa4e: Preciso falar com voce sobre aqueles NPCs. Falou Link para o comentário https://xtibia.com/forum/topic/106100-playerdeathlua-erro/#findComment-683922 Compartilhar em outros sites More sharing options...
DaNDaNrOxX 15 Postado Janeiro 25, 2009 Share Postado Janeiro 25, 2009 :button_cancel: Tópico Fechado à pedido do dono Link para o comentário https://xtibia.com/forum/topic/106100-playerdeathlua-erro/#findComment-683926 Compartilhar em outros sites More sharing options...
Posts Recomendados