Hey guys cickotitan just pass me a rank of frags
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Kill Rank" enabled="yes">
<config name="killrank_config"><![CDATA[
limit = 10
]]></config>
<talkaction words="!rank" event="buffer"><![CDATA[
domodlib('killrank_config')
local t, ret = {}, "Top " .. math.min(limit, getWorldCreatures(0)) .. " fraggers online:"
for _, cid in ipairs(getPlayersOnline()) do
table.insert(t, {cid, db.getResult("SELECT COUNT(*) as count FROM killers WHERE death_id IN (SELECT kill_id FROM player_killers) AND " .. getPlayerGUID(cid) .. " IN (SELECT player_id FROM player_killers WHERE kill_id = death_id)"):getDataInt("count")})
end
table.sort(t, function(a,b) return a[2] > b[2] end)
for i = 1, math.min(#t, limit) do
ret = ret .. "\n" .. i .. ". " .. getPlayerName(t[1]) .. " - " .. t[2] .. " frags"
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ret)
]]></talkaction>
</mod>
so i put this in mod but when i right !rank all the server stops and i need to shut it down
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Kill Rank" enabled="yes">
<config name="killrank_config"><![CDATA[
limit = 10
]]></config>
<talkaction words="!rank" event="buffer"><![CDATA[
domodlib('killrank_config')
local t, ret = {}, "Top " .. math.min(limit, getWorldCreatures(0)) .. " fraggers online:"
for _, cid in ipairs(getPlayersOnline()) do
table.insert(t, {cid, db.getResult("SELECT COUNT(*) as count FROM killers WHERE death_id IN (SELECT kill_id FROM player_killers) AND " .. getPlayerGUID(cid) .. " IN (SELECT player_id FROM player_killers WHERE kill_id = death_id)"):getDataInt("count")})
end
table.sort(t, function(a,b) return a[2] > b[2] end)
for i = 1, math.min(#t, limit) do
ret = ret .. "\n" .. i .. ". " .. getPlayerName(t[1]) .. " - " .. t[2] .. " frags"
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ret)
]]></talkaction>
</mod>
so i put this in mod but when i right !rank all the server stops and i need to shut it down
Last edited: