OnVehicleDeath

From SA-MP Wiki

Jump to: navigation, search

OnVehicleDeath


This callback is called when a vehicle dies/explodes.


Parameters:
(vehicleid, killerid)
vehicleidThe ID of the vehicle that 'died'.
killeridThe 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.


Related Functions

The following functions might be useful, as they're related to this callback in one way or another.

Personal tools