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

Deathlist / Unjusts

Yatozin

New Member
Joined
Jun 13, 2014
Messages
49
Reaction score
3
so im using
FORGOTTENSERVER-ORTS tfs 1.0 and gesior 2012~
and im wondering how i can make so the deathlist is more like real tibia were more than 2 people get unjusts and shows on deathlist of players
 
so im using
FORGOTTENSERVER-ORTS tfs 1.0 and gesior 2012~
and im wondering how i can make so the deathlist is more like real tibia were more than 2 people get unjusts and shows on deathlist of players
taken from gesior acc maker code:

PHP:
        $player_deaths = $SQL->query('SELECT ' . $SQL->fieldName('id') . ', ' . $SQL->fieldName('date') . ', ' . $SQL->fieldName('level') . ' FROM ' . $SQL->tableName('player_deaths') . ' WHERE ' . $SQL->fieldName('player_id') . ' = '.$player->getId().' ORDER BY ' . $SQL->fieldName('date') . ' DESC LIMIT 10');
        foreach($player_deaths as $death)
        {
         
            $deads++;
            $dead_add_content .= "<tr><td width=\"20%\" align=\"center\">".date("j M Y, H:i", $death['date'])."</td><td>";
            $killers = $SQL->query('SELECT ' . $SQL->tableName('environment_killers') . '.' . $SQL->fieldName('name') . ' AS monster_name, ' . $SQL->tableName('players') . '.' . $SQL->fieldName('name') . ' AS player_name, ' . $SQL->tableName('players') . '.' . $SQL->fieldName('deleted') . ' AS player_exists FROM ' . $SQL->tableName('killers') . ' LEFT JOIN ' . $SQL->tableName('environment_killers') . ' ON ' . $SQL->tableName('killers') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('environment_killers') . '.' . $SQL->fieldName('kill_id') . ' LEFT JOIN ' . $SQL->tableName('player_killers') . ' ON ' . $SQL->tableName('killers') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('player_killers') . '.' . $SQL->fieldName('kill_id') . ' LEFT JOIN ' . $SQL->tableName('players') . ' ON ' . $SQL->tableName('players') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('player_killers') . '.' . $SQL->fieldName('player_id') . '  WHERE ' . $SQL->tableName('killers') . '.' . $SQL->fieldName('death_id') . ' = ' . $SQL->quote($death['id']) . ' ORDER BY ' . $SQL->tableName('killers') . '.' . $SQL->fieldName('final_hit') . ' DESC, ' . $SQL->tableName('killers') . '.' . $SQL->fieldName('id') . ' ASC')->fetchAll();

            $i = 0;
            $count = count($killers);
            foreach($killers as $killer)
            {
                $i++;
                if($i == 1)
                {
                    if($count <= 4)
                        $dead_add_content .= "killed at level <b>".$death['level']."</b> by ";
                    elseif($count > 4 and $count < 10)
                        $dead_add_content .= "slain at level <b>".$death['level']."</b> by ";
                    elseif($count > 9 and $count < 15)
                        $dead_add_content .= "crushed at level <b>".$death['level']."</b> by ";
                    elseif($count > 14 and $count < 20)
                        $dead_add_content .= "eliminated at level <b>".$death['level']."</b> by ";
                    elseif($count > 19)
                        $dead_add_content .= "annihilated at level <b>".$death['level']."</b> by ";
                }
                elseif($i == $count)
                    $dead_add_content .= " and ";
                else
                    $dead_add_content .= ", ";

                if($killer['player_name'] != "")
                {
                    if($killer['monster_name'] != "")
                        $dead_add_content .= htmlspecialchars($killer['monster_name'])." summoned by ";

                    if($killer['player_exists'] == 0)
                        $dead_add_content .= "<a href=\"index.php?subtopic=characters&name=".urlencode($killer['player_name'])."\">";

                    $dead_add_content .= htmlspecialchars($killer['player_name']);
                    if($killer['player_exists'] == 0)
                        $dead_add_content .= "</a>";
                }
                else
                    $dead_add_content .= htmlspecialchars($killer['monster_name']);
            }

            $dead_add_content .= "</td></tr>";
        }

        if($deads > 0)
            $main_content .= '<h2>Deaths</h2> <TABLE WIDTH=100%>' . $dead_add_content . '</TABLE><br />';
i think this should work, but im not 100% sure
 
Not working this is what is currently looks like if it helps

Code:
//deaths list
        $player_deaths = new DatabaseList('PlayerDeath');
        $player_deaths->setFilter(new SQL_Filter(new SQL_Filter(new SQL_Field('player_id'), SQL_Filter::EQUAL, $player->getId()), SQL_Filter::CRITERIUM_AND,new SQL_Filter(new SQL_Field('id', 'players'), SQL_Filter::EQUAL, new SQL_Field('player_id', 'player_deaths'))));
        $player_deaths->addOrder(new SQL_Order(new SQL_Field('time'), SQL_Order::DESC));
        $player_deaths->setLimit(20);

        foreach($player_deaths as $death)
        {
            $bgcolor = (($number_of_rows++ % 2 == 1) ?  $config['site']['darkborder'] : $config['site']['lightborder']);
            $deads++;
            $dead_add_content .= "<tr bgcolor=\"".$bgcolor."\"><td width=\"20%\" align=\"center\">".date("j M Y, H:i", $death->getTime())."</td><td>Died at level " . $death->getLevel() . " by " . $death->getKillerString();
            if($death->getMostDamageString() != '' && $death->getKillerString() != $death->getMostDamageString())
                $dead_add_content .= ' and ' . $death->getMostDamageString();
            $dead_add_content .= "</td></tr>";
        }
 
Last edited:
Back
Top