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

Znote highscore

Zatacka

Mapper, Basic Scripter
Joined
May 12, 2009
Messages
222
Reaction score
14
Location
Sweden
Is there a script that only shows the top 5 highest player by rebirth for znote aac? to change it with this:

highscore.php
Code:
<?php require_once 'engine/init.php'; include 'layout/overall/header.php';
if ($config['log_ip']) {
    znote_visitor_insert_detailed_data(3);
}
if (empty($_POST) === false) {
  
    #if ($_POST['token'] == $_SESSION['token']) {
  
    /* Token used for cross site scripting security */
    if (isset($_POST['token']) && Token::isValid($_POST['token'])) {
      
        $skillid = (int)$_POST['selected'];
        $cache = new Cache('engine/cache/highscores');

        if ($cache->hasExpired()) {
            $tmp = highscore_getAll();

            $cache->setContent($tmp);
            $cache->save();

            $array = isset($tmp[$skillid]) ? $tmp[$skillid] : $tmp[7];
        } else {
            $tmp = $cache->load();
            $array = $tmp[$skillid];
        }
      
        if ($skillid < 9) {
        // Design and present the list
        if ($array) {
            ?>
            <h2>
                <?php echo ucfirst(skillid_to_name($skillid)); ?> scoreboard. Next update:
                    <?php
                        if ($cache->remainingTime() > 0) {
                            $hours = seconds_to_hours($cache->remainingTime());
                            $minutes = ($hours - (int)$hours) * 60;
                            $seconds = ($minutes - (int)$minutes) * 60;
                            if ($hours >= 1) {
                                echo (int)$hours .'h';
                            }
                            if ($minutes >= 1) {
                                echo ' '. (int)$minutes .'m';
                            }
                            if ($seconds >= 1) {
                                echo ' '. (int)$seconds .'s';
                            }
                        } else {
                            echo '0s';
                        }
                      
                    ?>. <?php echo remaining_seconds_to_clock($cache->remainingTime());?>
            </h2>
            <table>
                <tr class="yellow">
                    <td>Name:</td>
                    <?php
                    if ($skillid == 7) echo '<td>Level:</td><td>Experience:</td>';
                    else {
                    ?>
                    <td>Value:</td>
                    <?php
                    }
                    if ($skillid == 7 || $skillid == 6 || $skillid == 5) {
                        echo '<td>Vocation:</td>';
                    }
                    ?>
                </tr>
                    <?php
                    foreach ($array as $value) {
                        // start foreach
                        $chardata = user_character_data(user_character_id($value[0]), 'group_id');
                        if ($chardata['group_id'] < 2) {
                            echo '<tr>';
                            echo '<td><a href="characterprofile.php?name='. $value[0] .'">'. $value[0] .'</a></td>';
                            if ($skillid == 7) echo '<td>'. $value[3] .'</td>';
                            echo '<td>'. $value[1] .'</td>';
                            if ($skillid == 7 || $skillid == 6 || $skillid == 5) {
                                echo '<td>'. $value[2] .'</td>';
                            }
                            echo '</tr>';
                        }
                        // end foreach
                    }
                    ?>
            </table>
            <?php
        } else {
            echo 'Empty list, it appears all players have less than 500 experience points.';
        }
        //Done.
        }
    } else {
        echo 'Token appears to be incorrect.<br><br>';
        //Token::debug($_POST['token']);
        echo 'Please clear your web cache/cookies <b>OR</b> use another web browser<br>';
    }
}

/*
0 fist: SELECT (SELECT `name` from `players` WHERE `player_id`=`id`) AS `name`, `value` FROM `player_skills` WHERE `skillid`=0
1 club:
2 sword:
3 axe:
4 dist:
5 Shield:
6 Fish
7 Hardcoded experience
8 Hardcoded maglevel
*/
include 'layout/overall/footer.php'; ?>
 
Can you rephrase the problem?
What do you want to achieve?

Do you want highscores for rebirth count?
 
Can you rephrase the problem?
What do you want to achieve?

Do you want highscores for rebirth count?
Forget about the highscore, i just wanna show the top 5 player by rebirth instead of the highscore field on the website like this:

Code:
TOP 5 PLAYERS

1. Zatacka
2. John
3. Mike
4. Robin hood
5. Hulk
 
Last edited:
Are you using storages for rebirths or a custom field (e.g rebirths) in the players table?
 
No fields in the players tables yet, but ingame i use 85987 storage(npc,prestige tiles, spells, doors) all have the same storage
 
Back
Top