27.03.2011, 02:24
Hi! I'm working on a vehicle system and I'm trying to make it to where when the vehicle explodes, it doesn't respawn. Thanks for any help.
public OnPlayerUpdate(playerid)
{
new Float:health;
for(new i=0; i<MAX_VEHICLES; i++)
{
GetVehicleHealth(i, health);
if(health < 1) DestroyVehicle(i);
}
}
forward DestroyDeadVehicles();
public OnGameModeInit()
{
SetTimer("DestroyDeadVehicles", 2000, true);
}
public DestroyDeadVehicles()
{
new Float:health;
for(new i=0; i<MAX_VEHICLES; i++)
{
GetVehicleHealth(i, health);
if(health <= 1) DestroyVehicle(i);
}
return 1;
}
forward DestroyDeadVehicles();
public OnGameModeInit()
{
SetTimer("DestroyDeadVehicles", 2000, true);
}
public DestroyDeadVehicles()
{
new Float:health;
for(new i=0; i<MAX_VEHICLES; i++)
{
GetVehicleHealth(i, health);
if(health <= 251) DestroyVehicle(i);
}
return 1;
}