local exhaust = 3435
local exhaustionTime = 60
function onSay(cid, words, param, channel)
if exhaustion.check(cid, exhaust) then
doPlayerSendCancel(cid, 'You can\'t use this command yet['..exhaustion.get(cid, exhaust)..'].')
return true
else
exhaustion.set(cid, exhaust, exhaustionTime)
end
local str = '[#]-[Name]-[Frags]'
result = db.getResult('SELECT `p`.`name` AS `name`, COUNT(`p`.`name`) as `frags` FROM `killers` k LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id` LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id`WHERE `k`.`unjustified` = 1 AND `k`.`final_hit` = 1 GROUP BY `name` ORDER BY `frags` DESC, `name` ASC LIMIT 0,10;')
if isInArray({-1,nil,false,''},result:getID()) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'No results were found.')
return true
end
local i = 1
while true do
str = str .. '\n ' .. i .. '. ' .. result:getDataString('name') .. ' - [' .. result:getDataInt('frags') .. ']'
i = i + 1
if not(result:next()) then
break
end
end
result:free()
doPlayerPopupFYI(cid, str)
return true
end