10.03.2017, 10:55
Код:
if(!Autorepair[i]) { return 0; }
Replace "return 0" with "continue", this will jump to the next ID if AutoRepair is disabled for a player.
If you set the timer correctly, it should then work as expected.
Troydere's solution is still better, since it will not require a timer. You can also use OnPlayerWeaponShot to restore any health that a vehicle lost by shooting.
PS: You can use GetPlayerVehicleID to determine if a player is in any vehicle (will return 0 if player is not in a vehicle), also RepairVehicle also restores the health, no need to set it seperately.