11.12.2011, 16:34
pawn Code:
public OnVehicleDamageStatusUpdate(vehicleid, playerid) //Get called every time a vehicle health changes (I think)
{
new Float:health; //Creating a variable for the car's health
GetVehicleHealth(vehicleid,health); //Storing the actual health of the vehicle in the variable
if(health < 400.0) //Checkin if the health is lower than 400.0 (1000.0 is the max, somewhere around 400.0, it catches fire)
{
new engine, lights, alarm, doors, bonnet, boot, objective; //Creating variable's for the vehicle's parameters (doors, bonnet, engine, etc)
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); //Getting the vehicle's parameters)
SetVehicleParamsEx(vehicleid, 0, 0, 0, doors, bonnet, boot, objective); //Turning off the engine
return 1;
}
return 1;
}