Git Product home page Git Product logo

ps-fuel's Introduction

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

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")then
				if IsPedShooting(ped) then
					SetPedInfiniteAmmo(ped, true, GetHashKey("WEAPON_FIREEXTINGUISHER"))
				end
			end
		else
			Citizen.Wait(500)
		end
        Citizen.Wait(7)
    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.

ps-fuel's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.