Is there a way if player is admin to disable player command ?
#5

Then change the 2 commands to:
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;
}
It loops throught the online players and it sets the variable to enabled/disabled.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)