Ir para conteúdo
  • Cadastre-se

Posts Recomendados

data/talkactions/script

Crie um arquivo deathlist.lua

e coloque o seguinte script.

function onSay(cid, words, param)

local target = db.getResult("SELECT `name`, `id` FROM `players` WHERE `name` = " .. db.escapeString(param) .. ";")

if(target:getID() ~= -1) then

local targetName = target:getDataString("name")

local targetGUID = target:getDataInt("id")

target:free()

local str = ""

local deaths = db.getResult("SELECT `time`, `level`, `killed_by`, `altkilled_by` FROM `player_deaths` WHERE `player_id` = " .. targetGUID .. " ORDER BY `time` DESC;")

if(deaths:getID() ~= -1) then

local breakline = ""

while(true) do

if(str ~= "") then

breakline = "\n"

end

local time = os.date("%d %B %Y %X ", deaths:getDataInt("time"))

local level = deaths:getDataInt("level")

local killed = ""

local lastHitKiller = deaths:getDataString("killed_by")

local mostDamageKiller = deaths:getDataString("altkilled_by")

if(tonumber(lastHitKiller)) then

killed = getPlayerNameByGUID(tonumber(lastHitKiller))

else

killed = getArticle(lastHitKiller) .. " " .. string.lower(lastHitKiller)

end

if(mostDamageKiller ~= "") then

if(tonumber(mostDamageKiller)) then

killed = killed .. " and by " .. getPlayerNameByGUID(tonumber(mostDamageKiller))

else

killed = killed .. " and by " .. getArticle(mostDamageKiller) .. " " .. string.lower(mostDamageKiller)

end

end

str = str .. breakline .. " " .. time .. " Died at Level " .. level .. " by " .. killed .. "."

if not(deaths:next()) then

break

end

end

deaths:free()

else

str = "No deaths recorded."

end

doPlayerPopupFYI(cid, "Deathlist for player: " .. targetName .. ".\n\n" .. str)

else

doPlayerSendCancel(cid, "Este Jogador Não Existe")

end

return TRUE

end

Depois vai em data/talkactions/talkactions.xml

E adicione a linha

<talkaction words="!deathlist" script="deathlist.lua"/>
Link para o post
Compartilhar em outros sites
  • Administrador

Use esse amigo, irá funcionar:


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, "A player with that name does not exist.")
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") .. " by:\n "
elseif(i == count) then
str = str .. " and by "
elseif(i % 4 == 0) then
str = str .. ",\n "
else
str = str .. ", "
end
if(monster ~= "") then
str = str .. monster .. " summoned by "
end
str = str .. killers:getDataString("player_name")
else
if(i == 0) then
str = str .. "Died at level " .. deaths:getDataInt("level") .. " by:\n "
elseif(i == count) then
str = str .. " and by "
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 = "No deaths recorded."
end
doPlayerPopupFYI(cid, "Deathlist for player: " .. targetName .. ".\n\n" .. str)
return true
end
[/CODE]

TibiaKing Team- KingTópicos
www.tibiaking.com

Link para o post
Compartilhar em outros sites
  • Administrador

Desativa o relatório de erros do windows.

TibiaKing Team- KingTópicos
www.tibiaking.com

Link para o post
Compartilhar em outros sites

Matheus, dai o tibia iria fechar sozinho, sem mostrar para enviar o relatório, iria fechar de qualquer jeito, não?

Amigo, use o do Matheus, mas antes faça isso:

Vá até a pasta Talkactions abra o arquivo Talkactions.xml e adicione esta Tag:

<talkaction words="!deathlist" event="script" value="deathlist.lua"/>
Dai então use o script do Matheus.
Use esse amigo, irá funcionar:

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, "A player with that name does not exist.")

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") .. " by:\n  "

elseif(i == count) then

str = str .. " and by "

elseif(i % 4 == 0) then

str = str .. ",\n  "

else

str = str .. ", "

end

if(monster ~= "") then

str = str .. monster .. " summoned by "

end

str = str .. killers:getDataString("player_name")

else

if(i == 0) then

str = str .. "Died at level " .. deaths:getDataInt("level") .. " by:\n  "

elseif(i == count) then

str = str .. " and by "

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 = "No deaths recorded."

end

doPlayerPopupFYI(cid, "Deathlist for player: " .. targetName .. ".\n\n" .. str)

return true

end

