Kicks the wrong person
#3

Quote:
Originally Posted by Toni
Посмотреть сообщение
First of all,
pawn Код:
else if(playerid == INVALID_PLAYER_ID) ..
is wrong. Player ID should be 'ID' unless for some odd reason you were checking if you were a invalid player.

pawn Код:
CMD:kick(playerid, params[])
{
    if (MasterAccount[playerid][mSuperAdmin] || Character[playerid][cAdminLevel] >= 1)
    {
        new
            id,
            n[MAX_PLAYER_NAME],
            on[MAX_PLAYER_NAME],
            string[128],
            reason[64]
        ;
        if(sscanf(params, "uz", id, reason)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "[SYNTAX]: /kick [PlayerID/PartOfName] [Reason]");
        else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED,"[ERROR]: Player not found");
        else
        {
            GetPlayerName(playerid, n, sizeof(n)); GetPlayerName(id, on, sizeof(on));
           
            format(string, sizeof(string), "You have been kicked by Admin: %s for %s", n, reason);
            SendClientMessage(playerid,COLOR_GOLD,string);            
           
            format(string, sizeof(string), "[INFO]: Admin Action: %s has kicked %s because: %s", n, on, reason);
            SendClientMessageToAll(COLOR_GOLD, string);
            Kick(id);
        }
    }
    else return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You are not a Admin");
    return 1;
}
Try that. But you didn't really have some wrong stuff...just unneeded arrays and some mistypes @ the SendClientMessageToAll format.
That worked! now however it gives a reason to a person that kicks not the person that gets kicked so it gives me the reason why someone is kicked but its suppose to be showing him?
Reply


Messages In This Thread
Kicks the wrong person - by iNorton - 24.10.2011, 20:22
Re: Kicks the wrong person - by Toni - 24.10.2011, 20:33
Re: Kicks the wrong person - by iNorton - 24.10.2011, 20:39
Re: Kicks the wrong person - by lolcake - 24.10.2011, 20:41
Re: Kicks the wrong person - by Toni - 24.10.2011, 20:46
Re: Kicks the wrong person - by iNorton - 24.10.2011, 20:54
Re: Kicks the wrong person - by Toni - 24.10.2011, 20:57
Re: Kicks the wrong person - by iNorton - 24.10.2011, 21:01
Re: Kicks the wrong person - by Toni - 24.10.2011, 21:08
Re: Kicks the wrong person - by grand.Theft.Otto - 24.10.2011, 21:14

Forum Jump:


Users browsing this thread: 2 Guest(s)