19.02.2012, 14:25
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." );