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

[Gesior AAC] Victims list

Xampy

PHP | SQL | LUA | C++
Joined
Jun 22, 2008
Messages
1,109
Reaction score
17
Hello!

I'm releasing this in a request by kito2. It works with TFS 0.3.5, 0.3.6 & 0.4.

Here's the code that you must put after the deaths list code in characters.php file (C:/xampp/htdocs/):

PHP:
            //frags list by Xampy 
             
            $frags_limit = 10; // frags limit to show? // default: 10 
            $player_frags = $SQL->query('SELECT `player_deaths`.*, `players`.`name`, `killers`.`unjustified` FROM `player_deaths` LEFT JOIN `killers` ON `killers`.`death_id` = `player_deaths`.`id` LEFT JOIN `player_killers` ON `player_killers`.`kill_id` = `killers`.`id` LEFT JOIN `players` ON `players`.`id` = `player_deaths`.`player_id` WHERE `player_killers`.`player_id` = '.$player->getId().' ORDER BY `date` DESC LIMIT 0,'.$frags_limit.';'); 
            if(count($player_frags)) 
            { 
                $frags = 0; 
                $frag_add_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><br><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Victims</B></TD></TR>'; 
                foreach($player_frags as $frag) 
                { 
                $frags++; 
                    if(is_int($number_of_rows / 2)) $bgcolor = $config['site']['darkborder']; else $bgcolor = $config['site']['lightborder']; 
                    $number_of_rows++; 
                    $frag_add_content .= "<tr bgcolor=\"".$bgcolor."\"> 
                    <td width=\"20%\" align=\"center\">".date("j M Y, H:i", $frag['date'])."</td> 
                    <td>".(($player->getSex() == 0) ? 'She' : 'He')." fragged <a href=\"index.php?subtopic=characters&name=".$frag[name]."\">".$frag[name]."</a> at level ".$frag[level].""; 
 
                    $frag_add_content .= ". (".(($frag[unjustified] == 0) ? "<font size=\"1\" color=\"green\">Justified</font>" : "<font size=\"1\" color=\"red\">Unjustified</font>").")</td></tr>"; 
                } 
            if($frags >= 1) 
                $main_content .= $frag_add_content . '</TABLE>'; 
            } 
            // end of frags list by Xampy


Picture:

2q06dci.png



Regards.
 
Last edited:
@thread:
I tested and worked fine. But some other people tested and said me that frags that the system gets are wrong, can you test it and write here if works fine or not? :p
 
Should be called 'victims' insted of frags
good job :p
 
Yes, in this one:
PHP:
			//frags list by Xampy
			
			$frags_limit = 10; // frags limit to show? // default: 10
			$player_frags = $SQL->query('SELECT `player_deaths`.*, `players`.`name`, `killers`.`unjustified` FROM `player_deaths` LEFT JOIN `killers` ON `killers`.`death_id` = `player_deaths`.`id` LEFT JOIN `player_killers` ON `player_killers`.`kill_id` = `killers`.`id` LEFT JOIN `players` ON `players`.`id` = `player_deaths`.`player_id` WHERE `player_killers`.`player_id` = '.$player->getId().' ORDER BY `date` DESC LIMIT 0,'.$frags_limit.';');
			if(count($player_frags))
			{
				$frags = 0;
				$frag_add_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><br><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Frags</B></TD></TR>';
				foreach($player_frags as $frag)
				{
				$frags++;
					if(is_int($number_of_rows / 2)) $bgcolor = $config['site']['darkborder']; else $bgcolor = $config['site']['lightborder'];
					$number_of_rows++;
					$frag_add_content .= "<tr bgcolor=\"".$bgcolor."\">
					<td width=\"20%\" align=\"center\">".date("j M Y, H:i", $frag['date'])."</td>
					<td>".(($player->getSex() == 0) ? 'She' : 'He')." fragged <a href='index.php?subtopic=characters&name=".$frag[name]."'>".$frag[name]."</a> at level ".$frag[level]."";

					$frag_add_content .= ". (".(($frag[unjustified] == 0) ? "<font size=\"1\" color=\"green\">Justified</font>" : "<font size=\"1\" color=\"red\">Unjustified</font>").")</td></tr>";
				}
			if($frags >= 1)
				$main_content .= $frag_add_content . '</TABLE>';
			}
			// end of frags list by Xampy
 
