Convert strtok and strcmp to sscanf and zcmd
#2

Try this:

I know that I've done a mistake, I can't see it though.

pawn Код:
COMMAND:kick(playerid, params[])
    {
        if(PlayerInfo[playerid][pAdminLevel] >= 1)
        {
               new pid = playerid, reason[128], id = strval(tmp);
            if(sscanf(params, "us[128]", player, reason)) return SendClientMessage(playerid,COLOR_LIGHTRED,"USAGE: /kick [id] [reason]");
            if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_GRAY,"AdmCmd This player is not online!");
            PlayHintSoundAtPos(playerid);
            new globalmsg[100];
            new adminid[MAX_PLAYERS], victimid[MAX_PLAYERS];
            GetPlayerName(pid, adminid, sizeof(victimid));
            GetPlayerName(id, victimid, sizeof(victimid));
            format(globalmsg,sizeof(globalmsg),"AdmWarn: Administrator %s has kicked player %s [%s]",adminid,victimid,reason);
            SendClientMessageToAll(COLOR_LIGHTBLUE,globalmsg);
            Kick(id);
        }
        else SendClientMessage(playerid,COLOR_GRAY,"You don't have authorization.");
            return 1;
    }
Reply


Messages In This Thread
Convert strtok and strcmp to sscanf and zcmd - by admantis - 21.01.2011, 02:12
Re: Convert strtok and strcmp to sscanf and zcmd - by PeteShag - 21.01.2011, 03:15
Respuesta: Convert strtok and strcmp to sscanf and zcmd - by ipsBruno - 21.01.2011, 03:19
Re: Convert strtok and strcmp to sscanf and zcmd - by PeteShag - 21.01.2011, 03:23
Re: Convert strtok and strcmp to sscanf and zcmd - by Marty_Alex - 21.01.2011, 04:39
Re: Convert strtok and strcmp to sscanf and zcmd - by HyperZ - 21.01.2011, 04:39

Forum Jump:


Users browsing this thread: 2 Guest(s)