Help with command
#10

Quote:
Originally Posted by aRoach
Посмотреть сообщение
Ok, strcmp so...
  • At the top of your script, out of any Callback:
    pawn Код:
    new bool:BlockCommands;
  • Block Command:
    pawn Код:
    if( !strcmp( cmdtext, "/blockcommands", true ) )
    {
        BlockCommands = true;
        SendClientMessage( playerid, -1, "You have blocked commands to all players." );
        SendClientMessage( playerid, -1, "Use {C0C0C0}/unblockcommands {FFFFFF}to unblock them." );

        return 1;
    }
  • Unblock Command:
    pawn Код:
    if( !strcmp( cmdtext, "/unblockcommands", true ) )
    {
        BlockCommands = false;
        SendClientMessage( playerid, -1, "You have unblocked commands to all players." );
        SendClientMessage( playerid, -1, "Use {C0C0C0}/blockcommands {FFFFFF}to block them." );

        return 1;
    }
  • Put at the top of the OnPlayerCommandText Callback:
    pawn Код:
    if( BlockCommands && !IsPlayerAdmin( playerid ) ) return SendClientMessage( playerid, -1, "You can't use commands because an Admin disabled them." );
PS: You must change IsPlayerAdmin with your Admin Variable and add to the commands too...
yes this it work's but when i disable the commands i can't unblock them to can work again it's giving me this "You can't use commands because an Admin disabled them." when i write /unblockcommands how we can fix it
Reply


Messages In This Thread
Help with command - by boyan96 - 19.02.2012, 14:15
Re: Help with command - by aRoach - 19.02.2012, 14:15
Re: Help with command - by boyan96 - 19.02.2012, 14:17
Re: Help with command - by JhnzRep - 19.02.2012, 14:24
Re: Help with command - by Littlehelper - 19.02.2012, 14:24
Re: Help with command - by aRoach - 19.02.2012, 14:25
Re: Help with command - by JhnzRep - 19.02.2012, 14:26
Re: Help with command - by boyan96 - 19.02.2012, 14:33
Re: Help with command - by Littlehelper - 19.02.2012, 14:38
Re: Help with command - by boyan96 - 21.02.2012, 07:29

Forum Jump:


Users browsing this thread: 4 Guest(s)