Kick command
#3

pawn Код:
forward @Kick(playerid);
public @Kick(playerid) return Kick(playerid);

CMD:kick(playerid, params[])
{
    if(pInfo[playerid][Admin]>0)
    {
        new str[128],reason[64],id;
        if(sscanf(params,"ds[64]",id,reason)) return SendClientMessage(playerid,COLOR_GRAY,"USAGE: /kick [playerid] [reason]");
        if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"Invalid playerid!");
        format(str,sizeof(str),"Staff member %s kicked %s for %s.",GetName(playerid),GetName2(id),reason);
        SendClientMessageToAll(COLOR_RED,str);
        printf("%s",str);
        SetTimerEx("@Kick", 1000, false, "d", id);
    }
    return 1;
}
More optimised than pds2012's solution
Reply


Messages In This Thread
Kick command - by Noles2197 - 03.02.2013, 17:09
Re: Kick command - by Patrick - 03.02.2013, 17:16
Re : Kick command - by Mathieu371 - 04.02.2013, 12:44
Re: Kick command - by SuperViper - 04.02.2013, 14:34

Forum Jump:


Users browsing this thread: 1 Guest(s)