Cuxial Fuel needs no SQL import. It creates its own tables on first start and uses an item that your inventory already has to exist: the jerry can.
Check the dependencies
These resources must be installed and working before you add Cuxial Fuel:
- OneSync enabled on the server
ox_liboxmysqlcuxial_bridge, with one of the supported frameworks: QBox, QBCore or ESXsleepless_interactox_inventorycuxial_gas_assets, delivered with the script
cuxial_gasstations is optional. When it is running, each station sells with its own prices and stock, the money goes to its till and its promotions show on the totems. Without it, every pump sells with the prices of defaults in shared/config.lua.
With cuxial_gasstations running, Cuxial Fuel's settings and pump screens are managed live from its /gasadmin panel, in the Fuel and Pumps tabs. See Admin panel.
Copy the resources
Place the cuxial_fuel and cuxial_gas_assets folders inside your resources directory. Keep the folder names as they are.
Remove any other fuel script
Cuxial Fuel takes the place of your previous fuel resource. Delete or comment out every line that starts another one:
# ensure your_old_fuel_scriptTwo fuel systems running at once write the fuel level of the same vehicles and both react to the pumps. Leave only Cuxial Fuel.
Resources that ask for fuel through the export names of the most common fuel scripts keep working. The names Cuxial Fuel answers to are the provide lines at the top of its fxmanifest.lua. See Exports & events.
Check the jerry can item
The jerry can is given as the item set in jerryCan.item, weapon_petrolcan by default. That item must exist in ox_inventory. If you use another name, change it in shared/config.lua.
No other item is needed.
Set the convars
All of them are optional.
# Language of the script (en and es are included)
setr ox:locale "en"
# Debug traces in the console
setr cuxial_fuel_debug "0"Use setr, not set: the debug convar is read on the client too.
Start the resources
Start Cuxial Fuel after its dependencies and after your framework:
ensure ox_lib
ensure oxmysql
# your framework here (qbx_core, qb-core or es_extended)
ensure cuxial_bridge
ensure ox_inventory
ensure sleepless_interact
ensure cuxial_gas_assets
ensure cuxial_fuel
# optional
ensure cuxial_gasstationsNo SQL to run. The resource creates the tables cuxial_fuel_vehicles (fuel type of each vehicle) and cuxial_fuel_config (live settings and pump screen profiles) when it starts; install/cuxial_fuel.sql is only a reference.
If your database has a player_vehicles_fuel_type table from a previous fuel script and cuxial_fuel_vehicles is empty, the saved fuel types are copied once on start.
Check that it works
- Join the server and drive any car. Type
/fuel_type: a notification shows the fuel of the vehicle. - Stop next to a pump, turn the engine off and get out. Look at the pump and pick Refuel. The camera moves to the pump screen.
- Choose a fuel and an amount, and pay. The nozzle appears in your hand, tied to the pump by a hose.
- Go to the fuel cap and pick Refuel. The level goes up.
- Return to the pump and pick Return the nozzle. The litres you did not use are refunded.
Next: adjust prices, tanks and screens in Configuration.
