Raised This Month: $51 Target: $400
 12% 

display number of players and servers to external page?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PresidentEvil
AlliedModders Donor
Join Date: Jun 2012
Old 05-07-2014 , 15:34   display number of players and servers to external page?
Reply With Quote #1

[img]http://s23.************/rlvfh4dp7/Screen_Shot_2014_05_07_at_12_Fotor.png[/img]

anyone know the php/html code to do this?
__________________
PresidentEvil is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 05-10-2014 , 09:08   Re: display number of players and servers to external page?
Reply With Quote #2

You can use ServerQuery.php:

PHP Code:
include 'ServerQuery.php';

$query = new ServerQuery('64.94.100.204'27015);

print_r($query->getInfo());
print_r($query->getPlayers());
print_r($query->getRules()); 
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
PresidentEvil
AlliedModders Donor
Join Date: Jun 2012
Old 05-10-2014 , 22:26   Re: display number of players and servers to external page?
Reply With Quote #3

Quote:
Originally Posted by DJ Tsunami View Post
You can use ServerQuery.php:

PHP Code:
include 'ServerQuery.php';

$query = new ServerQuery('64.94.100.204'27015);

print_r($query->getInfo());
print_r($query->getPlayers());
print_r($query->getRules()); 
does that do it for only 1 server or all servers on sb?
__________________
PresidentEvil is offline
ozgaming
SourceMod Donor
Join Date: Aug 2011
Old 05-11-2014 , 07:21   Re: display number of players and servers to external page?
Reply With Quote #4

that will only pull data from 1 server according to that example
ozgaming is offline
ozgaming
SourceMod Donor
Join Date: Aug 2011
Old 05-13-2014 , 01:06   Re: display number of players and servers to external page?
Reply With Quote #5

using the above example how hard is it to just grab [numplayers] from
Code:
print_r($query->getInfo());
ozgaming is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 05-14-2014 , 02:44   Re: display number of players and servers to external page?
Reply With Quote #6

It's a PHP array, so like this:

PHP Code:
$info $query->getInfo();

echo 
$info['numplayers']; 
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
ozgaming
SourceMod Donor
Join Date: Aug 2011
Old 05-14-2014 , 18:48   Re: display number of players and servers to external page?
Reply With Quote #7

Quote:
Originally Posted by DJ Tsunami View Post
It's a PHP array, so like this:

PHP Code:
$info $query->getInfo();

echo 
$info['numplayers']; 
legend, thanks very much
ozgaming is offline
UartigZoneDK
Junior Member
Join Date: Feb 2014
Location: Denmark
Old 05-19-2014 , 13:33   Re: display number of players and servers to external page?
Reply With Quote #8

Quote:
Originally Posted by DJ Tsunami View Post
It's a PHP array, so like this:

PHP Code:
$info $query->getInfo();

echo 
$info['numplayers']; 

It does not work for me at all?
UartigZoneDK is offline
Rytis
Veteran Member
Join Date: Feb 2012
Location: Germany
Old 05-19-2014 , 16:06   Re: display number of players and servers to external page?
Reply With Quote #9

Quote:
Originally Posted by UartigZoneDK View Post
It does not work for me at all?
Could you post your complete PHP code? :-)
Rytis is offline
UartigZoneDK
Junior Member
Join Date: Feb 2014
Location: Denmark
Old 05-20-2014 , 16:48   Re: display number of players and servers to external page?
Reply With Quote #10

Quote:
Originally Posted by Rytis View Post
Could you post your complete PHP code? :-)
I use this click here or
https://github.com/GameConnect/Sourc...erverQuery.php

And my php code are only

include 'ServerQuery.php';

$query = new ServerQuery('89.233.23.136', 27021);

print_r($query->getInfo());
print_r($query->getPlayers());
print_r($query->getRules());
UartigZoneDK is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:03.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode