Quote:
Originally Posted by The_Moddler
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..