#5

Here you go
pawn Код:
//In order to display a message (eg. reason) for the player before the connection is closed you have to use a delay:
 
forward KickPublic(playerid);
public KickPublic(playerid) { Kick(playerid); }
 
stock KickWithMessage(playerid, color, message[])
{
    SendClientMessage(playerid, color, message);
    SetTimerEx("KickPublic", 1000, 0, "d", playerid);   //Delay of 1 second before kicking the player so he recieves the message
}
 
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/kickme", true) == 0)
    {
        //Kicks the player who the executed this command
        KickWithMessage(playerid, 0xFF0000FF, "You have been kicked.");
        return 1;
    }
    return 0;
}
Reply


Messages In This Thread
Kick - by Chris_Morrison - 26.06.2013, 13:25
Re: Kick - by Vin Diesel - 26.06.2013, 13:29
Re: Kick - by Chris_Morrison - 26.06.2013, 13:34
Re: Kick - by MarTaTa - 26.06.2013, 13:52
Re: Kick - by Anak - 26.06.2013, 15:05

Forum Jump:


Users browsing this thread: 2 Guest(s)