13.08.2016, 16:33
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;
}