Skip to content

A functionality fuel system based off of LegacyFuel that uses PolyZones that target fueling pumps and vehicles to allow you to refuel your vehicle, as well as interact-sound to play accurate refueling sounds, Syphoning, Jerry Cans and more!

License

Notifications You must be signed in to change notification settings

Sh0rtyyy/cdn-fuel-esx

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codine Development Fuel Script Banner

CDN-Fuel (2.2.3)

A highly in-depth fuel system for FiveM with support for the ESX.

Lastest Patch Information

Fixes:

  • General Fixes


Codine Development Fuel Script Features Banner

Why should you pick cdn-fuel?

  • Show all gas station blips via Config Options.
  • Vehicle blowing up chance percent via Config Options.
  • Pump Explosion Chance when running away with Nozzles via Config Options.
  • Global Tax and Fuel Prices via Config Options.
  • Target eye for all base fuel actions, not including Jerry Can & Syphoning.
  • Fuel and Charging Nozzle with realistic animations.
  • Custom sounds for every action, like refueling & charging.
  • Select amount of fuel you want to put in your vehicle.
  • On cancel, the amount you put in will be filled.
  • Option to pay cash or with your bank.
  • Toggleable Jerry Cans via Config Options.
  • Electric Charging with a Custom Model & pre-configured locations.
  • Player Owned Gas Stations that can be maintained by the Owner.
  • Highly User Friendly Menus for Gas Station Owners.
  • Reserve Levels which are maintained by the Owner of the Gas Station or Unlimited based on Config Options.
  • Renamable Gas Stations on Map with Blacklisted words.
  • Helicopter and Boat Refueling.
  • Configurable discounts for Emergency Services.
  • Configurable Hose for the Fuel Nozzle.
  • Official Support for the OX Library. (Inventory/Menus/Target)

Codine Development Fuel Script Install Banner

Before your installation:

Make sure you have the following dependencies, otherwise, issues most likely will arise:

Dependencies:

Begin your installation

Here, we shall provide a step-by-step guide on installing cdn-fuel to your server and making it work with other scripts you may already have installed.

Step 1:

First, we will start by renaming the resource "cdn-fuel-main" to just "cdn-fuel".

Next, we will drag the "cdn-fuel" resource into your desired folder in your servers resources directory.

Step 1

Step 2:

Next, we're going to drag the sounds from the cdn-fuel/assets/sounds folder in cdn-fuel, into your interact-sounds folder located at resources/[standalone]/interact-sound/client/html/sounds

explorer_8jBjdkgaeQ

Step 3:

Next, we're going to open our entire resources folder in whichever IDE you use, (we will be using Visual Studio Code for this example) and replace all of your current exports titled "LegacyFuel", "ps-fuel" or "lj-fuel", with "cdn-fuel". Then you want to ensure cdn-fuel in your server's config file.

step 3


Step 4:

Next, we're going to run our SQL file, which is needed if we want to use the Player Owned Gas Stations, otherwise you do not have to run it.


The file you need to run is located @ cdn-fuel/assets/sql/cdn-fuel.sql


Here is a GIF to run you through the process of running an SQL file:

Step4-Gif

Step 5:

It is highly recommended, if you plan on restarting the script at all, that you move the stream folder & data_file paramaters found in the fxmanifest.lua to another resource for the time being. If you do not do this, you & anyone in the server's game will most likely crash when restarting cdn-fuel. The process is very simple & it is outlined in the GIF & Instructions below.


Step 6:

Copy and paste the jerrycan item to items.lua

['jerrycan'] = {
	label = 'Jerrycan',
	client = {
		event = 'cdn-fuel:jerrycan:refuelmenu',
	}
},

Firstly, we will move our stream folder to our new resource, or existing resource.

In this example, I have a dummy resource named cdn-fool.
explorer_4tflJ0RowY

Next, we will move our fxmanifest.lua's entries for data_file into our new resource, and REMOVE IT from cdn-fuel.

jRtUg319mL

data_file 'DLC_ITYP_REQUEST' 'stream/[electric_nozzle]/electric_nozzle_typ.ytyp'
data_file 'DLC_ITYP_REQUEST' 'stream/[electric_charger]/electric_charger_typ.ytyp'

Make sure to ensure this new resource as well as cdn-fuel in your server.cfg!

If you do not want the Jerry Can or Syphoning Kit items, you are now finished with installation.


*Otherwise, navigate to Step 6 & Step 7 below, and finish installation.*

Recommended Snippets:

We highly recommend you add the following snippet to your engine toggle command. It will make it to where players cannot turn their vehicle on if they have no fuel! Seems pretty important to us!

Engine Toggle Snippet
-- EXAMPLE FOR QB-VEHICLEKEYS, FUNCTION ToggleEngine();
local NotifyCooldown = false
function ToggleEngine(veh)
    if veh then
        local EngineOn = GetIsVehicleEngineRunning(veh)
        if not isBlacklistedVehicle(veh) then
            if HasKeys(QBCore.Functions.GetPlate(veh)) or AreKeysJobShared(veh) then
                if EngineOn then
                    SetVehicleEngineOn(veh, false, false, true)
                else
                    if exports['cdn-fuel']:GetFuel(veh) ~= 0 then
                        SetVehicleEngineOn(veh, true, false, true)
                    else
                        if not NotifyCooldown then
                            RequestAmbientAudioBank("DLC_PILOT_ENGINE_FAILURE_SOUNDS", 0)
                            PlaySoundFromEntity(l_2613, "Landing_Tone", PlayerPedId(), "DLC_PILOT_ENGINE_FAILURE_SOUNDS", 0, 0)
                            NotifyCooldown = true
                            QBCore.Functions.Notify('No fuel..', 'error')
                            Wait(1500)
                            StopSound(l_2613)
                            Wait(3500)
                            NotifyCooldown = false
                        end
                    end                
                end
            end
        end
    end
end

You are now officially done installing!


Enjoy using cdn-fuel, if you have an issues, create an issue on the repository, and we will fix it ASAP!



Codine Development Fuel Script Showcase Banner

Demonstration of the script

Here's a couple of videos showcasing the script in action!



Codine Development Fuel Script Future Plans Banner



Codine Development Links Banner

Codine Links

Credits:

  • ESX Conversion: Shorty

About

A functionality fuel system based off of LegacyFuel that uses PolyZones that target fueling pumps and vehicles to allow you to refuel your vehicle, as well as interact-sound to play accurate refueling sounds, Syphoning, Jerry Cans and more!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%