Command Disabling
#9

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.
Reply


Messages In This Thread
Command Disabling - by BurnZ - 13.08.2016, 08:52
Re: Command Disabling - by WildWave - 13.08.2016, 08:59
Re: Command Disabling - by Logic_ - 13.08.2016, 09:22
Re: Command Disabling - by Shinja - 13.08.2016, 12:14
Re: Command Disabling - by BurnZ - 13.08.2016, 12:17
Re: Command Disabling - by justice96 - 13.08.2016, 12:20
Re: Command Disabling - by Shinja - 13.08.2016, 12:21
Re: Command Disabling - by SickAttack - 13.08.2016, 16:33
Re: Command Disabling - by BurnZ - 14.08.2016, 00:41

Forum Jump:


Users browsing this thread: 2 Guest(s)