Jump to content

gameQ (get players online PHP)


trux_yt

Recommended Posts

You can just take the example from their GitHub page, the only thing that you need to know is to set query port ASE, you do that by adding 123 to server port, default server port is 22003, then query port will be 22126.

 

$GameQ = new \GameQ\GameQ();
$GameQ->addServer([
    'type' => 'mta',
    'host' => '51.83.184.65:22003',
    'options' => [
        'query_port' =>  22126, // SERVER PORT + 123 !IMPORTANT
    ],
]);
$results = $GameQ->process();

//print_r($results); // will return all data recieved thru query
print_r($results["51.83.184.65:22003"]["gq_numplayers"]); // will return only "gq_numplayers" which is player count, uncomment line above to see more stuff u can put here

 

Feel free to ping me if you need any help

Edited by gubi
Link to comment
4 hours ago, gubi said:

You can just take the example from their GitHub page, the only thing that you need to know is to set query port ASE, you do that by adding 123 to server port, default server port is 22003, then query port will be 22126.

 

$GameQ = new \GameQ\GameQ();
$GameQ->addServer([
    'type' => 'mta',
    'host' => '51.83.184.65:22003',
    'options' => [
        'query_port' =>  22126, // SERVER PORT + 123 !IMPORTANT
    ],
]);
$results = $GameQ->process();

//print_r($results); // will return all data recieved thru query
print_r($results["51.83.184.65:22003"]["gq_numplayers"]); // will return only "gq_numplayers" which is player count, uncomment line above to see more stuff u can put here

 

Feel free to ping me if you need any help

i have this error in the php and i have the folder from GameQ in the directory

Fatal error: Uncaught Error: Class 'GameQ\GameQ' not found in C:\xampp\htdocs\asd.php:2 Stack trace: #0 {main} thrown in C:\xampp\htdocs\asd.php on line 2

 

Edited by trux_yt
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...