Ir para conteúdo
  • 0

(Pedido) Deathlist


Nathan96

Pergunta

Tipo do script: talkactions

Protocolo : 8.6

Servidor utilizado: tfs 3.6

 

já vi algumas aqui neste fórum mais nem uma funciona no meu server então si possível gostaria uma igual do video abaixo.

 

http://www.youtube.com/watch?v=1SkJoE8dOo4&context=C455c014ADvjVQa1PpcFNPQUrkfAk98PRpni2dIpelZK3essGHo0A=

 

Valendo Rep +

 

Ninguém ainda?? já tentei de tudo, já mudei o distro, já mexi na conf.lua e nada ;/

Link para o comentário
Compartilhar em outros sites

  • Respostas 48
  • Created
  • Última resposta

Top Posters For This Question

Posts Recomendados

  • 0

ta assim:

 

limit = 5
function onSay(cid, words, param, channel)
local getPlayer = db.getResult("SELECT `name`, `id` FROM `players` WHERE `name` = " .. db.escapeString(param) .. ";")
if(getPlayer:getID() == -1) then doPlayerSendCancel(cid, "Este Player não existe.") return true end
local getGuid = getPlayer:getDataInt("id")
getPlayer:free()
local str = ""
local qry = db.getResult("SELECT `id`, `date`, `level` FROM `player_deaths` WHERE `player_id` = " .. getGuid .." ORDER BY `date` DESC LIMIT 0, " .. limit)
if(qry:getID() ~= -1) then
repeat
local qry1 = db.getResult("SELECT environment_killers.name AS monster_name, players.name AS player_name FROM killers LEFT JOIN environment_killers ON killers.id = environment_killers.kill_id LEFT JOIN player_killers ON killers.id = player_killers.kill_id LEFT JOIN players ON players.id = player_killers.player_id WHERE killers.death_id = " .. qry:getDataInt("id") .. " ORDER BY killers.final_hit DESC, killers.id ASC LIMIT 0, " .. limit)
if(qry1:getID() ~= -1) then
repeat
if not qry1:getDataString("monster_name")  then
str = str .."\n "..os.date("%d %B %Y %X ", qry:getDataInt("date")).." ok "
else
str = str .."\n "..os.date("%d %B %Y %X ", qry:getDataInt("date")).." Morto no level "..qry:getDataInt("level").."\nPor "..qry1:getDataString("monster_name")..""
end
until not(qry1:next()) qry1:free()
end
until not(qry:next()) qry:free()
else
str = "Não há mortes."
end
doPlayerPopupFYI(cid, "Lista de Mortes de: " .. param .. ".\n\n" .. str)
return true
end

 

mas só funciona se for morte para monstros, se morrer pra player da debug

Link para o comentário
Compartilhar em outros sites

  • 0

No meu servidor nem essa da i funcionou morri pra 3 bichos diferentes ao mesmo tempo ae quando fui dar !deathlist o ot fexo sleep.png

cria um char, e só morre pra bixo.

o player nao pode ter morrido pra nenhum player no seu char lol

Link para o comentário
Compartilhar em outros sites

  • 0

Ae pessoal, eu peguei um script aqui que eu editei, tava com alguns erros, fui dando uma cagada e outra...

 

MAIS FUNFA! PARA NOSSA ALEGRIA!!!!

 

local config = {
deathAssistCount = getConfigValue('deathAssistCount') + 1,
maxDeathRecords = getConfigValue('maxDeathRecords'),
limit = ""
}
if(config.deathAssistCount > 0) then
config.limit = " LIMIT 0, " .. config.deathAssistCount
end
function onSay(cid, words, param, channel)
local target = db.getResult("SELECT `name`, `id` FROM `players` WHERE `name` = " .. db.escapeString(param) .. ";")
if(target:getID() == -1) then
 doPlayerSendCancel(cid, "Este jogador não existe.")
 return true
end
local targetName, targetId = target:getDataString("name"), target:getDataInt("id")
target:free()
local str, deaths = "", db.getResult("SELECT `id`, `date`, `level` FROM `player_deaths` WHERE `player_id` = " .. targetId .." ORDER BY `date` DESC LIMIT 0, " .. config.maxDeathRecords)
if(deaths:getID() ~= -1) then
 repeat
  local killers = db.getResult("SELECT environment_killers.name AS monster_name, players.name AS player_name FROM killers LEFT JOIN environment_killers ON killers.id = environment_killers.kill_id LEFT JOIN player_killers ON killers.id = player_killers.kill_id LEFT JOIN players ON players.id = player_killers.player_id WHERE killers.death_id = " .. deaths:getDataInt("id") .. " ORDER BY killers.final_hit DESC, killers.id ASC" .. config.limit)
  if(killers:getID() ~= -1) then
   if(str ~= "") then
 str = str .. "\n" .. os.date("%d %B %Y %X ", deaths:getDataLong("date"))
   else
 str = os.date("%d %B %Y %X ", deaths:getDataLong("date"))
   end
   local count, i = killers:getRows(false), 0
   repeat
 local monster = killers:getDataString("monster_name")
 if(i == 0 or i == (count - 1)) then
  monster = string.gsub(monster:gsub("an ", ""), "a ", "")
 end
 if(killers:getDataString("player_name") ~= "") then
  if(i == 0) then
   str = str .. "Killed at level " .. deaths:getDataInt("level") .. " por:\n  "
  elseif(i == count) then
   str = str .. " e por "
  elseif(i % 4 == 0) then
   str = str .. ",\n  "
  else
   str = str .. ", "
  end
  if(monster ~= "") then
   str = str .. monster .. " sumonado por "
  end
  str = str .. killers:getDataString("player_name")
 else
  if(i == 0) then
   str = str .. "Morto no level " .. deaths:getDataInt("level") .. " por:\n  "
  elseif(i == count) then
   str = str .. " e por "
  elseif(i % 4 == 0) then
   str = str .. ",\n  "
  else
   str = str .. ", "
  end
  str = str .. monster
 end
 i = i + 1
 if(i == count) then
  str = str .. "."
 end
   until not(killers:next())
   killers:free()
  end
 until not(deaths:next())
 deaths:free()
