Skip to content

Configuration

Every option of Cuxial Fuel explained: prices, consumption, tanks, pumps, chargers, screens, totems and data lists.

Behaviour lives in shared/config.lua. The lists of models and positions live in data/. Restart the resource after any change to the files.

With Cuxial Gas Stations running, almost all of these options can be changed live from /gasadmin → Fuel, without restarting. What is saved there (in the cuxial_fuel_config table, only the fields that differ from the file) wins over shared/config.lua, which becomes the factory value. Reset returns each section to the file. See Admin panel.

General ​

OptionTypeDefaultWhat it does
debugbooleanfalsePrints traces to the console. Also enabled by setting the convar cuxial_fuel_debug to 1.
refuelTicknumber300Milliseconds per 0.5 L at a fuel pump. Lower is faster.
ropeEnabledbooleantrueDraws the hose between the pump and the nozzle. Only the player holding the nozzle sees it. false removes the hose; the distance limit still applies.
ropeLengthnumber7.5Metres the nozzle can move away from the pump when the pump has no value of its own in data/.
refundOnReturnbooleantruetrue refunds what was paid and not served when the purchase closes. false never refunds.
saveAllFuelTypesbooleantruetrue saves the fuel type of every vehicle. false saves only player-owned vehicles; the rest is remembered until the next restart.
fuelTypeCommandstring'fuel_type'Command that tells the fuel of the vehicle.
wrongFuelDelaynumber5000Milliseconds from driving with the wrong fuel to the engine breaking.
accountsstring[]{ 'cash', 'bank' }Accounts the player can pay with.
admin.permissionstring'admin'Framework permission, checked through Cuxial Bridge, required by /fuel_screen and by the Fuel and Pumps tabs of /gasadmin.

Refunds are rounded down, and less than 1 L left over is not refunded. A purchase is also closed, with its refund, when the player disconnects or changes character.

Interface · ui ​

OptionTypeDefaultWhat it does
accentstring (hex)configurableAccent colour of the interface.
currency.symbolstring'$'Symbol shown before every amount.
currency.localestring'en-US'Number format (thousands and decimal separators), as a language tag such as 'es-ES'.

Distances · distances ​

Maximum distances checked by the server, in metres.

OptionTypeDefaultWhat it does
pumpnumber8.0From the player to the pump when opening it or paying.
vehiclenumber8.0From the vehicle to the pump.
fuelTypenumber6.0From the player to the vehicle when another resource changes its fuel type.

Job discounts · jobDiscounts ​

A table of job name = percentage. The discount applies only while the player is on duty, and uses the job name, not its label. The jobs in the file are examples: replace them with yours.

lua
jobDiscounts = { police = 90, ambulance = 80 },

The jerry can has no discount, and the totems always show the price without discount.

The discount requires a framework that reports whether the player is on duty. On ESX, use a version with duty status.

Default prices and stock · defaults ​

Used by pumps that belong to no station: every pump when cuxial_gasstations is not running, and the stations without an owner when it is.

OptionTypeDefaultWhat it does
pricetableregular = 1.55, plus = 1.69, premium = 1.98, diesel = 1.49Price per litre of each fuel.
stocktableall truetrue = the fuel is available, up to 1000 L per purchase. false = out of stock.

A station with no price set (price 0) also sells at the price in defaults.

Jerry can · jerryCan ​

OptionTypeDefaultWhat it does
enabledbooleantruefalse removes the sale at the pump, and cans already owned stop refuelling.
pricenumber300Fixed price, without job discount.
requiredStocknumber10Litres taken from the station's stock for each can. The can is filled with the first fuel that has that much stock.
itemstring'weapon_petrolcan'Inventory item given to the player.
litersnumber100Litres the can holds.

The can is only sold at fuel pumps, not at chargers. To use it, the player equips it and picks Refuel at the fuel cap of a nearby vehicle.

Spills · spill ​

Starting the engine while refuelling stops the flow and leaves the nozzle plugged in. If the vehicle then moves, the nozzle pops out and the purchase closes.

OptionTypeDefaultWhat it does
enabledbooleantruefalse disables the rule: starting the engine only stops the refuel.
moveThresholdnumber1.5Metres the vehicle has to move for the nozzle to pop out.
speednumber2.0Speed in m/s that also makes it pop out.
customerPaysbooleantruetrue = spilled litres are not refunded. false = they are refunded anyway.

The puddle and the litres lost are decided by cuxial_gasstations. Without it nothing is spilled and the unused litres are refunded as usual.

Fuels · fuelTypes ​

OptionTypeDefaultWhat it does
petrolstring[]regular, plus, premium, dieselFuels sold at the pumps.
electricstring[]electric_fast, electric_normalCharging modes sold at the chargers. Each one pairs with an entry of chargers.types (electric_fast = fast).

