Fuel
A resource to handle vehicle fuel.
Info
This resource is intended to give greater control over vehicle fuel economy, while adding another layer of variation and tuning capabilities for our upcoming vehicle tuning resource.
Different fuel types, each defined with different "stats", e.g: "knock rating", "efficiency rating", "power rating".
Each vehicle class has a configurable "economy" value, allowing you to effect the drain rate of each vehicle class individually (think: motorcycles drain fuel slower then sports cars).
Each vehicle class has a configurable "tank size" value. This modifies the amount of time it takes to completely drain a vehicles fuel tank (works in conjunction with class economy above). This value also simulates an increased tank size by effects how long it will take to refuel, and all subsequent fuel "labels" will represent a modified value (e.g: a vehicle with 1.0 tank modifier will read 100 units max, a 3.5 rating would read 350 units max).
Straight-forward usage-by-rpm modifier.
Realistic fuel nozzle and hose props that attach nicely to all types of vehicles.
Addon fuel pumps, allowing you to create special locations for electric vehicle charging, or race fuel restocking, allowing only a given type of fuel.
Proper electric vehicle handling (electric vehicles can only be charged by electric stations, proper "recharging/refueling" labels, etc).
Purchase and use jerry cans with specific fuel types for emergency refills.
Purchase and use battery boosters for an emergency electric-vehicle fuel boost.
All jerry can/battery booster purchasing facilitated through pump interaction UI.
Each fuel station has configurable "pump speeds" for added variation of refueling time.
Each fuel station has configurable fuel types, with stock levels for each station that restock automatically given a configurable amount over-time.
Station stock levels are stored between restarts.
Exports provided to increase/reduce stock level at stations as required (if you wish to hook some type of fuel delivery trucking job up to this).
Toggleable config option to explode pumps if player attempts to drive away while refueling with nozzle still attached to car.
Setup
Config
All of the config vars found below are stored within the config.lua
file.
Fuel Types
All fuel type configuration can be found within the data/fueltypes.lua
file.
For further documentation, read the subpage found here.
Stations
All fuel station configuration can be found within the data/stations.lua
file.
For further documentation, read the subpage found here.
Labels
All labels and translations can be found within the labels.lua
file.
Usage
All modifications handled through the
config.lua
file.All translations are handled in the
labels.lua
file.Use the working examples in
config.lua
to extend the functionality in any way you please.Class restrictions use the same indexes found here: https://docs.fivem.net/natives/?_0x29439776AAA00A62, or you can use
-1
to allow all classes at a shop.If you're using
ox_inventory
, add the following toox_inventory/data/items.lua
:
Example
All events are prefixed with "ti_fuel:", and exports are registered under the same namespace without the prefix.
Conflicting Resources
Basically any other fuel resource.
Dependencies
Last updated