Kick Command.
#4

do u give preference to dcmd?

here u go:

pawn Код:
//OnPlayerCommand
dcmd(kick,4,cmdtext);

//

dcmd_kick(playerid,params[])
{
    new pID, str[64];
    if(sscanf(params, "uz",pID,str))return SendClientMessage(playerid,0xFF0000FF,"Usage: /kick [ID] [Reason]");
    if (pID == INVALID_PLAYER_ID)return SendClientMessage(playerid,0xFF0000FF,"This PlayerId is invalid!");
    if (pID == playerid)return SendClientMessage(playerid,0xFF0000FF,"You can't kick yourself!");
    if(Spieler[playerid][AdminLevel] > 0) // you have to adjust this to ur own admin system
    {
        new ThePlayer[MAX_PLAYER_NAME], str2[128];
        GetPlayerName(pID,ThePlayer,sizeof(ThePlayer));
        format(str2,sizeof(str2),"%s has been kicked!(Reason: %s)",ThePlayer,str[0] ? str : "<No reason given>");
        SendClientMessageToAll(0xFF0000FF,str);
        Kick(pID);
    }
    else return SendClientMessage(playerid, 0xFF0000FF, "You are not an admin!");
    return 1;
}

regards...
Reply


Messages In This Thread
Kick Command. - by Alex_Obando - 25.02.2011, 14:10
Re: Kick Command. - by HyperZ - 25.02.2011, 14:39
Respuesta: Kick Command. - by Alex_Obando - 25.02.2011, 14:48
Re: Kick Command. - by BlackWolf120 - 25.02.2011, 15:24
Respuesta: Kick Command. - by Alex_Obando - 25.02.2011, 15:36
Re: Kick Command. - by BlackWolf120 - 25.02.2011, 15:42
Respuesta: Kick Command. - by Alex_Obando - 25.02.2011, 19:38
Re: Kick Command. - by Mean - 25.02.2011, 19:42
Re: Respuesta: Kick Command. - by admantis - 25.02.2011, 19:49
Respuesta: Kick Command. - by Alex_Obando - 25.02.2011, 20:17

Forum Jump:


Users browsing this thread: 4 Guest(s)