⛽️ [PAID] [QBCore][Standalone][ESX] Fuel system - Different designs | Different types of fuel | Convenient configuration file | Electric and Conventional Refueling | UI | Burevestnik

fuelsystem

I welcome you CFX community!

Today i present to you a fuel system categorized by vehicle types that will bring more diversity to the gameplay on your server. I am confident that you and your players will find it appealing!

This system boasts a user-friendly interface that showcases various fuel options for different types of cars. In addition, it features a distinct fuel consumption mechanism within each vehicle and much more.

Demonstration of the system:

:movie_camera: Preview Video

Screenshots

Example of a configuration file:

Configuration files
-- /* 
-- ██████╗░██╗░░░██╗██████╗░███████╗██╗░░░██╗███████╗░██████╗████████╗███╗░░██╗██╗██╗░░██╗
-- ██╔══██╗██║░░░██║██╔══██╗██╔════╝██║░░░██║██╔════╝██╔════╝╚══██╔══╝████╗░██║██║██║░██╔╝
-- ██████╦╝██║░░░██║██████╔╝█████╗░░╚██╗░██╔╝█████╗░░╚█████╗░░░░██║░░░██╔██╗██║██║█████═╝░
-- ██╔══██╗██║░░░██║██╔══██╗██╔══╝░░░╚████╔╝░██╔══╝░░░╚═══██╗░░░██║░░░██║╚████║██║██╔═██╗░
-- ██████╦╝╚██████╔╝██║░░██║███████╗░░╚██╔╝░░███████╗██████╔╝░░░██║░░░██║░╚███║██║██║░╚██╗
-- ╚═════╝░░╚═════╝░╚═╝░░╚═╝╚══════╝░░░╚═╝░░░╚══════╝╚═════╝░░░░╚═╝░░░╚═╝░░╚══╝╚═╝╚═╝░░╚═╝*/

Config = {}

Config.framework = exports["es_extended"]:getSharedObject() --ESX | QBCore -> exports['qb-core']:GetCoreObject()

payFuel = function(fuelPrice, input, vehType) --Set up your framework here.
    --ESX
    local player = Config.framework.GetPlayerFromId(source)
	if player.getMoney() >= tonumber(fuelPrice) then
		player.removeMoney(fuelPrice)
		TriggerClientEvent('bur_fuelsystem:refuel', source, input, vehType)
	else 
		TriggerClientEvent('bur_fuelsystem:burExitUI', source)
		TriggerClientEvent('esx:showNotification', source, Config.Translation['nomoney'])
	end
    --QBCore
	--local player = Config.framework.Functions.GetPlayer(source)
	--if player.PlayerData.money["cash"] >= tonumber(fuelPrice) then
		--player.Functions.RemoveMoney('cash', fuelPrice, "Bank depost")
		--TriggerClientEvent('bur_fuelsystem:refuel', source, input, vehType)
	--else 
	--	TriggerClientEvent('bur_fuelsystem:burExitUI', source)
	--	TriggerClientEvent("QBCore:Notify", source, Config.Translation['nomoney'], "success", 2500)
	--end
end

