Prevent a vehicle from exploding?
#9

Quote:
Originally Posted by The_Moddler
View Post
pawn Code:
public OnGameModeInit()
{
    SetTimer("OnVehicleUpdate", 1000, true);
    return 1;
}

forward OnVehicleUpdate();
public OnVehicleUpdate()
{
    for(new i = 0; i < MAX_VEHICLES; i++)
    {
        new Float: vHealth;
        GetVehicleHealth(i, vHealth);
        if(vHealth < 250)
        {
            SetVehicleHealth(i, 300.0);
        }
    }
    return 1;
}
Why would you use a timer, when you can use a native function called 'OnPlayerUpdate'
Also the only thing yours does it setting the health back to 300 and like 'Mike Garber' said. When a vehicle is on fire there is no going back. And you set it back to 300 exactly at the moment it catches fire. It WON'T work the vehicle will just explode..
Reply


Messages In This Thread
Prevent a vehicle from exploding? - by Kyle_Olsen - 11.11.2010, 12:10
Re: Prevent a vehicle from exploding? - by Celson - 11.11.2010, 12:14
Re: Prevent a vehicle from exploding? - by Kyle_Olsen - 11.11.2010, 12:18
Re: Prevent a vehicle from exploding? - by Flyfishes - 11.11.2010, 12:31
Re: Prevent a vehicle from exploding? - by Kyle_Olsen - 11.11.2010, 12:49
Re: Prevent a vehicle from exploding? - by Mike Garber - 11.11.2010, 13:31
Re: Prevent a vehicle from exploding? - by playbox12 - 11.11.2010, 14:38
Re: Prevent a vehicle from exploding? - by The_Moddler - 11.11.2010, 14:45
Re: Prevent a vehicle from exploding? - by playbox12 - 11.11.2010, 14:59
Re: Prevent a vehicle from exploding? - by The_Moddler - 11.11.2010, 15:15

Forum Jump:


Users browsing this thread: 3 Guest(s)