else
 str = "Não tem mortes."
end
doPlayerPopupFYI(cid, "Deathlist do player: " .. targetName .. ".\n\n" .. str)
return true
end

 

 

 

AJUDEI? ENTAO DA MEU REP AI TIU!

Link para o comentário
Compartilhar em outros sites

  • 0

[17/04/2012 19:52:23] Error during getDataString(killed_by).

[17/04/2012 19:52:23] Error during getDataString(altkilled_by).

[17/04/2012 19:52:23] [Warning - ProtocolGame::sendFYIBox] Trying to send an empty or too huge message.

 

[17/04/2012 19:52:26] Error during getDataInt(time).

[17/04/2012 19:52:26] Error during getDataString(killed_by).

[17/04/2012 19:52:26] Error during getDataString(altkilled_by).

[17/04/2012 19:52:26] Error during getDataInt(time).

[17/04/2012 19:52:26] Error during getDataString(killed_by).

[17/04/2012 19:52:26] Error during getDataString(altkilled_by).

 

;/

Link para o comentário
Compartilhar em outros sites

  • 0

Voce usa sqlite não é?

 

pera ae.

 

Tenta isso.

 

local config = {
deathAssistCount = getConfigValue('deathAssistCount') + 1,
maxDeathRecords = getConfigValue('maxDeathRecords'),
limit = ""
}
if(config.deathAssistCount > 0) then
config.limit = " LIMIT 0, " .. config.deathAssistCount
end
function onSay(cid, words, param, channel)
local query = db.getResult("SELECT `name`, `id` FROM `players` WHERE `name` = " .. db.escapeString(param) .. ";")
if(target:getID() == -1) then
 doPlayerSendCancel(cid, "Este jogador não existe.")
 return true
end
local targetName, targetId = target:getDataString("name"), target:getDataInt("id")
target:free()
local str, deaths = "", db.executeQuery("SELECT `id`, `date`, `level` FROM `player_deaths` WHERE `player_id` = " .. targetId .." ORDER BY `date` DESC LIMIT 0, " .. config.maxDeathRecords)
if(deaths:getID() ~= -1) then
 repeat
  local killers = db.getResult("SELECT environment_killers.name AS monster_name, players.name AS player_name FROM killers LEFT JOIN environment_killers ON killers.id = environment_killers.kill_id LEFT JOIN player_killers ON killers.id = player_killers.kill_id LEFT JOIN players ON players.id = player_killers.player_id WHERE killers.death_id = " .. deaths:getDataInt("id") .. " ORDER BY killers.final_hit DESC, killers.id ASC" .. config.limit)
  if(killers:getID() ~= -1) then
   if(str ~= "") then
	 str = str .. "\n" .. os.date("%d %B %Y %X ", deaths:getDataLong("date"))
   else
	 str = os.date("%d %B %Y %X ", deaths:getDataLong("date"))
   end
   local count, i = killers:getRows(false), 0
   repeat
	 local monster = killers:getDataString("monster_name")
	 if(i == 0 or i == (count - 1)) then
	  monster = string.gsub(monster:gsub("an ", ""), "a ", "")
	 end
	 if(killers:getDataString("player_name") ~= "") then
	  if(i == 0) then
	   str = str .. "Killed at level " .. deaths:getDataInt("level") .. " por:\n  "
	  elseif(i == count) then
	   str = str .. " e por "
	  elseif(i % 4 == 0) then
	   str = str .. ",\n  "
	  else
	   str = str .. ", "
	  end
	  if(monster ~= "") then
	   str = str .. monster .. " sumonado por "
	  end
	  str = str .. killers:getDataString("player_name")
	 else
	  if(i == 0) then
	   str = str .. "Morto no level " .. deaths:getDataInt("level") .. " por:\n  "
	  elseif(i == count) then
	   str = str .. " e por "
	  elseif(i % 4 == 0) then
	   str = str .. ",\n  "
	  else
	   str = str .. ", "
	  end
	  str = str .. monster
	 end
	 i = i + 1
	 if(i == count) then
	  str = str .. "."
	 end
   until not(killers:next())
   killers:free()
  end
 until not(deaths:next())
 deaths:free()
else
 str = "Não tem mortes."
end
doPlayerPopupFYI(cid, "Deathlist do player: " .. targetName .. ".\n\n" .. str)
return true
end

 

Se pá... vai dar tudo errado, mais vou ver como é que vai ficar esse script para Sqlite.

Link para o comentário
Compartilhar em outros sites


×
×
  • Criar Novo...