OnVehicleDeath
From SA-MP Wiki
OnVehicleDeath
This callback is called when a vehicle dies/explodes.
(vehicleid, killerid)
| vehicleid | The ID of the vehicle that 'died'. |
| killerid | The ID of the player that caused the vehicle to 'die'. |
This function does not return a specific value.
Note: This callback will also be called when a vehicle enters water
public OnVehicleDeath(vehicleid, killerid) { new string[40]; if(killerid == INVALID_PLAYER_ID) format(string, sizeof(string), "Vehicle %i was destroyed.", vehicleid); else format(string, sizeof(string), "Vehicle %i was destroyed by ID %i", vehicleid, killerid); SendClientMessageToAll(0xFFFFFFFF, string); return 1; }
Related Callbacks
The following callbacks might be useful as well, as they're related to this callback in one way or another.
- OnVehicleSpawn: Called when a vehicle spawns.
Related Functions
The following functions might be useful, as they're related to this callback in one way or another.
- SetVehicleHealth: Set the health of a vehicle.
