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

[Nicaw] Show all players deaths

atyll

Member
Joined
Dec 30, 2008
Messages
380
Reaction score
16
Hello Guys

Currently, my player's deathlist shows only 1 latest death.
There is nothing in config, which states how many deaths it should display.
I checked my database and it does actually store ALL deaths, which I would like to display.

How to do that?

This is my characters.php script:

Code:
        <?php
        try {
            $player = new Player();
            if (!empty($_GET['player_id'])) {
                $player->load($_GET['player_id']);
            } elseif (!empty($_GET['player_name'])) {
                $player->find($_GET['player_name']);
            } else {
                throw new PlayerException();
            }
            $account = new Account();
            $account->load($player->attrs['account']);

            echo '<hr/><table style="width: 100%"><tr><td><b>Name:</b> '.htmlspecialchars($player->attrs['name']).'&nbsp;';
            if($player->isOnline()) echo '<span style="color:green">[Online]</span>'."<br/>\n";
            else echo '<span style="color:red">[Offline]</span>'."<br/>\n";
            echo '<b>Level:</b> '.$player->attrs['level']."<br/>\n";
            echo '<b>Magic Level:</b> '.$player->attrs['maglevel']."<br/>\n";
            echo '<b>Vocation:</b> '.$cfg['vocations'][$player->attrs['vocation']]['name']."<br/>\n";

            try {
                echo '<b>Guild:</b> '.$player->guild['guild_rank_name'].' of <a href="guilds.php?guild_id='.$player->guild['guild_id'].'">'.htmlspecialchars($player->guild['guild_name']).'</a><br/>'."\n";
            } catch(GuildNotFoundException $e) {}

            $gender = Array('Female','Male');
            echo '<b>Gender:</b> '.$gender[$player->attrs['sex']].'<br/>'."\n";
            if (!empty($cfg['temple'][$player->attrs['city']]['name']))
                echo "<b>Residence</b>: ".ucfirst($cfg['temple'][$player->attrs['city']]['name'])."<br/>";

            if (isset($player->attrs['position'])) {
                echo "<b>Position: </b> ".$player->attrs['position']."<br/>";
            }
            if ($account->attrs['premend'] > time()) {
                echo "<b>Premium: </b> ".ceil(($account->attrs['premend'] - time())/(3600*24))." day(s)<br/>";
            }
            if ($player->attrs['lastlogin'] == 0)
                $lastlogin = 'Never';
            else
                $lastlogin = date("jS F Y H:i:s",$player->attrs['lastlogin']);
            echo "<b>Last Login:</b> ".$lastlogin."<br/>\n";
            if ($cfg['show_skills']) {
                echo "</td><td>";
                $sn = $cfg['skill_names'];
                for ($i=0; $i < count($sn); $i++) {
                    echo '<b>'.ucfirst($sn[$i]).':</b> '.$player->skills[$i]['skill']."<br/>\n";
                }
                echo '</td></tr>';
            }
            echo '</table>';
            if (strlen($account->attrs['comment'])>0) {
                echo "<b>Comments</b><br/><div style=\"overflow:hidden\"><pre>".htmlspecialchars($account->attrs['comment'])."</pre></div><br/>\n";
            }
            echo '<hr/>';
            if ($account->attrs['reveal_characters'] && $account->players && count($account->players) > 1) {
                echo '<b>Characters on the same account</b><br/><ul class="task-menu">';
                foreach ($account->players as $_player) {
                    echo '<li style="background-image: url(resource/user.png);" onclick="window.location.href=\'characters.php?player_id='.htmlspecialchars($_player['id']).'\'">'.htmlspecialchars($_player['name']).'</li>';
                }
                echo '</ul><hr/>';
            }

            if ($cfg['show_deathlist']) {
                if ($player->deaths) {
                    echo '<b>Latest Deaths</b><br/>';
                    $prevdate = 0;
                    foreach ($player->deaths as $death) {
                        if ($death['killer_id'])
                            $name = '<a href="characters.php?player_id='.$death['killer_id'].'">'.$death['killer_name'].'</a>';
                        else
                            $name = $death['killer_name'];
                        if($prevdate == $death['date'])
                            echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and by '.$name.'<br/>';
                        else
                            echo '<i>'.date("jS F Y H:i:s",$death['date']).'</i> Killed at level '.$death['victim_level'].' by '.$name.'<br/>';
                        $prevdate = $death['date'];
                    }
                }
            }
        } catch(PlayerNotFoundException $e) {
            echo 'Player not found';
        } catch(PlayerException $e) {}
        ?>
 
I think its the TFS config. since it calls back many and if it only shows one then the DB doesnt support more then one.

There is something in the TFS config called "maxDeathRecords".

Try to set it to something what you want to.
 
Yeah but I have checked the database and many deaths are being stored for each player, but yet still it displays only one. Really strange
 
Back
Top