• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Broadcast top fraggers

rudger

Active Member
Joined
Oct 1, 2010
Messages
273
Solutions
1
Reaction score
45
Location
The Netherlands
Broadcast top 5 fraggers in database every 15 minutes (the fraggers don't need to be online). If anyone could do this i'm very glad :).

SQL:
('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,30;')
 
That is top fraggers online, and final_hit and unjustified is not in the sql code. So you get different stats then on the website.

PHP:
<?php
//Script by Elf
//Made for Modern AAC by Paxton
require("config.php");
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = $ots->getDBHandle();
echo '<div style="text-align: center; font-weight: bold;">Top 30 frags on ' . $config['server_name'] . '</div>
<table border="0" cellspacing="1" cellpadding="4" width="100%">
 <tr>
  <td class="white" style="text-align: center; font-weight: bold;">Name</td>
  <td class="white" style="text-align: center; font-weight: bold;">Frags</td>
 </tr>';

$i = 0;
foreach($SQL->query('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,30;') as $player)
{
 $i++;
 echo '<tr class="highlight">
  <td><a href="'.WEBSITE.'/index.php/character/view/'.$player['name'].'"><center>' . $player['name'] . '</center></a></td>
  <td><center>' . $player['frags'] . '</center></td>
 </tr>';
}

echo '</table>';
?>
 
Bump!! I know Cykotitan have created a similar script that shows ONLINE top fraggers. We're looking for a script that browsers the database for OFFLINE players aswell, I'm not very good at SQL selecting. Some help please!
 
Somebody may help me?
how do i add/send a broadcast message ?? the broadcaste message TOP 5 PLAYERS ONLINE (level

Would you mind helping me out? andddddddd, if i may, the top 5 fraggers online :P
tks very much

EWqAqz3.png
 
Back
Top