onPlayerSpawn
Description
This is called when a player dies. e.g.: drowned or self-kill.
| Name | Description |
|---|---|
| player | The pointer of the player |
| reason | Death reason |
Death Reasons
List of weapon IDs
| ID | Details |
|---|---|
| 39 | Death from dying in a car |
| 41 | Death from an explosion |
| 43 | Death from drowning |
| 44 | Death from falling |
| 70 | Suicide |
Example
Send message to all when player death due to suicide
function onPlayerDeath(player, reason) { switch(reason) { case 70: { Message("*** " + player.Name + " suicide."); break; } }}