04.06.2014, 15:16
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; } |