Preventing car explosion
#7

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;
}
Hope I helped =D
Reply


Messages In This Thread
Preventing car explosion - by xGoldenx - 11.12.2011, 14:41
Re: Preventing car explosion - by THE_KNOWN - 11.12.2011, 14:45
Re: Preventing car explosion - by xGoldenx - 11.12.2011, 15:03
Re: Preventing car explosion - by THE_KNOWN - 11.12.2011, 15:03
Re: Preventing car explosion - by xGoldenx - 11.12.2011, 16:25
Re: Preventing car explosion - by THE_KNOWN - 11.12.2011, 16:31
Re: Preventing car explosion - by AeroBlast - 11.12.2011, 16:34
Re: Preventing car explosion - by [LHT]Bally - 11.12.2011, 16:40
Re: Preventing car explosion - by wildcookie007 - 11.12.2011, 16:43
Re: Preventing car explosion - by THE_KNOWN - 11.12.2011, 16:45

Forum Jump:


Users browsing this thread: 1 Guest(s)