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

Windows I need code to highscore!

As in the webite?
PHP:
<?PHP 

$ots = POT::getInstance(); 
$ots->connect(POT::DB_MYSQL, connection()); 
$SQL = POT::getInstance()->getDBHandle(); 


                                $money_list = $SQL->query('SELECT name,level,experience FROM players ORDER BY experience DESC LIMIT 5')->fetchAll(); 
                                        $i = 1; 
                                        foreach($money_list as $money_chr){ 
                                        echo '<center>'; 
                                            echo $i.'. <a href="'.WEBSITE.'/index.php/character/view/'.$money_chr['name'].'">';
        $player = $ots->createObject('Player'); 
        $player->find($money_chr['name']);  
                        echo '<font color="'; 
                        echo ($player->isOnline()) ? 'green' : 'red'; 
                        echo '">';     
                        echo '<b>'.$money_chr['name'].'</b></a></font>'; 
                        echo  '<br>Level: <B>'.$money_chr['level'].'</B><br>'; 
                                            $i++; 
                                        } 
                                        for( $i; $i <= 5; $i++ ){ 
                                            echo $i.'. <br><i>Empty</i><br /><br />'; 
                                        } 
                                        echo '</center>'; 
                                         
?>


If you want like !highscores, then add this as a MOD
LUA:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Highscore book" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes">
    <action itemid="1981" event="buffer"><![CDATA[
        if(item.actionid >= 150 and item.actionid <= 158) then
            doShowTextDialog(cid, item.itemid, getHighscoreString((item.actionid - 150)))
        else
            _result = false
        end
    ]]></action>
    <item id="1981" article="a" name="highscore book" override="yes"/>
</mod>
 
Back
Top