Hi all,
Can someone writes me a script (for tfs 0.3.6) that will count how many people killed?
It's mean if i kill someone table frags_all will get +1.
i need this
It will be very helpful for all
mysql:
and it is my frags.php
FEBA OTS - Top Fragers <=it show what is wrong
plz help
Can someone writes me a script (for tfs 0.3.6) that will count how many people killed?
It's mean if i kill someone table frags_all will get +1.
i need this
It will be very helpful for all
mysql:
ALTER TABLE `players` ADD `frags_all` INT( 11 ) NOT NULL;
and it is my frags.php
PHP:
<?php
function coloured_value($valuein)
{
$value2 = $valuein;
while(strlen($value2) > 3)
{
$value .= ' '.substr($value2, -3, 3);
$value2 = substr($value2, 0, strlen($value2)-3);
}
$value = $value2.$value;
if($valuein > 0)
return ''.$value.'';
elseif($valuein < 0)
return '<font color="red">-'.$value.'</font>';
else
return ''.$value.'';
}
function placeImages($count){
if($count > 300) return "<img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/blackskull.gif'><img src='images/blackskull.gif'><img src='images/blackskull.gif'>";
if($count > 260) return "<img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/blackskull.gif'><img src='images/blackskull.gif'>";
if($count > 230) return "<img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskullhalf.gif'>";
if($count > 190) return "<img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'>";
if($count > 150) return "<img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskullhalf.gif'>";
if($count > 120) return "<img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'>";
if($count > 90) return "<img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskullhalf.gif'>";
if($count > 70) return "<img src='images/redskull.gif'><img src='images/redskull.gif'>";
if($count > 50) return "<img src='images/redskull.gif'><img src='images/redskullhalf.gif'>";
if($count > 30) return "<img src='images/redskull.gif'>";
if($count > 10) return "<img src='images/redskullhalf.gif'>";
}
function showTopExp()
{
global $SQL;
global $config,$connect;
$world = $_GET['world'];
if ($world > 0 && is_numeric($world)){
$world = " WHERE `world_id` = ".(int)($world-1)."";
}
$return .= "<br><h2><center><font color='red'>Top 25 Fragers on ".$config['server']['serverName']."</font></center></h2><br>
<table border=0 cellspacing=1 cellpadding=4 width=100%>
<tr bgcolor=\"".$config['site']['vdarkborder']."\">
<td class=white><font><b>Lp.</b></font></td>
<td class=white width=\"40%\"><font><b>Name</b></font></td>
<td class=white><font><b>Online</b></font></td>
<td class=white width=\"20%\"><font><b>World</b></font></td>
<td class=white width=\"40%\"><font><b>Count</b></font></td></tr>";
$groupMembers = $SQL->query('SELECT `name`,`frags_all`,`level`,`world_id`,`online`,`account_id` FROM `players`'.$world.' ORDER BY `frags_all` DESC LIMIT 25');
$membersCount = 0;
$memberss = 0;
foreach($groupMembers as $member)
{
$membersCount++;
if(is_int($membersCount / 2))
$bgcolor = $config['site']['darkborder'];
else
$bgcolor = $config['site']['lightborder'];
$count = $member['experience']-$member['exphist_lastexp'];
$return .= "<tr bgcolor=\"".$bgcolor."\"><td>".$membersCount.".</td>
<td><a href=\"index.php?subtopic=characters&name=".$member['name']."\">".$member['name']." [".$member['level']."]</a></td>
<td><center>".$on."</center></td>
<td>".$config['server']['serverName']."</td>
<td>".$member['frags_all']." different people<br/>".placeImages($member['frags_all'])."</td>
</tr>";
$memberss++;
}
if ($membersCount = 0) $return .= "<tr bgcolor=\"".$config['site']['darkborder']."\">
<td colspan=\"2\">No statistics available.</td>
</tr>";
$return .= "</table>";
if($memberss > 0){
$memberss = 0;
return $return;
}else
{
return false;
}
}
$main_content .= showTopExp();
?>
FEBA OTS - Top Fragers <=it show what is wrong
plz help
Last edited: