OnVehicleDamageStatusUpdate

OnVehicleDamageStatusUpdate

Description:
Callback OnVehicleDamageStatusUpdate is called when a vehicle element such as doors, tires, panels, or lights change their damage status.
Callback OnVehicleDamageStatusUpdate was added in 0.3a and will not work in earlier versions!
This does not include vehicle health changes
For some useful functions for working with vehicle damage values, see here.


Parameters:
(vehicleid, playerid)
int vehicleid The ID of the vehicle that was changed its damage status.
int playerid The ID of the player who synced the change in the damage status (who had the car damaged or repaired).


Return Values:
  • 1 - Will prevent other filterscripts from receiving this callback.
  • 0 - Indicates that this callback will be passed to the next filterscript.
  • It is always called first in filterscripts.


Examples:
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{	
    // Get the damage status of all the components
    new panels, doors, lights, tires;	
    GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
 
    // Set the tires to 0, which means none are popped
    tires = 0;
 
    // Update the vehicle's damage status with unpopped tires
    UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
    return 1;	
}


Related Functions
The following functions may be useful, as they are related to this function in one way or another.