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


#63

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


#64

I made this little modification in esx_legacyfuel to work in vrp


#65

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!


#66

could make an adaptation to vrpex


#67

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.


#68

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


#69

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.


#70

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


#71

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


#72

@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.


#73

Okey got you. 20char


#74

this is a grate script good work


#75

@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.


#76

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.


#77

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


#78

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


#79

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!


#80

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


#83

@Presty1 Changes added! no more driving in reverse!


#84

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?