This is a simple fuel system for all on-ground vehicles designed to be as unobtrusive as possible.
- Fuel level synchronized between players vehicles
- Vehicle’s dashboard shows actual fuel level
- Randomized fuel level for NPC’s vehicles
- RPM based fuel consumption
- Vehicle max torque and acceleration has impact on overall fuel consumtion rate
- Original fuel tank capacity for every vehicle, taken from handling
- All gas stations that is in game are available
- External API
- Configurable both fuel consumption rate and refueling rate, so you can fine-tune it exactly for your needs
ziparchive from latest release and unzip it to your resources folder.
start frfuelline to your
- If you encounter a crash stating something like “Increase pool size” then server with FRFuel is using some broken resource that is using entity decorators excessively. We can’t help spotting it. If you’re using manual transmission mode by ikt, consider updating it to the latest version to address this issue.
- Extend fuel system to planes and boats
<- (toggle: bool)
FRFuel listens for it.
Allows you to toggle on/off if player can refuel it’s vehicle.
-> (amount: float)
Both client and server event.
FRFuel triggers it.
Allows you to get know how much fuel player just added to his vehicle.
Units for amount value could be considered as litres. Typical petrol tank volume is 65 litres in GTA.
v1.2.0 there’s an external API available for resources to work with this one:
All of the API methods only working for player’s current vehicle ONLY if player is on the driver seat
Returns player’s current vehicle’s fuel level. Returns
-1 if player is not in vehicle or is not on the driver seat.
addFuel(amount: float): void
amount of fuel to the player’s current vehicle. Does nothing if player is not in any.
setFuel(amount: float): void
amount of fuel level of the player’s current vehicle. Does nothing if player is not in any.
--- getting level local fuelLevel = exports.frfuel:getCurrentFuelLevel() --- adding more fuel exports.frfuel:addFuel(42.5) --- setting fuel level exports.frfuel:setFuel(65)
v1.7.0 - Some new features and fixes.
- Change/fix the fuel bar position and size for when the expanded radar is active.
- Add fuelbar color options to the config.ini, example of custom color:
Example of custom warning fuel level color:
- CFX API packages have been updated to the new NuGet packages.
(Update by Vespura, if you have any issues ask him first)
- (New) Add
ShowHudWhenEngineOff=true), if you set this to false then the fuel level bar will not be shown if you turn your engine off and you’re not near any gas stations.
- (Fix) Disable the vehicle horn when you are able to press the ‘toggle engine’ button near a gas station. The
INPUT_VEH_ROCKET_BOOSTcontrol is also disabled, so you won’t launch your oppressor into the pumps anymore when refueling. These controls will not be disabled if you changed the engine toggle key to something other than the
- (Internal change) Temporarily use a local version of the CFX API set instead of the (outdated) NuGet version. This should be reverted once the NuGet package is updated at some point.
- (Fix/Change) Changed the way nearby vehicles are detected when manually refueling using a jerrycan. This should hopefully fix most issues related to some emergency (and other) vehicles not being detected when holding a jerrycan to refuel.
- Optimize pickups spawn for OneSync (thanks to themonthofjune (Hibiki June) · GitHub)
- Optimize overall performance (thanks to themonthofjune (Hibiki June) · GitHub)
(Update by @Vespura)
- Added a new json file called
GasStations.jsonso you can create your own gas stations.
Simply copy one of the gas stations and add it below the existing ones (make sure the format of the json stays intact! Any invalid json will BREAK the json file and will NOT allow the resource to function properly.
- Add external API for other resources to control this one
(Update by @Vespura)
- Fix engine randomly turning back on. (temporary fix, shouldn’t be in here for long)
- Hud overlay (fuel bar) will now be disabled if you disable the hud preference in your game settings.
- Added resource manifest version.
- Added debug error message in case the config file fails to load.
- Add customization option for engine on/off toggle control.
Edit the config file to change this button.
- Fix readme.md builds image redirect url.
- Bumped version number.
- Fix mod not starting on join
- Add missing gas stations (thanks to @Vespura and @Deziel0495)
- Fix engine control (thanks to @a_sith )
- Make hud displaying optional
- Fix fuel bar on all aspect ratios (kudos to @Disquse)
- Add taking max fuel level from handling
- Disable temp manual engine cut-off
- Add temp engine cut-off when vehicle run out of fuel
- Fix missing default behaviour of starting engine when vehicle is driveable
- Fixed not working gas stations when blips creation turned off
- Added per-pump refueling, so one should get close to particular pump instead of center of gas station
- Removed yellow marker circle
- Added config file, so creation of blips and/or pick-ups is now could be turned off
- Fixed attempt to create blips and pickups too early
- Fixed fuel level maximization on vehicle fix
- Add events.
- Reworked help text to native instructional buttons.
- Removed conflicting gas stations.
- Fuel bar will now respect your screen safe zone.
- Add manual refueling using Jerry Can.
- Add spawning Jerry Cans at every gas station.
- New algorithm of refueling: you need to completely stop inside gas station, then Horn to turn engine off, refuel, Horn again to turn engine on.
1. How do I make fuel consumption slower/faster?
There’s a special config option
FuelConsumptionRate. Set it to something less than 1, e.g.
0.25 - 4 times slower consumption, or something more than 1 to increase rate as well, e.g.
2 - 2 times faster consumption rate.
2. How do I increase/decrease fuel tank capacity of this particular vehicle?
We don’t provide such option yet. But you can go hard way of custom handling file for this particular vehicle, it’s hard, but possible, search forums.
3. How do I disable fuel consumption for this particular vehicle?
So you have some electrical vehicle, great. In general, we don’t provide such option in the easy way as well. See F.A.Q. entry #2 for the hard way. Or check the spoiler below.
How to make electric vehicles have no fuel.
4. I want an integration with my favorite RoleplaySystem™, how?
Thing is, we won’t ever accept any integration with any such system into the mod itself, we want to keep it as pure as possible, because there’re plenty of users who just don’t need such integrations. Instead, we want to encourage people to make separate integrations with such systems. We will definitely add links to these integrations to this topic. Also we’re considering moving FRFuel to separate github org and putting these integrations under such org so people could easily find them.