Prevent Car Explosion
#2

You must keep in mind that the SA-MP Wiki says "this does not include vehicle health changes" in OnVehicleDamageStatusUpdate, so... I guess you know you're able to put a car on fire (decrease its health) shooting it without damaging any of its components (panels, doors, lights, tires).

Anyway, you might use a global timer to check all vehicles' health.

EDIT #1: global timer.
PHP код:
public OnGameModeInit()
{
    
SetTimer("CheckVehHealth"1000true);
    return 
1;
}
forward CheckVehHealth();
public 
CheckVehHealth()
{
    new 
Float:g_VehHealth;
    for(new 
1GetVehiclePoolSize(); <= tx++)
    {
        if(!
GetVehicleModel(x)) continue;
        
        
GetVehicleHealth(xg_VehHealth);
        
        if(
g_VehHealth 250.0)
        {
            
SetVehicleHealth(x250.0);
            
/* Check vehicle's health status here: https://sampwiki.blast.hk/wiki/VehicleHealth */
        
}
    }
    return 
1;

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: 1 Guest(s)