 |
|
AMX Mod X Moderator
|

10-20-2009
, 17:06
Re: RCON
|
#3
|
I'm not sure which form you mean, but there are two ways depending on which rcon admin you're looking for:
- AMXX RCon
PHP Code:
// True if the user is an rcon admin. get_user_flags( id ) & ADMIN_RCON
- HLDS RCon - Untested, uncompiled, but should work. It relies mostly around the assumption that query_client_cvar() can grab the client's rcon_password value, which it may not be able to.
PHP Code:
new pRconPassword
// ...
pRconPassword = register_cvar( "rcon_password", "" )
// ...
asyncronousIsRconAdmin( id ) { query_client_cvar( id, "rcon_password", "asyncronousIsRconAdminHandle" )
// No return to make it clear that this does not itself check anything. }
public asyncronousIsRconAdminHandle( id, const cvar[], const value[] ) { if ( !value[0] ) return
new rconPassword[33] get_pcvar_string( pRconPassword, rconPassword, 32 )
if ( equal( rconPassword, value ) ) { // User has rcon admin. } }
__________________
|
|
|
|