• 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 I need help with this php script

Zistonick

Member
Joined
Mar 24, 2010
Messages
183
Reaction score
14
Hi everyone!

Im trying to update fraggers.php from old gesior to gesior 2012 but i dont know how to solve. Here is the code:
Code:
<?php
if(!defined('INITIALIZED'))
    exit;

$main_content .= '<div style="text-align: center; font-weight: bold;">Top 30 fraggers on ' . htmlspecialchars($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 COUNT(1) frags, `players`.`name` FROM `players`, `players`.`frags` FROM `players` GROUP BY `frags` ORDER BY ' . $SQL->fieldName('frags') . ' DESC, ' . $SQL->fieldName('name') . ' ASC LIMIT 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']) . '">' . htmlspecialchars($player['name']) . '</a></td>
        <td style="text-align: center;">' . $player['frags'] . '</td>
    </tr>';
}

$main_content .= '</table>';

I know the problem is in ('SELECT COUNT(1) frags, `players`.`name` FROM `players`, `players`.`frags` FROM `players` GROUP BY `frags` ORDER BY ' . $SQL->fieldName('frags') . ' DESC, ' . $SQL->fieldName('name') . ' ASC LIMIT 30;') as $player)

can someone help me?
 
You have to recreate the old frag system.

Make a database value in players for frags. Then create scripts for onKill that adds the frags, also create a script that takes them away after X time.
 
Back
Top