/ps-fuel

A NoPixel inspired functionality fuel system that uses PolyZones that target specific areas that allow you to have the abilitity to refuel your vehicles.

Primary LanguageLuaGNU General Public License v3.0GPL-3.0

Project Sloth GitHub Project PS-FUEL Banner

ps-fuel

A NoPixel inspired functionality fuel system that uses PolyZones that target specific areas that allow you to have the abilitity to refuel your vehicles.

Project Sloth Buttons

Dependencies:



Project Sloth GitHub Sub Install Banner

Start installing now

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!

Step 1:

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.

explorer_rKiz0tBzmo

Step 2:

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.

explorer_vpSwery89h

Step 3:

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.

Code_rCl4lhFAY5

Step 3:

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.

Code_YbMuUyZnUS

Step 4:

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.

Code_yecDDjuRVG

Step 5:

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



Project Sloth GitHub Sub Features Banner

Some features to mention within this ps-fuel:

  • 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


Project Sloth GitHub Sub Showcase Banner

Time to show you what it looks like!

Here's a few showcased examples while using ps-fuel.

Jerry can saving correct amount left:

Jerry.can.saving.mp4

Buying and refueling jerry can:

Buy.and.refuel.jerry.can.mp4

Refueling vehicle:

Refueling.mp4

Credits:

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.

Copyright © 2022 Project Sloth. All rights reserved.