help with /kick and /ban
#5

If you download sscanf plugin by ******, you can do this which is a lot easier:

pawn Код:
CMD:kick(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, "Admins only.");
    new targetid;
    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Syntax: /kick [playerid/name]");
    Kick(targetid);
    return 1;
}
And here's a proper kick command that you might like too, made this in the 240 seconds of waiting between posts .

pawn Код:
CMD:kick(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, "Admins only.");
    new targetid, reason[50];
    if(sscanf(params, "us[50]", targetid, reason)) return SendClientMessage(playerid, -1, "Syntax: /kick [playerid/name] [reason]");
    if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Error: Player not connected.");
    new string[100], sendername[MAX_PLAYER_NAME], receivername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    GetPlayerName(targetid, receivername, sizeof(receivername));
    format(string, sizeof(string), "%s has been kicked by %s, reason: %s", receivername, sendername, reason);
    SendClientMessageToAll(COLOR_WHITE, string);
    return 1;
}
Reply


Messages In This Thread
help with /kick and /ban - by NaziHotdog - 19.10.2013, 17:50
Re: help with /kick and /ban - by Akira297 - 19.10.2013, 17:56
Re: help with /kick and /ban - by DanishHaq - 19.10.2013, 17:59
Re: help with /kick and /ban - by NaziHotdog - 19.10.2013, 18:06
Re: help with /kick and /ban - by DanishHaq - 19.10.2013, 18:11
Re: help with /kick and /ban - by NaziHotdog - 19.10.2013, 18:32
Re: help with /kick and /ban - by DanishHaq - 19.10.2013, 19:17
Re: help with /kick and /ban - by SilentSoul - 19.10.2013, 19:19
Re: help with /kick and /ban - by NaziHotdog - 19.10.2013, 19:37

Forum Jump:


Users browsing this thread: 1 Guest(s)