Thanks to visit codestin.com
Credit goes to github.com

Skip to content

VanillaRp/lj-fuel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LJ FUEL

lj-fuel used with QBCore Framework

Join my Discord laboratory for updates, support, and special early testing!
https://discord.gg/loljoshie

lj-fuel is a modified version of LegacyFuel using PolyZones like NoPixel 3.0
Runs at ~ 0.00 to 0.01 ms if you have more optimization suggestions feel free to reach out

Dependencies

Video Guide Installation

Installation

  • IMPORTANT: Must rename ANY existing LegacyFuel exports to lj-fuel

qb-target:

  • Find this in qb-target/config
  • Put this in "Config.TargetBones" (more reliable to always keep target bones in config)
Config.TargetBones = {

	["bones"] = {
        bones = {
            'boot', 
            'rudder', 
            'rudder2', 
            'petrolcap', 
            'petroltank', 
            'petroltank_l', 
            'petroltank_r',
        },
        options = {
      {
        type = "client",
        event = "lj-fuel:client:SendMenuToServer",
        icon = "fas fa-gas-pump",
        label = "Refuel Vehicle",
      },
        },
          distance = 1.0
    },

}

Global Taxes:

  • Put this in qb-core/server/functions.lua
QBCore.Functions.GlobalTax = function(value)
	local tax = (value / 100 * QBConfig.Server.GlobalTax)
	return tax
end
  • Find this in qb-core/config.lua
  • Put this under line 29:
QBConfig.Server.GlobalTax = 15.0

qb-smallresources:

  • Remove this thread in qb-smallresources/client/ignore.lua
Citizen.CreateThread(function()
    while true do
        local ped = PlayerPedId()
        local weapon = GetSelectedPedWeapon(ped)
		if weapon ~= GetHashKey("WEAPON_UNARMED") then
			if IsPedArmed(ped, 6) then
				DisableControlAction(1, 140, true)
				DisableControlAction(1, 141, true)
				DisableControlAction(1, 142, true)
			end

			if weapon == GetHashKey("WEAPON_FIREEXTINGUISHER") or  weapon == GetHashKey("WEAPON_PETROLCAN") then
				if IsPedShooting(ped) then
					SetPedInfiniteAmmo(ped, true, GetHashKey("WEAPON_FIREEXTINGUISHER"))
					SetPedInfiniteAmmo(ped, true, GetHashKey("WEAPON_PETROLCAN"))
				end
			end
		else
			Citizen.Wait(500)
		end
        Citizen.Wait(7)
    end
end)

(removes infinite jerry can and fire extinguisher ammo)

Key Features

  • NoPixel style animation for refueling
  • Gas station polyzone areas targeted with qb-target
  • Fuel price is fully calulated before purchase including taxes
  • Progressbar is synced with refueling amount left for vehicle
  • Buy jerry can from pump
  • Refuel jerry can from pump
  • Engine chance to blow up
  • Engine always running unless turned off

Previews

resource ms

resource ms

refueling animation

refueling.mp4

refueling vehicle jerry can

refueling vehicle jerry can

polyzones around map

polyzones

refuel interact

qb-target interact

menu price calculation

qb-target interact

pump interaction

qb-target pump interaction

My CSS Edits to Dependencies

Change Logs

1.2

  • Added option to switch between newer or older versions of QBCore
  • Change exports back to qb-target
  • Fixed qb-menu for new update
  • Commented out import.lua (still need for older versions)

1.1

  • Added option to have a chance of engine explosion while vehicle is left running
  • Added option to have blips only show when close enough
  • Added option to leave engine running

1.0

  • Initial release

Credit

Issues and Suggestions

Please use the GitHub issues system to report issues or make suggestions, when making suggestion, please keep [Suggestion] in the title to make it clear that it is a suggestion.

About

lj-fuel used with QBCore Framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%