diarmaint 19 Postado Dezembro 7, 2013 Share Postado Dezembro 7, 2013 (editado) Gostaria do script que anuncia a morte no Broadcast 8.54! Tanto para player e monstros. To usando esse mais não ta mostrando nada quando player morre data\globalevents\scripts 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 Globalevents.xml <event type="death" name="BroadDeath" event="script" value="playerdeath.lua"/> data\creaturescripts\scripts\login.xml <event type="death" name="BroadDeath" event="script" value="playerdeath.lua"/> Editado Dezembro 7, 2013 por Diarmaint Link para o comentário https://xtibia.com/forum/topic/225187-encerrado-854-mortes-no-broadcast/ Compartilhar em outros sites More sharing options...
ScythePhantom 83 Postado Dezembro 7, 2013 Share Postado Dezembro 7, 2013 Aqui champz, tente esse: Broadcast Link para o comentário https://xtibia.com/forum/topic/225187-encerrado-854-mortes-no-broadcast/#findComment-1590318 Compartilhar em outros sites More sharing options...
diarmaint 19 Postado Dezembro 7, 2013 Autor Share Postado Dezembro 7, 2013 Valeu Link para o comentário https://xtibia.com/forum/topic/225187-encerrado-854-mortes-no-broadcast/#findComment-1590355 Compartilhar em outros sites More sharing options...
Gabrieltxu 738 Postado Dezembro 7, 2013 Share Postado Dezembro 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/225187-encerrado-854-mortes-no-broadcast/#findComment-1590365 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/225187-encerrado-854-mortes-no-broadcast/#findComment-1735927 Compartilhar em outros sites More sharing options...
Posts Recomendados