ibab
Member
I need to modify the user upgrade code to run a PHP code upon upgrade, which is different depending on selected upgrade.
Something like this.
Is this possible somehow?
Something like this.
Code:
try{
$Rcon = new MinecraftRcon;
$Rcon->Connect( MR_SERVER_ADDR, MR_SERVER_PORT, MR_SERVER_PASS, MR_TIMEOUT );
//Add to the group
if($upgrade == 'Diamond Member') {
$data = $Rcon->Command( "pex user $username group set Diamond" );
}
if( $data == false) {
echo "false";
throw new MinecraftRconException( "Failed to get command result." );
} else if( StrLen( $data ) == 0 ) {
echo "false";
throw new MinecraftRconException( "Got command result, but it's empty." );
} else {
echo $data;
}
} catch( MinecraftRconException $e ) {
echo $e->getMessage( );
echo "false";
}
Is this possible somehow?