03.09.2013, 13:05
Then change the 2 commands to:
It loops throught the online players and it sets the variable to enabled/disabled.
pawn Код:
// command to disable (an example)
CMD:disablecmd( playerid, params[ ] )
{
if( !IsPlayerAdmin( playerid ) ) return SendClientMessage( playerid, -1, "You are not admin" );
for( new i = 0; i < MAX_PLAYERS; i++ )
{
if( !IsPlayerConnected( i ) || IsPlayerNPC( i ) ) continue;
Disabled_Command[ i ] = true;
}
return 1;
}
// command to enable (an example)
CMD:enablecmd( playerid, params[ ] )
{
if( !IsPlayerAdmin( playerid ) ) return SendClientMessage( playerid, -1, "You are not admin" );
for( new i = 0; i < MAX_PLAYERS; i++ )
{
if( !IsPlayerConnected( i ) || IsPlayerNPC( i ) ) continue;
Disabled_Command[ i ] = false;
}
return 1;
}