Kick message
#2

Quote:

// In order to display a message (eg. reason) for the player before the connection is closed
// you have to use a timer to create a delay. This delay needs only to be a few milliseconds long,
// but this example uses a full second just to be on the safe side.

forward DelayedKick(playerid);
public DelayedKick(playerid)
{
Kick(playerid);
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/kickme", true) == 0)
{
// Kick the player who executed this command.

// First, send them a message.
SendClientMessage(playerid, 0xFF0000FF, "You have been kicked!");

// Actually kick them a second later on a timer.
SetTimerEx("DelayedKick", 1000, false, "d", playerid);
return 1;
}
return 0;
}

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


Messages In This Thread
Kick message - by Tuntun - 04.06.2014, 15:10
Re: Kick message - by rickisme - 04.06.2014, 15:16
Re: Kick message - by Stanford - 04.06.2014, 15:20
Re: Kick message - by Tuntun - 04.06.2014, 15:38
Re: Kick message - by iOxide - 04.06.2014, 15:57
Re: Kick message - by Tuntun - 04.06.2014, 17:11
Re: Kick message - by iOxide - 04.06.2014, 18:19

Forum Jump:


Users browsing this thread: 1 Guest(s)