- "Ryukend"Miembro
- Mensajes : 120
[Talkaction] Top Killer
Vie Nov 11, 2011 9:12 pm
A partir ...
Crea "killers.lua" sobre un Lua En :talkactions/scripts
y pega esto ahi:
- Código:
-- HIGHSCORE OF KILLERS! BY PHBS!
local monsters = {
--name = storage
["rat"] = 35001,
["cave rat"] = 35002,
["hydra"] = 35003,
["dragon"] = 35004
}
function onSay(cid, words, param)
-- max players on the highscore
local players = 20 -- The amount of players that is shown in the list
-- don't touch --
local str = ""
local value = ""
local name = ""
local player_id = 0
local result = nil
local namis = param
local crat = monsters[string.lower(namis)]
if (crat) then
str = "# Top "..param.." Killers\n"
value = "value"
player_id = "player_id"
result = db.getResult("SELECT `player_id`, `value` FROM `player_storage` WHERE `key` = "..crat.." ORDER BY `value` DESC, `player_id` ASC;")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Fale !killers [monster name].")
return TRUE
end
if (result:getID() ~= -1) then
local i = 1
while TRUE do
str = str .. "\n " .. i .. ". [" .. result:getDataInt(value) .. "] - " .. (name ~= "" and result:getDataString("name") or getPlayerNameByGUID(result:getDataInt(player_id)))
i = i+1
if not(result:next()) or i > players then
break
end
end
result:free()
end
if str ~= "" then
doPlayerPopupFYI(cid, str)
end
return TRUE
end
coloca en talkactions.xml esto:
- Código:
<talkaction words="!killers" event="script" value="killers.lua"/>
hará falta modificar la base de datos que funcionen perfectamente.
Ir en player_storage 'autor' y elel valor de la de varchar(255) para int(10).
Disfrutalo ^^
Creditos : 100% PHBS
Permisos de este foro:
No puedes responder a temas en este foro.