20.08.2010, 20:06
(
Последний раз редактировалось Cameltoe; 20.08.2010 в 21:00.
)
How would i make a vehicle keep the flames for a amount of time?
so far i got this:
This will only work for a small amount of time..
so far i got this:
pawn Код:
public CheckCarHealth(vehicleid, playerid)
{
new Float:CarHealth;
GetVehicleHealth(vehicleid,CarHealth);
if(CarHealth <= 249.9)
{
new Float:vPOS[3];
KillTimer(CarHealthTimer[vehicleid]);
GetVehiclePos(vehicleid, vPOS[0], vPOS[1], vPOS[2]);
RemovePlayerFromVehicle(playerid);
SetVehiclePos(vehicleid, vPOS[0], vPOS[1], vPOS[2]);
SendClientMessage(playerid, COLOR_YELLOW, "( ! ) This car is under fire!");
new RandExplode = rand(18, 32), string[128];
format(string, sizeof(string),"( ! ) The fire brigade should be on it's way .. this car will explode in about: %d seconds",RandExplode*10);
SendClientMessage(playerid, COLOR_YELLOW, string);
SetVehicleHealth(vehicleid, 500);
SetTimerEx("KeepFire",100,true,"i",vehicleid);
SetTimerEx("RandExplodeCar",RandExplode*10000,false,"i",vehicleid);
printf("Health below 250: %f- Carid: %d - Playerid: %d",CarHealth,vehicleid,playerid);
}
}
forward KeepFire(vehicleid);
public KeepFire(vehicleid)
{
SetVehicleHealth(vehicleid, 249);
print("Sat vehicle health");
}
public RandExplodeCar(vehicleid)
{
SetVehicleHealth(vehicleid, 249);
printf("Exploding the car!");
}