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

Avesta Deathlist Help me

  • Thread starter Thread starter 53701688
  • Start date Start date
5

53701688

Guest
Dear People I have Avesta And i use deathlist but my problem is he only shows 1 death I also Use Nicaw Avesta 1

deathlist.jpg


You Can see The Problem here on the picture it shows only 1 death i want that the deaths shows more then 1

already big thx for the guy who helps me i give rep++

here down u can find mine script of nicaw avesta 1

<?php
/*
Copyright (C) 2007 - 2009 Nicaw

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
include ("include.inc.php");
$ptitle="Characters - $cfg[server_name]";
include("header.inc.php");
?>
<div id="content">
<div class="top">Character Lookup</div>
<div class="mid">
<form method="get" action="characters.php">
<input type="text" name="player_name"/>
<input type="submit" value="Search"/>
</form>
<?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;';
echo '<b><br>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 = 1;
foreach ($player->deaths as $death) {
if ($death['killer_id'])
if(is_int($players_deaths_count / 2))
$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) {}
?>
</div>
<div class="bot"></div>
</div>
<?php include ("footer.inc.php");?>
 
Last edited by a moderator:
This is the result:

Code:
array(1) { [0]=> array(4) { ["killer_name"]=> string(8) "Marilinn" ["killer_id"]=> int(2152) ["victim_level"]=> string(2) "88" ["date"]=> string(10) "1299921160" } } Latest Deaths
12th March 2011 09:12:40 Killed at level 88 by Marilinn
 
ok so it fetched only 1 row. how about you find the part where in constructs the player class and fetches deaths? search the php files for something like player_deaths
 
player.php (class)

Code:
    private function load_deaths() {
        if(empty($this->attrs['id'])) throw new PlayerNotLoadedException();
		if($this->sql->isTable('player_deaths')) {
            $query = "SELECT * FROM `player_deaths` WHERE (`player_id` = '".$this->sql->quote($this->attrs['id'])."') ORDER BY time DESC LIMIT 10";
            $this->sql->myQuery($query);
            $i = 0;
            while($a = $this->sql->fetch_array()) {
                $killer = new Player();
                try {
                    $killer->find($a['lasthit_killer']);
                    $this->deaths[$i]['killer_name'] = $killer->attrs['name'];
                    $this->deaths[$i]['killer_id'] = $killer->attrs['id'];
                } catch(PlayerNotFoundException $e) {
                    try {
                        $killer->load($death['lasthit_killer']);
                        $this->deaths[$i]['killer_name'] = $killer->attrs['name'];
                        $this->deaths[$i]['killer_id'] = $killer->attrs['id'];
                    } catch(PlayerNotFoundException $e) {
                        $this->deaths[$i]['killer_name'] = $a['lasthit_killer'];
                        $this->deaths[$i]['killer_id'] = null;
                    }
                }

                $this->deaths[$i]['victim_level'] = $a['level'];
                $this->deaths[$i]['date'] = $a['time'];
                $i++;
            }
        } else throw new DatabaseException('Deaths data not found in database or it is not compatible.');

        return true;
    }
 
Back
Top