A NoPixel inspired functionality fuel system that uses PolyZones that target specific areas that allow you to have the abilitity to refuel your vehicles.
We will now provide you with a step-by-step guide for the installation process. Shouldn't take too long and it shouldn't be too confusing either!
Go ahead and start by dragging and dropping ps-fuel into your designated resources folder.
If you are still lost, Slothy has created a few GIF's to help guide you through all the installation steps.
Open your entire resources folder with Visual Studio Code (or whichever program you use) and replace all exsiting exports titled "LegacyFuel" with "ps-fuel" instead. If you have the previous resource "lj-fuel" do the same thing and replace that with "ps-fuel" or just get this newer version to avoid any conflictions or confusion.
First copy the snippet below and then navigate to your qb-smallresources/client/ignore.lua
RegisterNetEvent('QBCore:Client:DrawWeapon', function()
local sleep
while true do
sleep = 500
local ped = PlayerPedId()
local weapon = GetSelectedPedWeapon(ped)
if weapon ~= `WEAPON_UNARMED` then
if IsPedArmed(ped, 6) then
sleep = 0
DisableControlAction(1, 140, true)
DisableControlAction(1, 141, true)
DisableControlAction(1, 142, true)
end
if weapon == `WEAPON_FIREEXTINGUISHER` then
if IsPedShooting(ped) then
SetPedInfiniteAmmo(ped, true, weapon)
end
end
else
break
end
Wait(sleep)
end
end)
then paste this snippet over the existing lines shown in the GIF below.
if weaponName == "weapon_petrolcan" or weaponName == "weapon_fireextinguisher"
Copy this line and then navigate to your qb-inventory/client/main.lua paste this in your Visual Studio Code search bar.
if weaponName == "weapon_fireextinguisher" then
ammo = 4000
end
after it takes you to spot we need, copy this snippet and paste it over the few lines shown in the GIF below.
TriggerServerEvent("weapons:server:UpdateWeaponAmmo", CurrentWeaponData, tonumber(ammo))
Copy this line and then navigate to your qb-weapons/client/main.lua paste this in your Visual Studio Code search bar.
CreateThread(function()
while true do
local ped = PlayerPedId()
local idle = 1
if (IsPedArmed(ped, 7) == 1 and (IsControlJustReleased(0, 24) or IsDisabledControlJustReleased(0, 24))) or IsPedShooting(PlayerPedId()) then
local weapon = GetSelectedPedWeapon(ped)
local ammo = GetAmmoInPedWeapon(ped, weapon)
if weapon == GetHashKey("WEAPON_PETROLCAN") then
idle = 1000
end
TriggerServerEvent("weapons:server:UpdateWeaponAmmo", CurrentWeaponData, tonumber(ammo))
if MultiplierAmount > 0 then
TriggerServerEvent("weapons:server:UpdateWeaponQuality", CurrentWeaponData, MultiplierAmount)
MultiplierAmount = 0
end
end
Wait(idle)
end
end)
After it takes you to spot we need, copy this snippet and paste it over the few lines shown in the GIF below.
Copy the sounds inside the sounds folder and paste/drag it into your interact-sounds folder located at resources/[standalone]/interact-sound/client/html/sounds
- Show all gas station blips (found in shared/config.lua)
- Vehicle blowing up chance percent (found in shared/config.lua)
- Global tax and fuel prices (found in shared/config.lua)
- Close resembled NoPixel animation while refueling vehicles
- Target eye for all actions
- Menu estimating cost for vehicle being refueled (tax included)
- Buy and refuel jerry cans
- Jerry cans save amount of fuel left while not equipped
Here's a few showcased examples while using ps-fuel.
Jerry.can.saving.mp4
Buy.and.refuel.jerry.can.mp4
Refueling.mp4
Huge thanks to Snipe (pushkart2) and MonkeyWhisper for figuring out the long-awaited issue of jerry cans not saving the proper amount of fuel each time you equip it. This release wouldn't be possible without them.