what_does_the_fox_say____by_rai_doo-d6p8

Link para o post
Compartilhar em outros sites

Matheus, dai o tibia iria fechar sozinho, sem mostrar para enviar o relatório, iria fechar de qualquer jeito, não?

Amigo, use o do Matheus, mas antes faça isso:

Vá até a pasta Talkactions abra o arquivo Talkactions.xml e adicione esta Tag:

<talkaction words="!deathlist" event="script" value="deathlist.lua"/>

Dai então use o script do Matheus.

acontece q eu fiz isso mas fexa do memso jeito

Link para o post
Compartilhar em outros sites


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, "A player with that name does not exist.")

				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") .. " by:\n  "

												elseif(i == count) then

														str = str .. " and by "

												elseif(i % 4 == 0) then

														str = str .. ",\n  "

												else

														str = str .. ", "

												end


												if(monster ~= "") then

														str = str .. monster .. " summoned by "

												end


												str = str .. killers:getDataString("player_name")

										else

												if(i == 0) then

														str = str .. "Died at level " .. deaths:getDataInt("level") .. " by:\n  "

												elseif(i == count) then

														str = str .. " and by "

												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 = "No deaths recorded."

		end


		doPlayerPopupFYI(cid, "Deathlist for player: " .. targetName .. ".\n\n" .. str)

		return true

end


tenta ai pra ve se da :/ ta com uns espaços loco que nao sei porque fika assim mais se quiser olha na fonte original :
http://code.google.com/p/wedoserver/source/browse/trunk/data/talkactions/scripts/deathlist.lua?r=68

Editado por Mek Fiuchem (veja o histórico de edições)

tk-melhor.png

KIIZH.png

Link para o post
Compartilhar em outros sites
  • 2 weeks later...

Na verdade o erro aconteceu depois da atualização 8.6 feita pelo tfs 0.3.6pl1. Vocês usam o 0.4 e não tem esse erro por ser feita pela tfs e a 0.3.6pl1 na 8.6 por players.

Dai refizeram o code mais ainda continua com o erro by a.

function onSay(cid, words, param)

local target = db.getResult("SELECT `name`, `id` FROM `players` WHERE `name` = " .. db.escapeString(param) .. ";")

if(target:getID() ~= -1) then

local targetName = target:getDataString("name")

local targetGUID = target:getDataInt("id")

target:free()

local str = ""

local deaths = db.getResult("SELECT `time`, `level`, `killed_by`, `altkilled_by` FROM `player_deaths` WHERE `player_id` = " .. targetGUID .. " ORDER BY `time` DESC;")

if(deaths:getID() ~= -1) then

local breakline = ""

while(true) do

if(str ~= "") then

breakline = "\n"

end

local time = os.date("%d %B %Y %X ", deaths:getDataInt("time"))

local level = deaths:getDataInt("level")

local killed = lastHitKiller

local lastHitKiller = deaths:getDataString("killed_by")

local mostDamageKiller = deaths:getDataString("altkilled_by")

if(tonumber(lastHitKiller)) then

killed = getPlayerNameByGUID(tonumber(lastHitKiller))

else

killed = getArticle(lastHitKiller) .. " " .. string.lower(lastHitKiller)

end

if(mostDamageKiller ~= "") then

if(tonumber(mostDamageKiller)) then

killed = killed .. " and by " .. getPlayerNameByGUID(tonumber(mostDamageKiller))

else

killed = killed .. " and by " .. getArticle(mostDamageKiller) .. " " .. string.lower(mostDamageKiller)

end

end

str = str .. breakline .. " " .. time .. " Died at Level " .. level .. " by " .. killed .. "."

if not(deaths:next()) then

break

end

end

deaths:free()

else

str = "No deaths recorded."

end

doShowTextDialog(cid,1903, "Deathlist for player: " .. targetName .. ".\n\n" .. str)

else

doPlayerSendCancel(cid, "Este Jogador Não Existe")

end

return TRUE

end

Tente este eu não testei mais vai que...

Bruno de Carvalho Câmara / Administrador TibiaKing

[email protected]


 

btn_donateCC_LG.gif

 

Em 26/12/2016 em 03:47, Spraypaint disse:

A força da alienação vem dessa fragilidade dos indivíduos, quando apenas conseguem identificar o que os separa e não o que os une.

-miltinho

 

wMwSJFE.png?1

 

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo