Skip to content

Instantly share code, notes, and snippets.

@koraktor
Created August 16, 2009 10:16
Show Gist options
  • Save koraktor/168595 to your computer and use it in GitHub Desktop.
Save koraktor/168595 to your computer and use it in GitHub Desktop.
Generating a HTML table for player data aquired using Steam Condenser
<?php
// Be sure that the path is correct
require_once "/path/to/steam-condenser/lib/steam-condenser.php";
// Add your server's IP address here ...
$ipAddress = new InetAddress("x.x.x.x");
// ... and port number here
$portNumber = yyyyy;
$server = new GoldSrcServer($ipAddress, $portNumber);
$players = $server->getPlayers("passw0rd"); // Player pings are only available if the RCON password is provided
echo "<table>";
echo "<tr><th>Name</th><th>Score</th><th>Ping</th></tr>";
foreach($players as $player) {
echo "<tr>";
echo "<td>{$player->getName()}</td>";
echo "<td>{$player->getScore()}</td>";
echo "<td>{$player->getPing()}</td>";
echo "</tr>";
}
echo "</table>";
?>
@jorea143
Copy link

jorea143 commented Feb 6, 2016

Could you update this? I don't know how to code so it be a great help if you can update this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment