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

[Linux] Most Powerfull Guilds in-Game!

Vrotz

Member
Joined
Apr 7, 2011
Messages
1,071
Reaction score
7
Location
Brazil
Hi!

I need an script that show for all players in default after X minutes what is the most powerfull guild in-game!
Its possible?

Many thanks!
 
take a look at this:

PHP:
<?php

$topGuilds = $SQL->query('SELECT g.name AS guild, ROUND(AVG(p.level)) AS average FROM guilds AS g LEFT JOIN guild_membership AS gm ON gm.guild_id = g.id LEFT JOIN players AS p ON p.id = gm.player_id GROUP BY g.id ORDER BY average DESC LIMIT 5;')->fetchAll();

foreach ($topGuilds as $guild) {
    echo '<p><strong>'.$guild['guild'].'</strong> - '.$guild['average'].'</p>';
}

and this:

Its obvious when I see guys posting such shit, or selling worse one like AndersPro does.
Here are light, not requiring any extra events nor database fields Gesior AAC modules.

frags.php
Code:
<?php
$main_content .= '<div style="text-align: center; font-weight: bold;">Top 30 frags on ' . $config['server']['serverName'] . '</div>
<table border="0" cellspacing="1" cellpadding="4" width="100%">
    <tr bgcolor="' . $config['site']['vdarkborder'] . '">
        <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++;
    $main_content .= '<tr bgcolor="' . (is_int($i / 2) ? $config['site']['lightborder'] : $config['site']['darkborder']) . '">
        <td><a href="?subtopic=characters&name=' . urlencode($player['name']) . '">' . $player['name'] . '</a></td>
        <td style="text-align: center;">' . $player['frags'] . '</td>
    </tr>';
}

$main_content .= '</table>';
?>

and top guilds, which you should place in latestnews.php- anywhere you wish:
Code:
$main_content .= '<div class="NewsHeadline">
    <div class="NewsHeadlineBackground" style="background-image:url(' . $layout_name . '/images/news/newsheadline_background.gif)">
        <table border="0">
            <tr>
                <td style="text-align: center; font-weight: bold;">
                    <font color="white">Most powerfull guilds</font>
                </td>
            </tr>
        </table>
    </div>
</div>
<table border="0" cellspacing="3" cellpadding="4" width="100%">
    <tr>';

foreach($SQL->query('SELECT `g`.`id` AS `id`, `g`.`name` AS `name`,
    `g`.`logo_gfx_name` AS `logo`, COUNT(`g`.`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`
    LEFT JOIN `guild_ranks` gr ON `p`.`rank_id` = `gr`.`id`
    LEFT JOIN `guilds` g ON `gr`.`guild_id` = `g`.`id`
WHERE `k`.`unjustified` = 1 AND `k`.`final_hit` = 1
    GROUP BY `name`
    ORDER BY `frags` DESC, `name` ASC
    LIMIT 0, 4;') as $guild)
    $main_content .= '        <td style="width: 25%; text-align: center;">
            <a href="?subtopic=guilds&action=show&guild=' . $guild['id'] . '"><img src="guilds/' . ((!empty($guild['logo']) && file_exists('guilds/' . $guild['logo'])) ? $guild['logo'] : 'default_logo.gif') . '" width="64" height="64" border="0"/><br />' . $guild['name'] . '</a><br />' . $guild['frags'] . ' kills
        </td>';

$main_content .= '    </tr>
</table>';


Demo of guilds: http://wypas.eu/.
Have fun.

php and lua are similar so choose one and maybe I can help
 
Back
Top