-- Use Burevestnik Interaction Button (https://forum.cfx.re/t/free-standalone-interaction-button/4860169)
Config.UseBurevestnikInteractionButton = false

DisplayHelpText = function(str)
    SetTextComponentFormat("STRING")
    AddTextComponentString(str)
    DisplayHelpTextFromStringLabel(0, 0, false, -1)
end

HelpNotificationBottom = function(text)
    BeginTextCommandThefeedPost("STRING")
    AddTextComponentSubstringPlayerName(text)
    EndTextCommandThefeedPostTicker(true, true)
end

Config.ObjeFuel = {-2007231801, 1339433404, 1694452750, 1933174915, -462817101, -469694731, -164877493}
Config.FuelOpenButton = 38
Config.interactionDistance = 4.0
Config.Translation = {
    ['menu'] = 'Press ~INPUT_CONTEXT~ to ~g~interact',
    ['nomoney'] = '~r~You do not have enough Money!',
	['noaccess'] = '~g~Your vehicle tank is full!',
	['wrongtypeoffuel'] = '~r~Incorrect fuel type!',
	['BurevestnikInteractionButton'] = 'E',
	['BurevestnikInteractionButtonText'] = 'Press to interact',
	['UIexit'] = 'EXIT',
	['UIgs1'] = 'GAS STATION',
	['UIgs1name'] = 'Burevestnik OIL',
	['UIfuel1'] = 'Regular',
	['UIfuel2'] = 'Premium',
	['UIfuel3'] = 'Diesel',
	['UIfuel4'] = 'ECO',
	['UIgs1text1'] = 'PRICE PER GALLON',
	['UIcost'] = 'COST',
	['UIfueltypetext'] = 'Your fuel type',
	['UIfueltypetitletext'] = 'Cash',
	['UIfueltypetext2'] = 'Processing...',
	['UIgs1pay'] = 'PAY AND REFUEL',
	['UIgs2'] = 'ELECTRIC CHARGING',
	['UIgs2name'] = 'Burevestnik STATION',
	['UIgs2text1'] = 'PRICE PER KW',
	['UIgs2pay'] = 'CONNECT THE CHARGER AND PAY',
	['UIcurrency'] = '$',
	['UIbar'] = 'Fueling in progress...',
}

Config.useFuelConsumption = true
vehicleFuelConsumption = function(playerPed, vehicle)
	if GetVehicleFuelLevel(vehicle) > 0 then 
		SetVehicleFuelLevel(vehicle, GetVehicleFuelLevel(vehicle) - (GetVehicleEstimatedMaxSpeed(vehicle)/1000))
	end
end

Config.useSpecificfuel = true
Config.classes = { 
	{
		vehicleClass = {1,2,3,4,8,9,13,18},
		fuelType = "regular",
	},
	{
		vehicleClass = {5,6,7},
		fuelType = "premium",
	},
	{
		vehicleClass = {10,11,12,14,15,16,17,19,20,21,22},
		fuelType = "disel",
	}
}

Config.electricVehicles = {
	"Voltic",
    "Voltic2",
    "Dilettante",
    "Dilettante2",
    "Cyclone",
    "Cyclone2",
    "Raiden"
}

Config.regularFuelPrice = 1
Config.premiumFuelPrice = 2
Config.diselFuelPrice = 3
Config.ecoFuelPrice = 4

Config.GasStationsBlips = {
	{
        useBlip = true,
        blipID = 415, --Blip ID.
        blipScale = 0.6, --Blip scale.
        blipColor = 51, --Blip color.
        blipDisplay = 4, --Blip display.
        blipText = "Gas station", --Blip text.
		location = {
			vector3(49.4187, 2778.793, 58.043),
			vector3(263.894, 2606.463, 44.983),
			vector3(1039.958, 2671.134, 39.550),
			vector3(1207.260, 2660.175, 37.899),
			vector3(2539.685, 2594.192, 37.944),
			vector3(2679.858, 3263.946, 55.240),
			vector3(2005.055, 3773.887, 32.403),
			vector3(1687.156, 4929.392, 42.078),
			vector3(1701.314, 6416.028, 32.763),
			vector3(179.857, 6602.839, 31.868),
			vector3(-94.4619, 6419.594, 31.489),
			vector3(-2554.996, 2334.40, 33.078),
			vector3(-1800.375, 803.661, 138.651),
			vector3(-1437.622, -276.747, 46.207),
			vector3(-2096.243, -320.286, 13.168),
			vector3(-724.619, -935.1631, 19.213),
			vector3(-526.019, -1211.003, 18.184),
			vector3(-70.2148, -1761.792, 29.534),
			vector3(265.648, -1261.309, 29.292),
			vector3(819.653, -1028.846, 26.403),
			vector3(1208.951, -1402.567,35.224),
			vector3(1181.381, -330.847, 69.316),
			vector3(620.843, 269.100, 103.089),
			vector3(2581.321, 362.039, 108.468),
			vector3(176.631, -1562.025, 29.263),
			vector3(-319.292, -1471.715, 30.549),
			vector3(-722.6, -1472.88, 5.01),
			vector3(1784.324, 3330.55, 41.253)
		}
    },
}

--Exports
--exports.Burevestnik_fuelsystem:Burevestnik_fuelsystem_getFuel()  
--exports.Burevestnik_fuelsystem:Burevestnik_fuelsystem_setFuel(amount) -- 1.0/5.7/24.4 etc

Optimization (The script consumes):

0.00 ms in a quiet state.

0.03 ms in an active state.

What does this system include:

  • This system works on all versions of ESX, QBCore, as well as STANDALONE!
  • Detailed configuration file!
  • Beautiful user interface!
  • Unique fuel consumption system for each vehicle!
  • Support for our :nazar_amulet: [FREE][Standalone] Interaction Button | Text UI resource !
  • You can change the price for a different type of fuel!
  • Ability to select the required type of fuel depending on the type of car!
  • The ability to link the gas station location to the object!
  • There are more than 20 preset refueling locations, and it’s also easy to add new ones!
  • Exports are available!
  • Of course support, I’m ready to help you!

:shopping_cart: [OPEN SOURCE] You can get that resource in my Tebex.

:shopping_cart: [ESCROW] You can get that resource in my Tebex.

TOP SALES

qs3 hudsystem-min bpLogo

You may also be interested in my other resources:

mg crate Anomaly zones img

animsystem bpLogo hudsystem-min

OrangeSystem barsystem storev2

qs3 dialSystem speedcam_img

lockpick train LicensePlate

pop 6q6g5y as

mg ars fuelsystem

mwpLG8T - Imgur e5f6ad277b5836eb5fa4db2b8207c3e46beb8362 imgonline-com-ua-Resize-czg8px7HwUHn

My project (1) My project (5) My project

kaws My project (6) a

bgk bg bg

st11

Code accessible Open source: Yes \ Escrow: No - Available only: config, ui
Subscription based No
Lines (approximately) ~1600
Requirements Standalone/ESX/QBCore
Support Yes
5 Likes

What about saving the cars fuel data?

1 Like

Amazing :star_struck:

1 Like

Fuel values are saved.
If you get in and out of the car, the fuel level will be unchanged. If you park the car in the garage, it should also be preserved.
I hope I answered the question correctly. :slightly_smiling_face:

2 Likes

will the standalone work with QB no issues?

1 Like

Everything will work fine, the only thing you will need to change the money function, if you need it :cowboy_hat_face:

1 Like

What is the difference premium, petrol and diesel

1 Like

The first difference is in price, the other is an improvement in the performance of the car engine :fuelpump:

1 Like

Maybe something like add that every car use a specific type of fuel, and if u put the wrong one it will damage the engine on the way.
Cool script btw

1 Like

Great idea, I’ll release an update in a couple of hours! :wink:
Thanks for the feedback!

1 Like

Update 1.2.0 of all versions :fuelpump:

  • Added the ability to select the required type of fuel depending on the type of car.
    If you fill the car, ship, plane with the wrong fuel, then your engine will start to smoke and lose functionality.

Contact me if you have any questions.

2 Likes

Is it possible to implement a working petrol can?

1 Like

It can be implemented as an item with different types of fuel for ESX. :rocket:

1 Like

Would be awesome :wink:

1 Like

Nice release

1 Like

Update 1.3.0 of all versions :fuelpump:

  • Added the possibility of cans with different types of fuel as an item (ESX).

Contact me if you have any questions.

2 Likes

Update 1.4.0 of all versions :fuelpump:

  • Fixed a bug where it was impossible to use canisters in some cases.
  • Added SQL file to quickly add items to use (ESX only).
  • Improved, now when refueling with unsuitable fuel, it will be impossible to refuel the car at 100%, your fuel level will automatically become 8%.
  • Minor bugs have been fixed.

Contact me if you have any questions.

2 Likes

Update 1.5.0 of all versions :fuelpump:

  • Fixed an error when sometimes nearby cars were refueled with the same fuel as the refueling car, which caused the car to break down.
  • Minor bugs have been fixed.

Contact me if you have any questions.

1 Like

Update 1.6.0 of all versions :fuelpump:

  • Added a free camera.

Contact me if you have any questions.

1 Like

Could you send me a new version ?

1 Like