Custom Fuel System
If we don't support your fuel system out of the box, it's super easy to add your own!
Go to the
framework
folder, and opencl-functions.lua
Find the
VehicleGetFuel
andVehicleSetFuel
functions, which should look like this:
Inside the
VehicleGetFuel
function, within theelse
block where it saysreturn 65 -- or set up custom fuel system here...
replacing it with your custom get fuel level code. Remember to rename the vehicle entity variable tovehicle
in case your code snippet has it named differently.Do the same inside the
VehicleSetFuel
function replacing the line that says-- Setup custom fuel system here
with the set fuel level function of your fuel script. The vehicle entity variable is namedvehicle
and the fuel level is namedfuel
- again make sure to rename these if they are named differently in the snippet you are using!Make sure that in the Configurator or
config.lua
you have set the Fuel system to None.
Last updated