OnVehicleDeath
Description:
Callback OnVehicleDeath is called when a vehicle is destroyed - either by exploding or becoming submerged in water.
|
Parameters:
(vehicleid, killerid)
int | vehicleid | The ID of the vehicle that was destroyed. |
int | killerid | The ID of the player that reported (synced) the vehicle's destruction (name is misleading). Generally the driver or a passenger (if any) or the closest player. |
Return Values:
This callback does not handle returns.
- It is always called first in filterscripts.
Examples:
public OnVehicleDeath(vehicleid, killerid) { new string[64]; format(string, sizeof(string), "Vehicle %i was destroyed. Reported by player %i.", vehicleid, killerid); SendClientMessageToAll(0xFFFFFFFF, string); return 1; }
Related Callbacks
The following callbacks might be useful as well, as they are related to this callback in one way or another.
- OnVehicleSpawn: Called when a vehicle respawns.
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- SetVehicleHealth: Set the health of a vehicle.