ive searched all over and i cant seem to find a working serverstatus page with character,count account count and a ranking page... can someone help me? and players online
ive searched all over and i cant seem to find a working serverstatus page with character,count account count and a ranking page... can someone help me? and players online
Last edited by BaLeSsK1; 13-12-09 at 09:28 PM.
Ask legacycode or something, hes pro at php maybe he will tell you how to do that.
Written from memory, give it a try.PHP Code:<?php
$ip = "WAN IP";
$serverport = 6000;
$locatorport = 8900;
$agentport = 7777;
$servercon = @fsockopen($ip, $serverport, $errno, $errstr, 5);
if(!$servercon)
{
$servermsg = "Offline";
}
else
{
$servermsg = "Online";
}
$locatorcon = @fsockopen($ip, $locatorport, $errno, $errstr, 5);
if(!$locatorcon)
{
$locatormsg = "Offline";
}
else
{
$locatormsg = "Online";
}
$agentcon = @fsockopen($ip, $agentport, $errno, $errstr, 5);
if(!$agentcon)
{
$agentmsg = "Offline";
}
else
{
$agentmsg = "Online";
}
echo "Server: $servermsg";
echo "Locator: $locatormsg";
echo "Agent: $agentmsg";
?>
Edit: Oops, forgot, you need to add <br> at the end of the echoes or it will all be on the same line.
Also, locator status doesn't show, I don't know if you can check that or not o.o
PHP Code:<?php $ip = "altf4network.com"; $serverport = 6000; $locatorport = 8900; $agentport = 7777;
$servercon = @fsockopen($ip, $serverport, $errno, $errstr, 5); if(!$servercon){$servermsg = "Offline";}else{$servermsg = "Online";}
$locatorcon = @fsockopen($ip, $locatorport, $errno, $errstr, 5); if(!$locatorcon){$locatormsg = "Offline";}else{$locatormsg = "Online";}
$agentcon = @fsockopen($ip, $agentport, $errno, $errstr, 5); if(!$agentcon){$agentmsg = "Offline";}else{$agentmsg = "Online";}
echo "Server: $servermsg<br>"; echo "Locator: $locatormsg<br>"; echo "Agent: $agentmsg"; ?>
Last edited by V_o_o_d_o_o; 14-12-09 at 04:03 PM. Reason: Changing code tags to PHP tags.
legacy code doesnt work for me
and this code says
it says internal error
i want something with number of players and stuff. all of that and not to count the admins and stuff. like not to show them in the ranks and stuff
Last edited by BaLeSsK1; 14-12-09 at 05:25 PM.
(Fixed problem on line 6, works now)PHP Code:<?php $con = mssql_connect("SQLSERVER","","");
if (!$con){die('Couldnt not connect: ' . mssql_error());}
mssql_select_db("GunzDB");
$players = mssql_query("SELECT CurrPlayer,MaxPlayer FROM ServerStatus");
$players2 = mssql_fetch_array($players);
Echo "Players online: "; echo $players2['CurrPlayer']; echo "/"; echo $players2['MaxPlayer'];
?>
This doesn't exclude admins/GMs.
Last edited by V_o_o_d_o_o; 14-12-09 at 05:41 PM.
thank you, but i need a player count char count and account count, and a ranking page..
Last edited by V_o_o_d_o_o; 14-12-09 at 08:29 PM.
i dont know why they dont work for me
$con = mssql_connect("compname\sqlexpress","USER","PASSWORD");
is that right thats how im doing it but all i see is a blank page
Dude if you want to to start a gunz server please don't do it without basic php knowledge...
$con = mssql_connect("COMPNAME\SSQLEXPRESS","","");
I had no PHP knowledge before setting up a GunZ server and website.
That's what I do :) I don't read PHP learning books all day, I just chop/edit/copy/paste what I already have, write what I already know, Google the rest. On errors, I just look at it on a web explorer, go to the line and fix it. I also have Notepad++ which is a good IDE for PHP (And others)
Like SQL queries... I had basic queries in PHP that would echo the result, all I had to do was edit the query or result output to get what I wanted. Google for syntax.
If you search for Legacy Code (I believe that is how you spell it correctly) he released a great server status script. It has different bars for the different servers and goes up and down for the amount of players. Also shows how many and the max players.
And it's pretty easy to remove/replace the images.
You don't need any knowledge of php... when i started with gunz
back in 2007 i didn't know anything and still managed do do fine.
Nice to see ppl like it. The link to the thread can be found in my signature.
Its "legacycode" without the space he he.
Last edited by LegacyCode; 15-12-09 at 05:32 PM.
what do you put here?
$database['driver'] = 'SQL Server';
Last edited by LegacyCode; 16-12-09 at 10:52 AM.
hmmm we have to make a new database for it? or r u talking about the gunzdb one?
Last edited by LegacyCode; 16-12-09 at 10:42 PM.
what we used for the gunzdb right?