[Free] ESX Fuel by Sna with fuel nozzles and electric charging

Fuel script that cover all vehicles, fuel, electric, air, sea with fuel nozzles and electric charging

Video : Qb/ESX Fuel by Sna with fuel nozzles and electric charging - YouTube
Package : GitHub - Sna-aaa/esx-sna-fuel: Fuel script that cover all vehicles, fuel, electric, air, sea

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
  • Server synced nozzles and hozes

Requirements

9 Likes

Awesome job dude, i will test it right now in esx

one doubt…
as requirements you put ox_target
but dont you mean qb-target? or you forget remove this code on pic?

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 !

This code works for ox_target and also for qb-target, so don’t remove it you will have problems
It is just the compatibility mode of ox_target

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

1 Like

I see i was Just wonder that’s why I ask

is there a way to use it without ox-target, because my server uses 1.2 and ox only supports the latest version

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 already have bt-target and I would like to know if it is possible and easy to replace it with your script ?

I think it is only a change to do to replace qb-target by bt-target, normally the use must be the same

Will you make a version without target?

It is not planned at the moment, i prefer to have low ms and optimized resource :slight_smile:

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 :slight_smile:

for ox_inventory not work

1 Like

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

now I have the jerrican in hand, but no [E] Mount option

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

1 Like

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 ?