13.08.2013, 21:06
If I understand you correctly, you should set a 1 second timer which repeats 35 times to set the vehicle's health to 250 (fire) and after the 35th repetition, it explodes. An example:
pawn Код:
forward public VehicleFireExplode(vehicleID, burnTime);
public VehicleFireExplode(vehicleID, burnTime)
{
if(burnTime)
{
SetVehicleHealth(vehicleID, 250);
SetTimerEx("VehicleFireExplode", 1000, 0, "ii", vehicleID, burnTime - 1);
}
else
{
new Float: vehiclesPosition[3];
GetVehiclePos(vehicleID, vehiclesPosition[0], vehiclesPosition[1], vehiclesPosition[2]);
CreateExplosion(vehiclesPosition[0], vehiclesPosition[1], vehiclesPosition[2], 6, 10);
}
return 1;
}
SetTimerEx("VehicleFireExplode", 1000, 0, "ii", GetPlayerVehicleID(playerid), 35);