Problem with /kick command
#1

Hello, I have problem with /kick command. Code:
pawn Код:
CMD:kick(playerid, params[])
    {
        if(PInfo[playerid][adminlevel] == 3) {
            new PID;
            new reason[64];
            new str[128];
            new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
            GetPlayerName(playerid, Adminname, sizeof(Adminname));            
            GetPlayerName(PID, Playername, sizeof(Playername));
            if(sscanf(params, "us", PID,reason)) return SendClientMessage(playerid, RAUDONA, "USAGE: /kick [playerid] [reason]");

            if(!IsPlayerConnected(PID))
                return SendClientMessage(playerid, RAUDONA, "Player is not connected!");
            format(str, sizeof(str), "'%s' has been kicked by administrator '%s'. Reason: %s ", Playername, Adminname, reason);
            SendClientMessageToAll(RAUDONA, str);
            Kick(PID);

        }
        else
        {
            SendClientMessage(playerid, RAUDONA, "You have to be level 3 to use that command!"); //return this message
        }
        return 1;
    }
When I tipe it it's kick player but don't show this message:
pawn Код:
format(str, sizeof(str), "'%s' has been kicked by administrator '%s'. Reason: %s ", Playername, Adminname, reason);
            SendClientMessageToAll(RAUDONA, str);
Reply
#2

https://sampwiki.blast.hk/wiki/Kick

Quote:
Important Note: As of SA-MP 0.3x, any action taken directly before Kick() (such as sending a message with SendClientMessage) will not reach the player. A timer must be used to delay the kick.

An example can be found at the bottom of the the link I posted above.
Reply
#3

Thanks
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)