onPlayerPart
Description
This is called when a player disconnects from the server.
| Name | Description |
|---|---|
| player | The pointer of the player |
| reason | Reason ID for the part |
Reasons
| ID | Reason | Details |
|---|---|---|
| 0 | Timeout | The player's connection was lost. |
| 1 | Quit | The player purposefully quit, either using the /quit (/q) command or via the pause menu. |
| 2 | Kick/Ban | The player was kicked or banned by the server. |
| 3 | Crash | The player's game crashed or their network had a fault. |
Example
In this example the server will send a message when a player leaves the server
function onPlayerPart(player, reason) { switch(reason) { case 0: { Message("[#fbfd49]"+player.Name+" quit the game (timeout)."); break; } case 1: { Message("[#fbfd49]"+player.Name+" quit the game (quit)."); break; } case 2: { Message("[#fbfd49]"+player.Name+" quit the game (kicked/banned)."); break; } case 3: { Message("[#fbfd49]"+player.Name+" quit the game (crash)."); break; } } }