[QB] LegacyFuel - Updated - Fixed Resmon + Fuel prop + Sound

This is a Direct replacement for LegacyFuel. I uploaded it to github so the code can be seen. I also included the .rar with the files structured already.

It has been adapted for QB , Requires that you have Ox_Lib , & InteractSound.

1.) fixed original script issue where sitting in a vehicle would raise resmon to 0.06
2.) Updated fxmanifest.lua.
3.) Switched all 3d texts to ox_lib UI’s and notifications.
4.) Added Fuel Prop in hand.
5.) Added Pump sounds via interact sound.
6.) Fixed jerry can usage . This is stictly for qbcore.

I did not create the original resource , I have only improved to fix MY needs.

INSTALL:
Removed/backup your currently legacy fuel.
Replace it with this new version.
Rename to LegacyFuel
Copy the sound files to your InteractSound client folder with the rest of the sounds.
Restart and enjoy.
DOWNLOAD
FrequencyRoleplay/Legacyfuel-qb-updated: Ox_lib support added for 3d text + pump prop + pump sounds (github.com)

LegacyFuel-frp.rar (905.2 KB)


VIDEO PREVIEW
2023-09-27 20-54-21.mkv (21.0 MB)

If you’re selling your resource, please include the following information at the end of your post:

Code is accessible Yes
Subscription-based No
Lines (approximately) Number of lines
Requirements Requirements QBcore , Ox-Lib, Interact Sound
Support No

(For releases without code the not applicable fields can be written as N/A)

10 Likes

esx ?

1 Like

unfortunately not. I dont use or even know much esx. im not even sure if ox-lib can be used on esx.
its open source tho , so you can take your normal esx and make the changes yourself if you desire.

Do you think it would be easy to make it compatible with Charmoso’s gas stations?

You would have to look at the code and see for youself. i did not make this from scratch , I only modified and added some features. its not much different from the original legacy fuel from 3 or 4 years ago.

1 Like

Thanks, I’ll try to see what I can do.

1 Like

I noticed i goofed on this event.

you can replace it in your client lua for now,

AddEventHandler('fuel:startFuelUpTick', function(pumpObject, ped, vehicle)
	currentFuel = GetVehicleFuelLevel(vehicle)

	nozle = CreateObject(GetHashKey("prop_cs_fuel_nozle"), 0, 0, 0, true, true, true) -- creates object
	AttachEntityToEntity(nozle, ped, GetPedBoneIndex(ped, 0x49D9), 0.1, 0.02, 0.02, 90.0, 40.0, 170.0, true, true, false, true, 1, true) -- object is attached to left hand

	TriggerServerEvent("InteractSound_SV:PlayOnSource", "pickupnozzle", 0.4)----------------pick up sound
	Wait(250)	

	while isFueling do
		Wait(500)
		TriggerServerEvent("InteractSound_SV:PlayOnSource", "refuel", 0.3) ----------------------filling sound
		Wait(250)
		local oldFuel = DecorGetFloat(vehicle, Config.FuelDecor)
		local fuelToAdd = math.random(10, 20) / 10.0
		local extraCost = fuelToAdd / 1.5

		if not pumpObject then
			if GetAmmoInPedWeapon(ped, 883325847) - fuelToAdd * 100 >= 0 then
				currentFuel = oldFuel + fuelToAdd

				SetPedAmmo(ped, 883325847, math.floor(GetAmmoInPedWeapon(ped, 883325847) - fuelToAdd * 100))
			else
				isFueling = false
			end
		else
			currentFuel = oldFuel + fuelToAdd
		end

		if currentFuel > 100.0 then
			currentFuel = 100.0
			isFueling = false
		end

		currentCost = currentCost + extraCost

		if currentCash >= currentCost then
			SetFuel(vehicle, currentFuel)
		else
			isFueling = false
		end
	end

	if pumpObject then
		TriggerServerEvent('fuel:pay', currentCost)
		lib.notify({
			title = 'Fuel',
			description = 'Fueling is complete!',
			type = 'success'
		})	
	end
 	DeleteEntity(nozle) -------------------------------------------------------------------------------------------deletes nozle
 	currentCost = 0.0

 	TriggerServerEvent("InteractSound_SV:PlayOnSource", "putbacknozzle", 0.4)-----------------------------------------putback sound
 	Wait(250)
end)
1 Like

Is there a way to make the fuel nossle have a hose attached to it?

yeah , use another script lol.
joking. maybe in futuew ill try to add

Causes issue with JG Garages and the ox_lib/3d text input message appearing for half a second and dissapearing when in zone.

I use JG garage and ox lib. a;sp
not many issues on my end.

make sure you update the event i posted

Some of your lua files belong in the corresponding function and source folders, which your script is completely missing. Even after I fixed that and see gas blips, nothing happens when I pull up to the pump.

its litterly the same resource, all i did was add a prop , sounds and differnnt notification.

try the other direct downloan instead of github.
just make sure ya update that funection i posted above.

make sure your ox lib is up to date.

Oh, I didn’t see ox-lib as a dependency. My bad.

1 Like

This is causing JG-Advanced Garages UI text prompt to no longer appear… any ideas?

make sure you have OX LIB.

I use this with JG also , it has nothing to do with JG but if you dont have OX lib the fuel script wont run which cause errors on JG . Dude above you just went thru same thing.

I have ox_lib; the script works just fine, I see the ui appear at the pumps and works… It’s with JG garages that the ui prompt pops up for half a second and then disappears after I added this script in.

have you solved this?

did you update the event i posted above?
make sure ox is up to date as well.

Yes but that did not solved the issue at all.
I used the legacy inside the rar file is that the one?