Admin restrict a command
#10

Here you are a working command:
pawn Код:
CMD:kick(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
        new str[128], reason[64], targetid;
        if(sscanf(params,"us", targetid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [Player ID] [Reason]");
        {
            if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, "SERVER: Player not connected");

            SendClientMessageToAll(COLOR_RED, str);
            Kick(targetid);
        }
    }
    else SendClientMessage(playerid, COLOR_RED, "You do not have access to this command!");
    return 1;
}
NOTE: Make sure that you have sscanf and zcmd includes.
Define this on top of your script:
pawn Код:
#define C_WHITE     0xFFFFFFFF
#define COLOR_RED  0xFF0000FF
Reply


Messages In This Thread
Admin restrict a command - by Fadel - 27.05.2013, 10:48
Re: Admin restrict a command - by mahdi499 - 27.05.2013, 10:53
Re: Admin restrict a command - by Fadel - 27.05.2013, 11:38
Re: Admin restrict a command - by Kurzalewski - 27.05.2013, 12:01
Re: Admin restrict a command - by Fadel - 27.05.2013, 12:37
Re: Admin restrict a command - by Smokkr - 27.05.2013, 12:40
Re: Admin restrict a command - by Fadel - 27.05.2013, 13:39
Re: Admin restrict a command - by Smokkr - 27.05.2013, 13:43
Re: Admin restrict a command - by Fadel - 27.05.2013, 13:57
Re: Admin restrict a command - by Smokkr - 27.05.2013, 14:04

Forum Jump:


Users browsing this thread: 1 Guest(s)