[Release] [ESX & Non-ESX] LegacyFuel system

when people spawn their car at the garage they get out with 0 fuel ? is this normal ?

Hi. How can I tweak how much fuel in consumed? And maybe how fast you fill up the vehicle? Iā€™d basically like to make it so that when filling it takes longer to fill up the vehicle, and also that I can drive further without needing to fill again. Thanks in advance. Super script thus far!

1 Like

could make an adaptation to vrpex

So say someone saves the vehicle on a non-esx server to their simple trainer/lambda menu, when you spawn it, it starts out at 0 Fuel.

I tryed checking the vehicle table, putting fuel to 100.0 and updating the table from inside my garage script but it change nothingā€¦
Vehicle still spawn with random amount of fuel and often with 0% this is annoying

Hey just a minor suggestion. As for the moment aircraft/helicopters (only tested the 2 types) and Iā€™m assuming other ā€œblacklistedā€ vehicles donā€™t use the fuel script. Is it possible to have the HUD portion simply stop displaying? At the moment all it does is continue displaying starting with a random fuel level to start with but simply does not decrease fuel level during flight.

1 Like

Attention advanced HUD users I took the time to edit @InZidiuZ 's LegacyFuel script to accommodate the different HUD. I will list the changes specifically below but I feel these pictures will speak for themselves.

Changelog/Edits

Changes to HUD include :

  • Removed mp/h and km/h readouts on HUD
  • Raised fuel readout text to fit above eng/LP readout text
  • At 95% and above, Fuel reads full and appears in green
  • At 30% and below, Fuel and readout appears in yellow
  • At 15% and below, Fuel and readout shows LOW and appears in red
  • At 5% and below, while engine begines to sputter. Fuel reads Empty and appears in red

Changes to Fuel consumption include :

  • At highway speeds, fuel is more efficient than city speeds or in traffic. (this is in hopes to prevent the need of frequent stops to gas stations)

Download and installation path

  • resources / LegacyFuel / client / main.lua (19.0 KB)
  • resources / esx_legacyfuel / client / main.lua (20.5 KB)

For those who have not seen that you can add Gas Station Blips :

  • Non-esx : resources / LegacyFuel / config.lua (153 Bytes)
  • ESX : resources /esx_legacyfuel / config.lua (38 Bytes)

Please note

  • These edits have only been tested in a NON-esx server, however the edits only effect fuel usage and display, not the purchasing of fuel and therefore should work on esx servers as wellā€¦ should.
  • I also would like to point out that this is by no means a ā€œre-releaseā€ of the LegacyFuel mod but simply edits made to better the resource using code already in @InZidiuZ 's LegacyFuel mod. On that note, @InZidiuZ if you like the changes, by all means, feel free to update the actual mod with these changes and to the contrary if you do not like these edits then let me know and ill take this post down :grimacing: #NoBeef

Changelog/Edits #2 (Aug 25, 16:50EST)

Changes to vehicle handling include :

  • Vehicle no longer sputters when running critically low on fuel! At around 5% fuel, level indicates ā€œEmptyā€ as previously added, shortly after displaying ā€œEmptyā€ the vehicleā€™s engine simply quits coasting to a controllable stop.

Notes : Little engine sputter may occur depending on vehicle tank size however it will die way before the sputtering becomes an annoyance. This edit was made as many people including myself donā€™t particularly enjoy the too common ā€œdriving in reverseā€ towards the end the gas tankā€™s life.

Download Update (Aug 25, 16:50EST)

Non-ESX : resources / LegacyFuel / client / main.lua (19.4 KB)
ESX : resources / esx_legacyfuel / client / main.lua (20.8 KB)

  • im not taking a vid just try it yourself LOL. But the screenshots are still there for your viewing!

Fuel2 Fuel Fuel5 Fuel3 Fuel4

12 Likes

Can you save the fuel level when you store your vehicle in the garage somehow? Letā€™s say if i fuel up to 100% and then put my vehicle in the garage and take it out it should be 100%? But now its random

3 Likes

@PeloN1 My guess is with some sort of ā€œvehicle Cacheā€ you could but that would mean the fuel resource gets added to the esx resource that saves vehicles in garages. That, to me at least, would be the only way the fuel script would know that a certain vehicle has a certain amount of fuel to it when it is ā€œpulled outā€ of the garage. At the moment what I would assume ESX does with garages is save the vehicle in itā€™s vehicle cache that way it will spawn the vehicle with all the appropriate mods to it. The fuel mod would have to be in that same resource to be able to send the amount of fuel the vehicle has to the cache.

1 Like

Okey got you. 20char

@phantomora Blips were added! redownload the original or click on the download on my reply to get blips. @dracuslayer @Piotrek_Krol @Enzoo @BlackWidow might have something you can be interested in. itā€™s not the frfuel or sxyspd fuel gauge but it simplifies the current script! look above ^^^^ @Presty1 I have an answer for what is happening with the engine sputter stby. @kimbje Check above in my latest reply with a bunch of edits, in my edits I made the fuel more efficient on highway speeds you should have beeter fuel econ.

Very nice job.

Would love then goverment (police, ambulance) could fuel for free the cars.
And to be able to use it with SexySpeedometer. BUt the problem there is the sexyspeedometer fuel max is 50.
And in this script 100.

You would know how to maybe fix it? Cause 100 liter in a normal car is unusual of course.

if you can fix engine sputter i would greatly appreciate that let me know if you fix

1 Like

You should kind of check your pull requests and issue tickets that were put in. They are there to help you with this resource.

I did actually fixed it shortly after as I personally dont like the extreme sputtering either! Essentially what it is for me now is it sputters eeeeeeevver so slightly before just shutting off. But it actually indicates empty 1% before dying. But on low you can still drive conservatively with more than enough range to drive and find a gas station! i will update my downloads in a sec on the same post and post a reply mentioning so!

I donā€™t understand how the esx stuff works but as for the fuel capacity the script uses a percentage so not actually a value of 100. Each tank is actually from what i would assume, as itā€™s what frfuel uses, a part of the handling.meta for each vehicle. One of the lines in the meta is a petroltankvalue or something along those lines and thats where I believe the tank gets its size. So the speedometer one shoooooouuuld??? Work not too sure

@Presty1 Changes added! no more driving in reverse!

I tried it with the SexySpeedometer and the Full tank is over the Full in the gauge :smiley:

And btw how to use the Can or where to get them?

@UltraTM hmmmmm then my guess is something in the SexySpeedometer needs to be changed to accommodate the extra fuel. Never did take a look at that script however was interested for a little bit

At the moment also with the esx garage we run out of fuel.

Is there a way to implement a gas can ?