Postado Fevereiro 4, 2014 11 anos Meu playerdeath,não sei se é aqui local config = { deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')), sqlType = getConfigInfo('sqlType'), maxDeathRecords = getConfigInfo('maxDeathRecords') } local messages = { ""..getPlayerName(cid).." morreu para o "..hitKillerName..".", } local b = 0 local message = messages[(b % #messages) + 1] 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 doPlayerAddItem(cid,2160,2) doBroadcastMessage("" .. message,19) b = b + 1 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 Editado Fevereiro 4, 2014 11 anos por damiaotorres (veja o histórico de edições)
Postado Fevereiro 4, 2014 11 anos Tenta este : "data/creaturescripts/scripts/deathcast.lua" function onKill(cid, corpse, mostDamageKiller, lastHitKiller)] if isPlayer(cid) == TRUE then doBroadcastMessage("O jogador ".. getCreatureName(lastHitKiller).." acabou de matar ".. getCreatureName(cid) ..".") end return TRUE end "data/creaturescripts/scripts/login.lua" registerCreatureEvent(cid, "BroadDeath") "data/creaturescripts/creaturescripts.xml" <event type="death" name="BroadDeath" event="script" value="deathcast.lua"/> Ajudei = REP+ Não dou suporte por PM qualquer dúvida procure no fórum,caso não encontre oque procura crie um tópico. [email protected]" /> | TFS 0.4 DEV | %5Bcreaturescript%5D Icones no minimap com descrição%5Btalkaction%5D Adicionar ou remover VIP do player.%5Bcreaturescripts%5D Senha para porta%5Btalkaction%5D Mandar mensagem para pasta do servidorMapa Evento War Castle%5Baction%5D Canoa em MovimentoTeleport Scroll System%5Bcreaturescripts%5D Recompensa por level para X vocations%5Btalkaction%5D Adicionar X item para o player%5Btalkactions%5D Adicionar item para todos players online%5Baction%5D Item que teleporta o player para house[action+movement] Passaporte para entrar no barco
Postado Fevereiro 4, 2014 11 anos Troque por este script : function onKill(cid, target, lastHit) local str = "O player %s acaba de ser morto no nível %d por %s" if isPlayer(cid) and isPlayer(target) then doBroadcastMessage(str:format(getCreatureName(target), getPlayerLevel(target), getCreatureName(cid)), 27) end return true end E troque a tag para está : <event type="kill" name="DeathBroadCast" event="script" value="deathcast.lua"/> E a tag do login.lua para está : registerCreatureEvent(cid, "DeathCast") Ajudei = REP+ Não dou suporte por PM qualquer dúvida procure no fórum,caso não encontre oque procura crie um tópico. [email protected]" /> | TFS 0.4 DEV | %5Bcreaturescript%5D Icones no minimap com descrição%5Btalkaction%5D Adicionar ou remover VIP do player.%5Bcreaturescripts%5D Senha para porta%5Btalkaction%5D Mandar mensagem para pasta do servidorMapa Evento War Castle%5Baction%5D Canoa em MovimentoTeleport Scroll System%5Bcreaturescripts%5D Recompensa por level para X vocations%5Btalkaction%5D Adicionar X item para o player%5Btalkactions%5D Adicionar item para todos players online%5Baction%5D Item que teleporta o player para house[action+movement] Passaporte para entrar no barco
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.