Quote:
Originally Posted by aRoach
Ok, strcmp so... - At the top of your script, out of any Callback:
- 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