• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua !rankkill

Thixz

New Member
Joined
Jun 13, 2009
Messages
65
Reaction score
0
Hey i have a enforced server and i need a command for the player see the rank of the kills...who killed more =D
thanks
 
Listen this is veeery hard to script.. it will take some days.. cause i got vacation tommorow.. And if i finnish it im gonna post it on ot land.
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Kill Rank" enabled="yes">
	<config name="killrank_config"><![CDATA[
		limit = 10
	]]></config>
	<talkaction words="!rankkill" 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[i][1]) .. " - " .. t[i][2] .. " frags"
		end
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ret)
	]]></talkaction>
</mod>
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Kill Rank" enabled="yes">
	<config name="killrank_config"><![CDATA[
		limit = 10
	]]></config>
	<talkaction words="!rankkill" 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[i][1]) .. " - " .. t[i][2] .. " frags"
		end
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ret)
	]]></talkaction>
</mod>


Well done! REP FOR U
 
Hey man i put this but in styller yourots gave this error
data/talkactions/scripts/rankkill unexpected error near '<'
 
sev folder its data?
please do a little tutorial how i install this pleasee
i need to put in data/xml near the archives vocation ?
 
Hey cyko i do everything right i put this is mod like you talk but when i digit !rank all the server stop and i need to shut it down
 
Ow, also it would only work on PVP servers, not PVP enforced because there are no unjustified frags there.
Or I don't know actually, but it doesn't crash the server for me.
 
Back
Top Bottom