Website to server - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Website to server (
/showthread.php?tid=597670)
Website to server -
RaajParker - 03.01.2016
I want to connect My fourms to server how can i connect pls help me
I want my banned members , top score player , top time played player like that on fourms how can i got ie pls help me
Re: Website to server -
FreAkeD - 03.01.2016
https://sampforum.blast.hk/showthread.php?tid=99649
Re: Website to server -
Michael B - 03.01.2016
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:
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;
}
?>
You can customize it though by adding new variables or removing, or also using HTML.