SRCDS Steam group


Simple PHP Server Query Script?
#1
Question 
I have spent most of the day looking for a simple PHP based script to query for the number of players on a server and the current map. Nothing more, nothing less...

I am not a PHP guru but I can't imagine it is that hard. Does such a thing exist?
Reply
#2
I just revamped the tutorial in the tutorials section,
take a look or search it
Join the Source Dedicated Server Support Group on Steam Community!
Source Dedicated Server (SRCDS)
Free to join, Live support! (When available)

http://forums.srcds.com/viewtopic/5114
Reply
#3
Yes, I saw that. But wasn't able to make sense of it... There are what looks like 3 different pieces to the code that is posted. Again, I am a PHP noob. So while it might be crystal clear to you, it is about as clear as muddy water to me. Sad

Biggest thing is where do you specify what server it is querying?
Reply
#4
I believe at this part:
PHP Code:
$query source_query($ip); // $ip MUST contain IP:PORT
$q format_source_query($query);

echo 
"Hostname: ".$q['hostname'];
echo 
"Map: ".$q['map'];
echo 
"Game: ".$q['game'];
echo 
"Gamemode: ".$q['gamemode']; 

replace $ip by your ip addres+port, so xxx.xxx.xxx.xxx:27015 for example
Join the Source Dedicated Server Support Group on Steam Community!
Source Dedicated Server (SRCDS)
Free to join, Live support! (When available)

http://forums.srcds.com/viewtopic/5114
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)