09.11.2012, 11:37
@Jarnu,
That will disable the commands to the admin, it needs to specify the ID.
Код:
CMD:rpw(playerid, params[]) { Restrict = 1; return 1; }
Код:
// Global variable new Allowed_To_Use[ MAX_PLAYERS ] ; public OnPlayerConnect( playerid ) { Allowed_To_Use[ playerid ] = 0; return 1; } public OnPlayerDisconnect( playerid, reason ) { Allowed_To_Use[ playerid ] = 0; return 1; } CMD:rpw( playerid, params[ ] ) { new id ; if( sscanf( params, "u", id ) ) return SendClientMessage( playerid, -1, "Syntax: /rpw [ID/Part Of Name]" ); if( !IsPlayerConnected( id ) && id == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "Invalid player ID!" ); if( Allowed_To_Use[ id ] == 1 ) return SendClientMessage( playerid, -1, "You have already disabled the weapon commands from that player!" ); Allowed_To_Use[ id ] = 1 return 1; } CMD:getm4( playerid, params[ ] ) { if( Allowed_To_Use[ playerid ] == 1 ) return SendClientMessage( playerid, -1, "Weapons commands are disabled for you!" ); // rest of your code return 1; }