Hey guys, im trying to set up a page on my website that will show things like if the server is online, and how many people are on and potentially who is on. I can use [URL="https://github.com/xPaw/PHP-Source-Query-Class"]this[/URL] class to do a quick query of the server, but the players are shown as hidden. I tried to use the built in rcon function for it but it doesnt work. The rest of the query code works, but the rcon part doesnt. Anyone had any experience with this? heres my code:
[CODE]<?php
require __DIR__ . '/SourceQuery/SourceQuery.class.php';
// For the sake of this example
Header( 'Content-Type: text/plain' );
// Edit this ->
define( 'SQ_SERVER_ADDR', 'myIp' );
define( 'SQ_SERVER_PORT', myport );
define( 'SQ_TIMEOUT', 1 );
define( 'SQ_ENGINE', SourceQuery :: SOURCE );
// Edit this <-
//SetRconPassword('rconSucks107');
$Query = new SourceQuery( );
$Query->SetRconPassword( "myRconPassword" );
try
{
$Query->Connect( SQ_SERVER_ADDR, SQ_SERVER_PORT, SQ_TIMEOUT, SQ_ENGINE );
print_r( $Query->GetInfo( ) );
$Query->Rcon('airdrop.drop');
}
catch( Exception $e )
{
echo $e->getMessage( );
}
$Query->Disconnect( );
?>[/CODE]
Thanks in advanced!
anyone have any ideas?
You HAVE to be logged in as admin to see any player info unfortunately. It can't be done publicly.
It can be done through Rcon using Status. I just did it from my GSPs online rcon tool. The problem im having is that I cant use the code to execute ANY rcon commands.
Sorry, you need to Log In to post a reply to this thread.