Closed StuxxyOfficial closed 2 years ago
The getfuel exports are kind of weird, and sending server event to set fuel when client statebag is replicated anyway.
Check fuel state when entering car, if nil then initialise on server (there’s a bug that will prevent unit from client). Fuel should always be checked with statebag and not some abstraction via export.
set fuel event was mainly just there for people who couldn't quite grasp how to use statebags properly lol... we can change it so it doesn't send the server event at all to init the fuel, i just thought that was a better option is all and yeah again exports were just there to be a bit more user-friendly, also been using this setup for about a week on live server with no issues.
I’d like to see people learn how to use statebags rather than hide it behind an export that doesn’t even save them time.
syncs fuel across clients use following export wherever you need to get fuel level of a vehicle - exports['ox_fuel']:GetFuel(currentVehicle)