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

Frags list web tfs 1.x

dervin13

Active Member
Joined
Apr 26, 2008
Messages
458
Solutions
1
Reaction score
28
Is it possible to transform this frag list into tfs 1.x? I already search a lot in the forum and didn't find any frag list to new tfs

thanks

PHP:
        //frags list by Xampy
        $i = 0;
        $frags_limit = 10; // frags limit to show? // default: 10
            $player_frags = $db->query("SELECT `pd`.`time`, `pd`.`level`, `pd`.`unjustified`, `pd`.`mostdamage_by`, `pd`.`mostdamage_unjustified`, `p`.`name` FROM `player_deaths` AS `pd` INNER JOIN `players` AS `p` ON `pd`.`player_id`=`p`.`id` WHERE `pd`.`killed_by` = '". $frag['name'] ."' ORDER BY `pd`.`time` DESC LIMIT 10;");
            if(count($player_frags))
        {
            $row_count = 0;
            foreach($player_frags as $frag)
            {
                $description = 'Fragged <a href="' . getPlayerLink($frag['name'], false) . '">' . $frag['name'] . '</a> at level ' . $frag['level'];
                $frags[] = array('time' => $frag['date'], 'description' => $description, 'unjustified' => $frag['unjustified'] != 0);
            }
        }
    }
 
Up - this is the character death list, how can i transform into a frag list of the player? thanks


PHP:
            $mostdamage = ', `mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified`';
        $deaths_db = $db->query('SELECT
                `player_id`, `time`, `level`, `killed_by`, `is_player`' . $mostdamage . '
                FROM `player_deaths`
                WHERE `player_id` = ' . $player->getId() . ' ORDER BY `time` DESC LIMIT 10;')->fetchAll();

        if(count($deaths_db))
        {
            $number_of_rows = 0;
            foreach($deaths_db as $death)
            {
                $lasthit = ($death['is_player']) ? getPlayerLink($death['killed_by']) : $death['killed_by'];
                $description =  'Killed at level ' . $death['level'] . ' by ' . $lasthit;
                if($death['unjustified']) {
                    $description .=  ' <span style="color: red; font-style: italic;">(unjustified)</span>';
                }

                $mostdmg = ($death['mostdamage_by'] !== $death['killed_by']) ? true : false;
                if($mostdmg)
                {
                    $mostdmg = ($death['mostdamage_is_player']) ? getPlayerLink($death['mostdamage_by']) : $death['mostdamage_by'];
                    $description .=  ' and by ' . $mostdmg;

                    if ($death['mostdamage_unjustified']) {
                        $description .=  ' <span style="color: red; font-style: italic;">(unjustified)</span>';
                    }
                }
                else {
                    $description .=  " <b>(soloed)</b>";
                }

                $deaths[] = array('time' => $death['time'], 'description' => $description);
            }
        }
    }
 
Back
Top