Kick Problem
#1

I made a custom /kick command, but everytime i use it..it kicks me instead of the targetid. Can someone point out the problem?

pawn Code:
COMMAND:kick(playerid, params[])
{
    if(GetPlayerAdminLevel(playerid) <= 1) return SendClientMessage(playerid, COLOR_RED, "You are not authorized to use this command!");
    {
        new
            targetid,
            reason[128];
        if(sscanf(params, "us[128]", targetid, reason)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /kick (playerid | name) (reason)");
        else if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, "That player is not connected!");
        {
            new
                string[128];
            format(string, sizeof(string), "Staff Member %s has kicked %s for %s", PlayerName(playerid), PlayerName(targetid), reason);
            SendClientMessageToAll(COLOR_WHITE, string);
           
            format(string, sizeof(string), "You have been kicked from this server | Reason: %s", reason);
            SendClientMessage(targetid, COLOR_WHITE, string);

            SendClientMessage(playerid, COLOR_WHITE, "You have kicked the player successfully.");
            KickPlayer(targetid, PlayerName(playerid), reason);
        }
    }
    return 1;
}
Reply


Messages In This Thread
Kick Problem - by Abreezy - 21.08.2011, 02:47
Re: Kick Problem - by Scenario - 21.08.2011, 02:58
Re: Kick Problem - by Abreezy - 21.08.2011, 05:41
Re: Kick Problem - by grand.Theft.Otto - 21.08.2011, 05:45
Re: Kick Problem - by Scenario - 21.08.2011, 08:28
Re: Kick Problem - by Abreezy - 21.08.2011, 22:25
Re: Kick Problem - by Scenario - 22.08.2011, 00:29
Re: Kick Problem - by Abreezy - 22.08.2011, 00:47

Forum Jump:


Users browsing this thread: 1 Guest(s)