SA-MP Forums Archive
Server Info on forum - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Server Info on forum (/showthread.php?tid=57906)



Server Info on forum - Pawel_Shark - 12.12.2008

hi do you know how to put server info on forum what i mean is players ?/? Online/Offline. How can i put that ?? on a forum that it will refresh and you will se the numer of players


Re: Server Info on forum - Redgie - 12.12.2008

You could either store the information in a file which you then interpret with your webserver, or just use a game monitor statistics bar. There is another way, but I'm no expert on reading server info externally so I'll let someone else talk about that side of it.


Re: Server Info on forum - SPFoxy - 12.12.2008

u mean onto ur server forums?


Re: Server Info on forum - Pawel_Shark - 12.12.2008

I want to put the server status on the forum, that it gets the ip and shows Online/Offline and nuumber of players playing


Re: Server Info on forum - Pawel_Shark - 12.12.2008

i think this would work for the Online/Offline but what about Number of players ?

<?
$ip = "ipaddress";
$port = "port";
if (! $sock = @fsockopen($ip, $port, $num, $error, 5))
echo '<B><FONT COLOR=red>Offline</b></FONT>';
else{
echo '<B><FONT COLOR=lime>Online</b></FONT>';
fclose($sock);
}
?>