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

Fuel script that cover all vehicles, fuel, electric, air, sea

Video : Qb Fuel by Sna - YouTube
Package : GitHub - Sna-aaa/qb-sna-fuel: Fuel script that cover all vehicles, fuel, electric, air, sea

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

Testing out on my server, great so far! Great script thanks for making free!

Thanks a lot for your support :wink:

Loving the way it works! However, for some reason my hud messes up. Im not sure why. Using qb-hud.

What is your problem with the hud exactly?

great job thanks for amazing work

Does this work along side leagacy fuel or is it a replacement

It’s a replacement! Works well, but there is some changes which have to be made. But for a free release, it’s a really good resource and big ups to this guy!

Yes it is a replacement
Thanks a lot for the support guys
What are the modifications you made? Maybe i can make it even better :wink:

Hi, when I use the pump with third eye, works perfetly. But then when I push E to take the hose from the car, it also picks up a hose from the pump. Then I have 2 hoses. Can we remove the E key on the pump?

There is no E key on the pump at all…

Really? Then why on line 292 of the main.lua does it have this?

CreateThread(function() -- Check key presses
    while true do
        local sleep = 1000
        if CurrentPump then
            sleep = 0
            if IsControlPressed(0, Config.ActionKey) and CurrentCapPos then
                local playerPed = PlayerPedId()
                if #(GetEntityCoords(playerPed) - CurrentCapPos) < 3.0 then -- Mount/Dismount pump

It says Mount/Dismount Pump with key press.

Also, in config it has:

Config.ActionKey = 38 -- Key binds can be found here https://docs.fivem.net/docs/game-references/controls/

38 being the E key.

Am I able to add my own Fuel Locations and make price free for Police? Say like If I had fuel pumps at PaletoPD, make them only useable for the Police Job and make it free?

You can already add your fuel locations, just add pumps in your map and it will be functional
Unfortunately, the control of the pumps need a new layer of coding to control the job or even the vehicle model
This is on the roadmap for this resource like pumps for boats or air vehicles, fuel stocks and job control

Ok perfect! Also, the Fuel HUD doesn’t work, like the resource works, but it doesn’t display the fuel thats in the vehicle. Also, how do I go about refuelling a helicopter?

I have been using this Fuel script for months and absolutely love it, only issue I’ve had, the fuel level in the vehicle doesn’t work. I checked the database entry from the sql and all the vehicles in my server say 0 in that table. Not sure if the script is writing to the db correctly. Any ideas? Like I said, love it, will use it still regardless, just not sure if I can get the fuel levels to record correctly

1 Like

Finally a fuel script that doesn’t brake the car when it runs out of fuel and configure fuel consumption based on vehicle model instead of class. Great Job!

I have a question, is there anyway to configure the time it takes to refuel or recharge the car? I know there is time to charge EV when its in the garege, but how about the time when it charging or refueling at a station? I just feels like the refueling and charging process is way too fast.

edit: I found where it is, original line at 228

while IsFueling or CurrentCost ~= 0 do
Wait(500) – Waiting time during fueling
local currentFuel = DecorGetFloat(vehicle, Config.FuelDecor)
local fuelToAdd

I change that to 2500, now i’m trying to figure out adding another charging station model. i put the correct hash in config but somehow qb-target doesn’t recognize any of it. probbaly x-y-z problem?

what model are you trying to use?

i’ve tried using ItzNikosTesla and ItzNikosCoil mod but it doesn’t seems to get detected by qb-target in the first place …

maybe i need to add this model into somewhere in qb-target first since its an addon models not replace models.

you need to edit the props to be dynamic instead of static in codewalker. so when you go into your server if you have an entity lazer like with qb-admin menu you should be able to view the prop hash in game after you change it to dynamic. if you cant view the hash in game it will not work i use nikoz new chargers and some paid chargers.