Prevent Car Explosion
#1

Код:
forward OnVehicleDamageStatusUpdate(vehicleid,playerid);
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
    new Float:f_vHealth;
    GetVehicleHealth(vehicleid, f_vHealth);
    if(f_vHealth < 500.0)
    {
        new engine, lights, alarm, doors, bonnet, boot, objective;
        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
        SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
        GameTextForPlayer(playerid,"~r~Engine-Stalled",6000,6);
	}
	else
	{
		GetVehicleHealth(vehicleid, f_vHealth);
	 	if(f_vHealth < 400.0)
     	        SetVehicleHealth(vehicleid, 400);

	}
    return 1;
}
My problem is that the most times the car explodes. I mean the engine doesn't stall sometimes when its health is under 500 with the result of car explosion. For example if my vehicle gets damage with a gun the engine doesn't turn off and it catches fire... Any solution ?
Reply


Messages In This Thread
Prevent Car Explosion - by RotAway - 03.08.2015, 15:26
Respuesta: Prevent Car Explosion - by RIDE2DAY - 03.08.2015, 15:41
Re: Respuesta: Prevent Car Explosion - by RotAway - 03.08.2015, 15:59

Forum Jump:


Users browsing this thread: 2 Guest(s)