I dont think it is working fine, each player appear like 4 times in the list..

Edit: Nevermind! its fixed in your script there right up.. you should edit your main post :p thanks!
 
Yes, in this one:
PHP:
			//frags list by Xampy
			
			$frags_limit = 10; // frags limit to show? // default: 10
			$player_frags = $SQL->query('SELECT `player_deaths`.*, `players`.`name`, `killers`.`unjustified` FROM `player_deaths` LEFT JOIN `killers` ON `killers`.`death_id` = `player_deaths`.`id` LEFT JOIN `player_killers` ON `player_killers`.`kill_id` = `killers`.`id` LEFT JOIN `players` ON `players`.`id` = `player_deaths`.`player_id` WHERE `player_killers`.`player_id` = '.$player->getId().' ORDER BY `date` DESC LIMIT 0,'.$frags_limit.';');
			if(count($player_frags))
			{
				$frags = 0;
				$frag_add_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><br><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Frags</B></TD></TR>';
				foreach($player_frags as $frag)
				{
				$frags++;
					if(is_int($number_of_rows / 2)) $bgcolor = $config['site']['darkborder']; else $bgcolor = $config['site']['lightborder'];
					$number_of_rows++;
					$frag_add_content .= "<tr bgcolor=\"".$bgcolor."\">
					<td width=\"20%\" align=\"center\">".date("j M Y, H:i", $frag['date'])."</td>
					<td>".(($player->getSex() == 0) ? 'She' : 'He')." fragged <a href='index.php?subtopic=characters&name=".$frag[name]."'>".$frag[name]."</a> at level ".$frag[level]."";

					$frag_add_content .= ". (".(($frag[unjustified] == 0) ? "<font size=\"1\" color=\"green\">Justified</font>" : "<font size=\"1\" color=\"red\">Unjustified</font>").")</td></tr>";
				}
			if($frags >= 1)
				$main_content .= $frag_add_content . '</TABLE>';
			}
			// end of frags list by Xampy

Awesome :D!
 
Oh, okay... I think it was not fixed XDD

Btw, I can't edit the post, I'm awaiting some MOD edit it :p
 
a fixxx

@up:
Oh, thanks :p xd.

About...
Last fix:::::
PHP:
			//frags list by Xampy
			
			$frags_limit = 10; // frags limit to show? // default: 10
			$player_frags = $SQL->query('SELECT `player_deaths`.*, `players`.`name`, `killers`.`unjustified` FROM `player_deaths` LEFT JOIN `killers` ON `killers`.`death_id` = `player_deaths`.`id` LEFT JOIN `player_killers` ON `player_killers`.`kill_id` = `killers`.`id` LEFT JOIN `players` ON `players`.`id` = `player_deaths`.`player_id` WHERE `player_killers`.`player_id` = '.$player->getId().' ORDER BY `date` DESC LIMIT 0,'.$frags_limit.';');
			if(count($player_frags))
			{
				$frags = 0;
				$frag_add_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><br><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Frags</B></TD></TR>';
				foreach($player_frags as $frag)
				{
				$frags++;
					if(is_int($number_of_rows / 2)) $bgcolor = $config['site']['darkborder']; else $bgcolor = $config['site']['lightborder'];
					$number_of_rows++;
					$frag_add_content .= "<tr bgcolor=\"".$bgcolor."\">
					<td width=\"20%\" align=\"center\">".date("j M Y, H:i", $frag['date'])."</td>
					<td>".(($player->getSex() == 0) ? 'She' : 'He')." fragged <a href=\"index.php?subtopic=characters&name=".$frag[name]."\">".$frag[name]."</a> at level ".$frag[level]."";

					$frag_add_content .= ". (".(($frag[unjustified] == 0) ? "<font size=\"1\" color=\"green\">Justified</font>" : "<font size=\"1\" color=\"red\">Unjustified</font>").")</td></tr>";
				}
			if($frags >= 1)
				$main_content .= $frag_add_content . '</TABLE>';
			}
			// end of frags list by Xampy
I fixed that if you click on a player that his name contains a ' (Zhao'xin) it was linking you to:
instead of:

Regards!
 
Back
Top