DavyziinC 1 Postado Setembro 29, 2013 Share Postado Setembro 29, 2013 Então pessoal do xtibia eu vim aqui pedi tipo que uma ajuda meu ot quando os player morre eles voltam pro level 1 tem player que volta tem outros que n alguém pode me ajuda nesse erro? Link para o comentário https://xtibia.com/forum/topic/221882-encerrado-bug-level-1/ Compartilhar em outros sites More sharing options...
ikaroangelo 15 Postado Setembro 29, 2013 Share Postado Setembro 29, 2013 (editado) amigo vá em data\creaturescripts\scripts, procure o arquivo playerdeath e apague tudo dentro e coloque isto! 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 = getPlayerGUID(lastHitKiller) else hitKillerName = getCreatureName(lastHitKiller) end 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 Depois vá em data\creaturescripts/creaturescripts.xml e adicione está tag <event type="death" name="PlayerDeath" event="script" value="playerdeath.lua"/> Editado Setembro 29, 2013 por ikaroangelo Link para o comentário https://xtibia.com/forum/topic/221882-encerrado-bug-level-1/#findComment-1566971 Compartilhar em outros sites More sharing options...
DavyziinC 1 Postado Setembro 29, 2013 Autor Share Postado Setembro 29, 2013 Tu testo antes de me manda? Link para o comentário https://xtibia.com/forum/topic/221882-encerrado-bug-level-1/#findComment-1566972 Compartilhar em outros sites More sharing options...
ikaroangelo 15 Postado Setembro 29, 2013 Share Postado Setembro 29, 2013 (editado) Caro amigo utilizo ele no meu otserv ^^ Editado Setembro 29, 2013 por ikaroangelo Link para o comentário https://xtibia.com/forum/topic/221882-encerrado-bug-level-1/#findComment-1566973 Compartilhar em outros sites More sharing options...
DavyziinC 1 Postado Setembro 29, 2013 Autor Share Postado Setembro 29, 2013 Ata tendi Okay Obrigado Link para o comentário https://xtibia.com/forum/topic/221882-encerrado-bug-level-1/#findComment-1566974 Compartilhar em outros sites More sharing options...
Gabrieltxu 738 Postado Outubro 7, 2013 Share Postado Outubro 7, 2013 Tópico movido para a seção de dúvidas e pedidos resolvidos. Link para o comentário https://xtibia.com/forum/topic/221882-encerrado-bug-level-1/#findComment-1570169 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/221882-encerrado-bug-level-1/#findComment-1735450 Compartilhar em outros sites More sharing options...
Posts Recomendados