Lordfireot 16 Postado Março 22, 2013 Share Postado Março 22, 2013 eu to com outro erro [error - creaturescript interface] data/creaturescript/script/playerdeath.lua:ondeath description (luainterface::luagetcreaturename) creature not found [error - creaturescript interface] data/creaturescript/scripts/playerdeath.lua:ondeath description ddata/creaturescript/scripts/playerdeath.lua:15: in function <data/creaturescript/scripts/playerdeath.lua:1> esse e meu erro agora meu arquivo playerdeath function onDeath(cid, corpse, deathList) local strings = {""} local t, position = 1, 1 local deathType = "killed" local toSlain, toCrushed = 3, 9 if #deathList >= toSlain then deathType = "slain" elseif #deathList >= toCrushed then deathType = "crushed" end for _, pid in ipairs(deathList) do strings[position] = t == 1 and "" or strings[position] .. ", " strings[position] = strings[position] .. getCreatureName(pid) .. "" t = t + 1 end for i, str in ipairs(strings) do if(str:sub(str:len()) ~= ",") then str = str .. "." end msg = getCreatureName(cid) .. " was " .. deathType .. " at level " .. getPlayerLevel(cid) .. " by " .. str end for _, oid in ipairs(getPlayersOnline()) do doPlayerSendChannelMessage(oid, "Death channel", msg, TALKTYPE_CHANNEL_O, CHANNEL_DEATH) end return true end alguem me ajuda pf Link para o comentário https://xtibia.com/forum/topic/210419-erro-creature-script/ Compartilhar em outros sites More sharing options...
0 ThiagoBji 146 Postado Março 22, 2013 Share Postado Março 22, 2013 Usa esse playerdeath.lua: local config = { deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')), sqlType = getConfigInfo('sqlType'), maxDeathRecords = getConfigInfo('maxDeathRecords') } config.sqlType = config.sqlType == "sqlite" and DATABASE_ENGINE_SQLITE or DATABASE_ENGINE_MYSQL function onDeath(cid, corpse, lastHitKiller, mostDamageKiller) if(config.deathListEnabled ~= TRUE) then return end local hitKillerName = "field item" local damageKillerName = "" if(lastHitKiller ~= FALSE) then if(isPlayer(lastHitKiller) == TRUE) then hitKillerName = getCreatureName(lastHitKiller) else hitKillerName = getCreatureName(lastHitKiller) end doBroadcastMessage(""..getPlayerName(cid).." has been killed by "..hitKillerName..".") if(mostDamageKiller ~= FALSE and mostDamageKiller ~= lastHitKiller and getCreatureName(mostDamageKiller) ~= getCreatureName(lastHitKiller)) then if(isPlayer(mostDamageKiller) == TRUE) then damageKillerName = getPlayerGUID(mostDamageKiller) else damageKillerName = getCreatureName(mostDamageKiller) end end end db.executeQuery("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `altkilled_by`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", " .. db.escapeString(hitKillerName) .. ", " .. db.escapeString(damageKillerName) .. ");") local rows = db.getResult("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";") if(rows:getID() ~= -1) then local amount = rows:getRows(true) - config.maxDeathRecords if(amount > 0) then if(config.sqlType == DATABASE_ENGINE_SQLITE) then for i = 1, amount do db.executeQuery("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1);") end else db.executeQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT " .. amount .. ";") end end end end Link para o comentário https://xtibia.com/forum/topic/210419-erro-creature-script/#findComment-1491544 Compartilhar em outros sites More sharing options...
0 Lordfireot 16 Postado Março 22, 2013 Autor Share Postado Março 22, 2013 Vlw cara deu certo obrigado REP+ mais me diga pra que esse script server qual a funçao dele Link para o comentário https://xtibia.com/forum/topic/210419-erro-creature-script/#findComment-1491550 Compartilhar em outros sites More sharing options...
0 ThiagoBji 146 Postado Março 22, 2013 Share Postado Março 22, 2013 É sobre o corpo quando a pessoa morre, quando dá look o quê mostra, e etcs. Link para o comentário https://xtibia.com/forum/topic/210419-erro-creature-script/#findComment-1491562 Compartilhar em outros sites More sharing options...
0 Lordfireot 16 Postado Março 22, 2013 Autor Share Postado Março 22, 2013 Ata vlw amigao obrigado ajuda bastante mesmo Link para o comentário https://xtibia.com/forum/topic/210419-erro-creature-script/#findComment-1491565 Compartilhar em outros sites More sharing options...
0 ThiagoBji 146 Postado Março 22, 2013 Share Postado Março 22, 2013 Não há de quê. Qualquer coisa, só criar um tópico aqui no xtibia que nós do xtibia tentaremos lhe ajudar. (não é que eu estou cobrando ou pedindo, mais você disse que deu rep+ mais não deu. ) Link para o comentário https://xtibia.com/forum/topic/210419-erro-creature-script/#findComment-1491566 Compartilhar em outros sites More sharing options...
0 Demonbholder 420 Postado Março 23, 2013 Share Postado Março 23, 2013 Tópico movido para a seção de dúvidas e pedidos resolvidos. Link para o comentário https://xtibia.com/forum/topic/210419-erro-creature-script/#findComment-1491569 Compartilhar em outros sites More sharing options...
0 Lordfireot 16 Postado Março 23, 2013 Autor Share Postado Março 23, 2013 cara ta dando erro na linha 19 manw ajuda ae Link para o comentário https://xtibia.com/forum/topic/210419-erro-creature-script/#findComment-1491628 Compartilhar em outros sites More sharing options...
0 SkyLigh 453 Postado Março 23, 2013 Share Postado Março 23, 2013 tente assim . function onDeath(cid, corpse, lastHitKiller, mostDamageKiller) local config = { deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')), sqlType = getConfigInfo('sqlType'), maxDeathRecords = getConfigInfo('maxDeathRecords') } config.sqlType = config.sqlType == "sqlite" and DATABASE_ENGINE_SQLITE or DATABASE_ENGINE_MYSQL if(config.deathListEnabled ~= TRUE) then return end local hitKillerName = "field item" local damageKillerName = "" if(lastHitKiller ~= FALSE) then if(isPlayer(lastHitKiller) == TRUE) then hitKillerName = getCreatureName(lastHitKiller) else hitKillerName = getCreatureName(lastHitKiller) end doBroadcastMessage(""..getPlayerName(cid).." has been killed by "..hitKillerName..".") if(mostDamageKiller ~= FALSE and mostDamageKiller ~= lastHitKiller and getCreatureName(mostDamageKiller) ~= getCreatureName(lastHitKiller)) then if(isPlayer(mostDamageKiller) == TRUE) then damageKillerName = getPlayerGUID(mostDamageKiller) else damageKillerName = getCreatureName(mostDamageKiller) end end end db.executeQuery("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `altkilled_by`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", " .. db.escapeString(hitKillerName) .. ", " .. db.escapeString(damageKillerName) .. ");") local rows = db.getResult("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";") if(rows:getID() ~= -1) then local amount = rows:getRows(true) - config.maxDeathRecords if(amount > 0) then if(config.sqlType == DATABASE_ENGINE_SQLITE) then for i = 1, amount do db.executeQuery("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1);") end else db.executeQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT " .. amount .. ";") end end end end Link para o comentário https://xtibia.com/forum/topic/210419-erro-creature-script/#findComment-1491646 Compartilhar em outros sites More sharing options...
Pergunta
Lordfireot 16
eu to com outro erro
[error - creaturescript interface]
data/creaturescript/script/playerdeath.lua:ondeath
description
(luainterface::luagetcreaturename) creature not found
[error - creaturescript interface]
data/creaturescript/scripts/playerdeath.lua:ondeath
description
ddata/creaturescript/scripts/playerdeath.lua:15: in function <data/creaturescript/scripts/playerdeath.lua:1>
esse e meu erro agora meu arquivo playerdeath
function onDeath(cid, corpse, deathList)
local strings = {""}
local t, position = 1, 1
local deathType = "killed"
local toSlain, toCrushed = 3, 9
if #deathList >= toSlain then
deathType = "slain"
elseif #deathList >= toCrushed then
deathType = "crushed"
end
for _, pid in ipairs(deathList) do
strings[position] = t == 1 and "" or strings[position] .. ", "
strings[position] = strings[position] .. getCreatureName(pid) .. ""
t = t + 1
end
for i, str in ipairs(strings) do
if(str:sub(str:len()) ~= ",") then
str = str .. "."
end
msg = getCreatureName(cid) .. " was " .. deathType .. " at level " .. getPlayerLevel(cid) .. " by " .. str
end
for _, oid in ipairs(getPlayersOnline()) do
doPlayerSendChannelMessage(oid, "Death channel", msg, TALKTYPE_CHANNEL_O, CHANNEL_DEATH)
end
return true
end
alguem me ajuda pf
Link para o comentário
https://xtibia.com/forum/topic/210419-erro-creature-script/Compartilhar em outros sites
8 respostass a esta questão
Posts Recomendados