All pastes #807869 Raw Edit

Something

public text v1 · immutable
·published 2007-12-07 02:19 UTC
rendered paste body
<?php
echo "<center>";
$file = "../outcry_home/server/logs/gamestat.txt";
$contents = file($file);
$players = str_replace("Players: ", "", $contents[1]);
$map = str_replace("Map: ", "", $contents[2]);
$mode = str_replace("Gamemode: ", "", $contents[3]);
$timeleft = str_replace("Timeleft: ", "", $contents[4]);
$alpha = str_replace("Team 1: ", "", $contents[5]);
$bravo = str_replace("Team 2: ", "", $contents[6]);
echo "<u>Information</u><br>";
echo "Name: SNAG Server<br>";
echo "Players: $players / 12<br>";
echo "Mode: $mode<br>";
echo "Map: $map<br>";
echo "Timeleft: $timeleft<br>";
//echo "<a target=\"_blank\" href=\"superview/map.php?port=23000\">Real time ove                  rview</a><br>";
echo "<br><u>Commands</u><br>";
echo "* !map <i>mapname</i> - change map<br>";
echo "* !pause - pause / unpause the game<br>";
echo "* !restart - restart map<br>";
echo "* !ping - test if bot is running<br>";
echo "<br><u>Team scores</u><br>";
echo "Alpha: $alpha <br>";
echo "Bravo: $bravo<br>";
echo "<br><u>Players Online</u><br>";
echo "(Name / Points / Deaths / Ping)<br>";
for($i = 0; $i < $players; $i++) {
$pos = 10 + ($i * 5);
$name = htmlentities(trim($contents[$pos]));
$points = trim($contents[$pos+1]);
$deaths = trim($contents[$pos+2]);
$team = trim($contents[$pos+3]);
$ping = trim($contents[$pos+4]);
if($team == 1){
echo "<font color=\"Red\">";
}elseif($team == 2){
echo "<font color=\"#3366FF\">";
}else{
echo "<font>";
}
echo $name;
echo " / ";
echo $points;
echo " / ";
echo $deaths;
echo " / ";
echo $ping;
echo "</font><br>";
}
echo "<br>";
?>