A vehicle with no saved fuel type takes one from its model: diesel if it is in data/diesel.lua, electric if it is an electric vehicle, regular otherwise.

Consumption · consumption ​

Litres per second = usage by RPM × perClass × perFuel ÷ 10.

OptionTypeDefaultWhat it does
perFueltableregular = 1.0, plus = 0.9, premium = 0.8, diesel = 1.0, electric = 1.0Multiplier by the fuel in the tank. Lower is more economical.
perClasstablefrom 0.0 (cycles) to 4.0 (planes)Multiplier by GTA vehicle class, 0 to 22.
usagetablefrom 0.0 to 1.3Base value for each RPM step, from 0.0 to 1.0. 0.2 is idle.

When the tank reaches zero the engine turns off. A vehicle that has never had a level gets a random one between 20 % and 80 % the first time someone drives it.

Tank size · tank ​

Tank in litres. The script looks at the model first, then the class, and uses 100 L when neither is set.

OptionTypeDefaultWhat it does
perClasstablefrom 0 (cycles) to 500 (planes)Litres by GTA vehicle class. 0 = no tank: the vehicle does not consume and cannot refuel.
perVehicletablepanto = 40Litres by model name. Wins over the class.
lua
perVehicle = { panto = 40, sultan = 65 },

Nozzle · nozzle ​

OptionTypeDefaultWhat it does
gasstring'prop_cs_fuel_nozle'Model of the fuel nozzle.
electricstring'prop_eletricpistol'Model of the charging connector.
bonenumber18905Ped bone the nozzle is attached to (left hand).
handOffsetvector3vec3(0.13, 0.04, 0.01)Position in the hand.
handRotationvector3vec3(-42.0, -115.0, -63.42)Rotation in the hand.
ropeOffsetvector3vec3(0.0, -0.033, -0.195)Point of the nozzle where the hose is tied.

Pumps · pumps ​

OptionTypeDefaultWhat it does
ropeOffsettableforward = 0.0, right = 0.0, up = 2.1Point of the pump the hose comes out of, for models without their own.
propstable[]seven pump modelsModels that work as a pump. Each entry has prop, an optional ropeOffset and an optional enabled.

Any object of the map with one of these models becomes a working pump. enabled = false on an entry turns that model off: no interaction and no screen.

lua
props = {
    { prop = 'prop_gas_pump_1a', ropeOffset = { forward = 0.0, right = 0.0, up = 2.3 } },
    { prop = 'my_custom_pump', ropeOffset = { forward = 0.0, right = 0.0, up = 1.9 } },
},

Chargers · chargers ​

OptionTypeDefaultWhat it does
enabledbooleantruefalse removes the chargers. Electric vehicles then stop consuming.
propstable[]prop_electric_01Models that work as a charger, with the same fields as pumps.props.
types.fasttableprice = 2.5, time = 0.8, stock = true, power = 220Fast charge.
types.normaltableprice = 1.8, time = 2, stock = true, power = 100Normal charge.
vehiclesstring[]list of modelsModels treated as electric.

Fields of each charge type:

FieldWhat it does
pricePrice per battery unit. The battery uses the same scale as the tank.
timeSeconds per unit charged.
stocktrue = available at pumps that belong to no station.
powerkW shown on the screen.

On game build 3258 or newer the client also recognises electric vehicles by itself. The server only knows the vehicles list, so add your custom electric models to it.

Blips · blips ​

Blips are off by default because cuxial_gasstations already adds its own.

OptionTypeDefaultWhat it does
enabledbooleanfalseShows a blip on each position of coords.
nearestOnlybooleanfalseShows only the nearest one, recalculated every 5 seconds.
spritenumber361Blip sprite.
colornumber41Blip colour.
scalenumber0.6Blip size.
coordsvector3[]list of stationsPositions of the blips.

Pump screen · screen ​

The screen is drawn on the pump model. It shows prices while idle and the purchase when a player uses the pump.

OptionTypeDefaultWhat it does
enabledbooleantruefalse turns every pump screen off; pumps open a regular panel on the player's screen.
renderDistancenumber20.0Metres within which the idle screen is drawn.
idletable900 × 400Resolution of the idle screen on fuel pumps.
sessiontable1080 × 480Resolution of the purchase screen on fuel pumps.
idleEvtable800 × 450Resolution of the idle screen on chargers.
sessionEvtable1024 × 576Resolution of the purchase screen on chargers.
texturestablegas, electric, vintageTexture names the screen replaces on the models delivered in cuxial_gas_assets. Leave as is.
variantstablevintageAlternative screen layouts with their own resolution. A model picks one with variant. The classic pump (vintage) shows the brand of the locale key UI_VINTAGE_BRAND, FUEL by default; edit it in locales/.
camera.distancenumber1.2Metres from the camera to the screen during the purchase.
camera.marginnumber1.25Margin around the screen in the frame. 1.0 = the screen fills the view.
camera.fovnumberautomaticOptional. Sets a fixed field of view instead of the calculated one.
modelstableeight modelsWhere the screen sits on each pump or charger model.

