HSC

Snippet Dashboard

Version: 1.0.6

Integrations

LC-Fuel for JG-Scripts

JG-ScriptsFuelQBCoreESXQBox

Framework

QBCore | ESX | QBox

Updated

4/9/2026

Author

HSC

Overview

Code Snippet so lc-fuel is added to JG-Scripts. This snippet will work for ALL scripts.

Folder/Files we will edit

The file we are editing is located in framework/cl-functions and in the config.lua

What to edit

1

Open your JG-Scrip folder. In the example we will use jg-advancegarages

2

Head over to your framework folder then cl-fuctions.lua

3

Locate the Vehicle Functions [around line 285] section and replace it with Snippet below

Requirements

lc-fuel installed
Any JG-Script
VSC [Visual Studio Code] to well...edit the code XD

Notes

Always back up the original file before replacing banking logic.

F.A.Q

Q: What line is this on?
A: Starts around 285 and ends around 330 [Varys if you have other edits]

Code

cl-functions.lua

lua
--
-- Vehicle Functions
--

---@param vehicle integer
---@return number fuelLevel
function Framework.Client.VehicleGetFuel(vehicle)
  if not DoesEntityExist(vehicle) then return 0 end

  if (Config.FuelSystem == "LegacyFuel" or Config.FuelSystem == "ps-fuel" or Config.FuelSystem == "lj-fuel" or Config.FuelSystem == "cdn-fuel" or Config.FuelSystem == "hyon_gas_station" or Config.FuelSystem == "okokGasStation" or Config.FuelSystem == "nd_fuel" or Config.FuelSystem == "myFuel") then
    return exports[Config.FuelSystem]:GetFuel(vehicle)
  elseif Config.FuelSystem == "ti_fuel" then
    local level, type = exports["ti_fuel"]:getFuel(vehicle)
    TriggerServerEvent("jg-advancedgarages:server:save-ti-fuel-type", Framework.Client.GetPlate(vehicle), type)
    return level
  elseif Config.FuelSystem == "ox_fuel" or Config.FuelSystem == "Renewed-Fuel" then
    return GetVehicleFuelLevel(vehicle)
  elseif Config.FuelSystem == "rcore_fuel" then
    return exports.rcore_fuel:GetVehicleFuelPercentage(vehicle)
  elseif Config.FuelSystem == "lc_fuel" then
    return exports["lc_fuel"]:GetFuel(vehicle)
  else
    return 65 -- or set up custom fuel system here...
  end
end

---@param vehicle integer
---@param fuel number
function Framework.Client.VehicleSetFuel(vehicle, fuel)
  if not DoesEntityExist(vehicle) then return false end

  if (Config.FuelSystem == "LegacyFuel" or Config.FuelSystem == "ps-fuel" or Config.FuelSystem == "lj-fuel" or Config.FuelSystem == "cdn-fuel" or Config.FuelSystem == "hyon_gas_station" or Config.FuelSystem == "okokGasStation" or Config.FuelSystem == "nd_fuel" or Config.FuelSystem == "myFuel" or Config.FuelSystem == "Renewed-Fuel") then
    exports[Config.FuelSystem]:SetFuel(vehicle, fuel)
  elseif Config.FuelSystem == "ti_fuel" then
    local fuelType = lib.callback.await("jg-advancedgarages:server:get-ti-fuel-type", false, Framework.Client.GetPlate(vehicle))
    exports["ti_fuel"]:setFuel(vehicle, fuel, fuelType or nil)
  elseif Config.FuelSystem == "ox_fuel" then
    Entity(vehicle).state.fuel = fuel
  elseif Config.FuelSystem == "rcore_fuel" then
    exports.rcore_fuel:SetVehicleFuel(vehicle, fuel)
  elseif Config.FuelSystem == "lc_fuel" then
    exports["lc_fuel"]:SetFuel(vehicle, fuel)
  else
    -- Setup custom fuel system here
  end
end