• 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!

Help me with this script please! Its easy for you!

Celsish

New Member
Joined
Apr 6, 2009
Messages
74
Reaction score
0
Code:
local config = {
	limit = 5
}
function onThink(interval, lastExecution)
	local t, ret, tmp = {}, "Top " .. math.min(config.limit, getWorldCreatures(0)) .. " fraggers online:"
	for _, cid in ipairs(getPlayersOnline()) do
		tmp = 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)")
		table.insert(t, {cid, tmp:getDataInt("count")})
		tmp:free()
	end
	table.sort(t, function(a,b) return a[2] > b[2] end)
	for i = 1, math.min(#t, config.limit) do
		ret = ret .. "\n" .. i .. ". " .. getPlayerName(t[i][1]) .. " - " .. t[i][2] .. " frags"
	end
	return doBroadcastMessage(ret)
end


It just spam: 11:42 Top 1 fraggers online:
1. Admin - 0 frags

I want it to come every 5th minute!!
 
Oh thx, can you make it possible so the frags reset Every time the Map is changing? I have à war server and it VHS ge Map Every 15 min
 
add something like this near the map change code:
Lua:
db.executeQuery('TRUNCATE TABLE player_killers')
db.executeQuery('TRUNCATE TABLE killers')
you can make it empty player_deaths too if you want
 
Back
Top