Quote:
Originally Posted by SickAttack
pawn Код:
#include <sscanf2> #include <zcmd>
new bool:pCMDsDisabled[MAX_PLAYERS] = false;
public OnPlayerCommandReceived(playerid, cmdtext[]) { if(pCMDsDisabled[playerid]) { SendClientMessage(playerid, -1, "You aren't allowed to use any commands."); return 0; } return 1; }
CMD:ripcmd(playerid, params[]) { new lookupid; if(sscanf(params, "u", lookupid)) { SendClientMessage(playerid, -1, "Usage: /ripcmd (id/name)"); } else if(!IsPlayerConnected(lookupid)) { SendClientMessage(playerid, -1, "Player isn't connected."); } else { pCMDsDisabled[lookupid] = ((pCMDsDisabled[lookupid]) ? (false) : (true)); } return 1; }
If you're going to use it on a CNRSF server, please don't. The abuse is already so real there.
|
Just wanted to learn as I have always tried to disable cmds while failing.