10.03.2017, 09:45
You could do that, or you could compress all of that in a callback
https://sampwiki.blast.hk/wiki/OnVehicleDamageStatusUpdate
With your actual variables, add a check if the player should get their vehicle repaired, and add RepairVehicle(GetPlayerVehicleID(playerid)); under OnVehicleDamageStatusUpdate, although it wont work if the vehicle gets shot, but it will if the player crashes against something.
https://sampwiki.blast.hk/wiki/OnVehicleDamageStatusUpdate
With your actual variables, add a check if the player should get their vehicle repaired, and add RepairVehicle(GetPlayerVehicleID(playerid)); under OnVehicleDamageStatusUpdate, although it wont work if the vehicle gets shot, but it will if the player crashes against something.