Hey, I wonder how you get it to say on a site that if ur (clan) server is up or not.
Like, if the server is down, the text says something like 'blabla Server is down at the moment' and when it is up 'blabla Server is up at the moment (and maybe: click here to join)' Also it would be nice if you could somehow display a bit stats about it, like players, gamemode and so on...
If I'm posting in wrong topic blame me and move it to the right.. ;)
Thanks for future help. :-)
-[ETA] Ken the Great
the u13sss stats package has the scripts to do this. There was also something else that someone released that was specifically to do this.
The next release of U13SSS, release 5, will have better scripts for this, but i'm not sure when it'll be out
Soldat Status is a simple script that will do this in PHP on your site.
There is another way of retrieving the status in PHP.
$ip = "126.96.36.199";
$port = "23073";
$f = file_get_contents("http://$ip:$port/");
This should work if im not wrong.
mar77a, that only works if they have the tcp opened for tcp as well, not all servers do
that is why you can't always use fsockopen with tcp to tell if the server is up
The script I wrote is very simple, and it adds the additional 10 to the port number to ping. Not the best way to do it but it works. :P
umm, I can't get the script to work... I uploaded the soldat_status folder to my webhost and added those lines to the site, but they are just showing as plain text, when it was .htm. I tried with a php program too but it did just show the first entry as plain text, the second was invicible, in .php.
this is how the .php looks inside:
I'm almost sure I have in my low knowledge of php wrote something wrong, but I don't know what. Could someone help me? =)
-Ken the Great
are yo usure your webserver supports php?
quote:Originally posted by FliesLikeABrickare yo usure your webserver supports php?
That is what I am thinking.
You need to put 'include ("soldat_status/server.php");' inside the <?php ?> tags aswell :)
it should.. I can't get on it right now but as far as I remember it supports php...
www.cjb.cc is the webhost
yeah, that host does support php, i missed what php had said:
and yeah, enesce is right, you need to move the include() line to inside the php.