As I’m not an expert in ESX and as i don’t have a much scripted ESX test server, please test it and review eventual problems, thanks. This is just a port of my qb-sna-fuel
Features
Pumps with nozzle for electric or fuel
Gas pump for fuel vehicles
Electric chargers for electric vehicles
Out of energies are handled by the script, the vehicle just stop his motor, no more sparks and backwards
Every vehicles excepted blacklisted ones will stop when out of energy
Electric cars have a specific consumption model (with nothing at idle)
Electric cars have a charge curve (quickly until 80% then more and more slowly)
Electric cars have a discharge curve (slowly until 40% then more and more quickly)
Consumption can be specified for each vehicle separately
Tank sizes can be specified for each vehicle separately
Energy is specified in L or Kw, and price can be configured
Automatic charging of electric vehicles in garages
Admin command /fuel to refuel/charge vehicles
Working jerrican for fuel vehicles
Jerrican capacity is configurable
A new export “ApplyFuel” to apply fuel without electric charge for persistence scripts
Awsome job Snaaa ! Is it possible to make the hose not to clip trought the ground ? or ot adjust it based on your distance from the pump ? That would be awsome !
You can change the default rope length in the config, with 2m instead of 5 it must stay over the ground
I don’t think this clipping can be avoided, feel free to pr if you have a solution to let it on the ground
You can use another target resource, i think without even changing anything
You can also change the target by an old proximity check like in legacyfuel, but this will make the ms higher
To keep the resource low in ms you really need a targeting resource
Hello
I have a question about this, I can buy Jerrican, but how do I fill the vehicle?
the hud that we have to add to make the gasoline level work?
used this and now?
local fuel = GetVehicleFuelLevel(veh)
First, i corrected the jerrican part, as it was not working out of the box. Now you can buy a jerrican, select it as weapon and you will see the [E] Mount option on your car
About the fuel level, you can’t use GetVehicleFuelLevel anymore as i don’t use the default fuel level, you need to use the exports like this
local fuel = exports[‘esx-sna-fuel’]:GetFuel(veh)
Warning, for exports, the directory name is important, so replace esx-sna-fuel by your directory name for my resource
Without more information, i suposed you didn’t received the jerrican, so i added an option in the config to add it as item or weapon, it must correct the things for ox_inventory
Ok it seems there is a problem with the ammo of the jerrican. I will correct that once i can reproduce the problem, but atm i have no ox_inventory installed
sadly ox target ask for ox lib, wich ask for onesync
and qb target ask for qb core, a bit anoying when using esx
then bt target dont work, the consol give “missing AddTargetModel in bt target”
could you please add the old proximity detection option ? or help to convert your script ?