Screen position per model · screen.models ​

Each key is a model name. A pump whose model has no entry here opens the regular panel.

FieldWhat it does
offsetCentre of the screen from the model origin: x right, y forward, z up.
yawRotation in degrees.
width, heightSize in metres.
sides1 or 2. With 2 the screen is also drawn on the opposite face.
mesh, txdNameSet on the models delivered in cuxial_gas_assets, which carry the screen in the model itself. Do not change them.
variantLayout from screen.variants.

To place the screen on a model of your own, use /gasadmin → Pumps, or stand next to it and run /fuel_screen. The profile is saved on the server and reaches everyone at once, on top of screen.models. To keep it in the file too, paste the copied or printed line into screen.models. See Commands & permissions.

Price totems · screen.totems and screen.totemBrands ​

The totems are the large price signs of the stations. They show price per litre, stock, chargers and, with cuxial_gasstations, the station name and its promotions.

OptionTypeDefaultWhat it does
totems.enabledbooleantruefalse turns every totem off.
totems.modestring'prop'How the screen is put on the sign. Leave 'prop'.
totems.propDistancenumber300.0Metres within which the screen of a totem exists.
totems.renderDistancenumber140.0Metres within which the screen is lit.
totems.switchMarginnumber15.0Metres another totem has to be closer before the lit one changes.
totems.refreshMsnumber60000Milliseconds between refreshes. Changes of price, stock or promotions arrive without waiting.
totems.maxDuisnumber3Totem screens lit at once, the nearest ones.
totems.modelstablelist of sign modelsSign models and the screens each one carries. Tied to the models in cuxial_gas_assets.
totems.placementstable[]list of signsOne entry per sign of the map: model, position, station and service lines.

Fields of a placement you may want to edit:

FieldWhat it does
stationStation id in cuxial_gasstations. Without it, the station is found from coords.
servicesFixed lines of the big screen: '24h', 'shop', 'lotto', 'wash'.

totemBrands sets the look of each station brand: name, banner and disc images, mascot, order of the fuels, slogans (prefix of the locale keys) and colors (primary, secondary, digits, text).

totems.models and totems.placements match the sign models delivered in cuxial_gas_assets. Change prices, brands and services freely; leave positions and model names alone unless you replace the models.

Sounds · audio ​

OptionTypeDefaultWhat it does
enabledbooleantruefalse turns the native sounds off.
remotebooleantrueLets players hear the flow of other players refuelling.
remoteDistancenumber25.0Metres within which that flow is heard.
screenBeepbooleantrueBeep when pressing the pump screen.
debugCommandstring'fuelaudio'Command that plays every sound. Only registered with debug on.

Consumption chart · chart ​

OptionTypeDefaultWhat it does
enabledbooleantruefalse removes the chart, its command and its key.
commandstring'fuel_chart'Command that opens and closes the chart.
focusKeystring'F3'Default key that gives the cursor to the chart. Each player can rebind it in the GTA key settings.
positionstring'left'Side of the screen: 'left' or 'right'.

Data lists · data/ ​

FileWhat it holds
data/pumps.luaExtra pumps created by the script where the map has none. Each entry has prop, coords (vec4, the fourth value is the heading) and an optional ropeLength.
data/chargers.luaElectric chargers, with the same fields.
data/diesel.luaModels that run on diesel. Any other fuel breaks their engine, and diesel breaks the engine of the rest.
data/blacklist.luaModels that do not consume and cannot refuel.
data/vehicles.luaRefuel point per model: distance to interact, nozzleOffset from the fuel cap (forward, right, up) and an optional nozzleRotation. default applies to models not listed.

The positions in data/pumps.lua and data/chargers.lua are examples for the default map. Replace them with yours.

data/pumps.lua
lua
{ prop = 'prop_gas_pump_1b', coords = vec4(442.2, -977.17, 42.69, 270.3), ropeLength = 14.0 },

Common changes ​

Change the prices ​

shared/config.lua
lua
defaults = {
    price = { regular = 2.10, plus = 2.35, premium = 2.80, diesel = 1.95 },
    stock = { regular = true, plus = true, premium = true, diesel = true },
},

Add an electric model ​

Add its model name at the end of chargers.vehicles, keeping the ones already there:

shared/config.lua
lua
vehicles = {
    'voltic', 'voltic2', 'neon', -- ...the rest of the list
    'my_electric_car',
},

Make a model run on diesel ​

Add its model name to data/diesel.lua:

data/diesel.lua
lua
'my_truck',

Refuel faster ​

shared/config.lua
lua
refuelTick = 150,

© Cuxial