Progress bar bugging on vehicle update
# support-forum
i
On vehicle update, the progress bar for the fuel tank gets bigger than it should be.
Copy code
c
if(IsPlayerInVehicle(p, i) && GetPlayerState(p) == PLAYER_STATE_DRIVER)
    {
          SetPlayerProgressBarValue(p, FuelBar[p], VehFuel[i]);
      if(VehFuel[i] < 10) {
        SetPlayerProgressBarColour(p, FuelBar[p], COLOUR_REALRED);
      }
}
This is the code where the progress bar is updating in
vehicleUpdate
.

https://cdn.discordapp.com/attachments/1105555128741802114/1105555128951525436/image.png

w
Where do you set update these values?
i
I have a function
VehicleUpdate()
which is called in
OneSecTimer
(a timer that executes every 60 seconds).
f
I'm not familiar with this lib, but doesn't it have some functionality to set the min/max range? Like, if the max allowable value is 10 and you put 100 then the calculations will all be skewed and hence the resulting textdraw will be skewed