Postado Julho 14, 2015 10 anos function onDeath(cid, corpse, deathList) for _, pid in ipairs(deathList) do doBroadcastMessage(""..getCreatureName(cid).." killed at level ["..getPlayerLevel(cid).."] by "..getCreatureName(pid).. " ", MESSAGE_STATUS_WARNING) end return true end temgo este error: seu repite mensaje do morte. busco solo um mensaje con el nombre de todos los que lo mataron.
Postado Julho 14, 2015 10 anos tem que colocar uma verificação para saber se é jogador, como vai pegar level de um monstro?? [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Julho 15, 2015 10 anos Autor tem que colocar uma verificação para saber se é jogador, como vai pegar level de um monstro?? resolvi asim: function onDeath(cid, corpse, deathList) local strings = {""} local t, position = 1, 1 local deathType = "killed" local toSlain, toCrushed = 3, 9 if #deathList >= toSlain and #deathList < toCrushed then deathType = "slain" elseif #deathList >= toCrushed then deathType = "crushed" end for _, pid in ipairs(deathList) do if isCreature(pid) == true then strings[position] = t == 1 and "" or strings[position] .. ", " strings[position] = strings[position] .. getCreatureName(pid) .. "" t = t + 1 else strings[position] = t == 1 and "" or strings[position] .. ", " strings[position] = strings[position] .."a field item" t = t + 1 end 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 doBroadcastMessage(msg, MESSAGE_STATUS_WARNING) return true end
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.