03.01.2016, 14:35
You will need a MySQL based gamemode and PHP socket functions on your webhost.
However, you could display the server's statistics by using an API. The one I use is SACNR API.
By placing this code on your website you will be able to display the server's statistics:
You can customize it though by adding new variables or removing, or also using HTML.
However, you could display the server's statistics by using an API. The one I use is SACNR API.
By placing this code on your website you will be able to display the server's statistics:
PHP код:
<?php
$url = 'http://monitor.sacnr.com/api/?IP=127.0.0.1&Port=7777&Action=info'; //Replace the server's IP & port here
$data = file_get_contents($url);
if($data == "0")
{
echo "<font color=red>The server is offline at this moment. Please be patient.</font>"; //This used to work on BroZeus API. Now is quite useless, as SACNR sends data even if the server is offline
}
else
{
$data = unserialize($data);
echo "<font color=green>Online</font><br>";
echo "Hostname:<br>" .$data->Hostname;
echo "<br>Map Name: " .$data->Map;
echo "<br>Gamemode: " .$data->Gamemode;
echo "<br>Players: " .$data->Players;
echo "/" .$data->MaxPlayers;
}
?>