Skip to content

zizujr/LegacyFuel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

Updated this useful fuel script for ESX. (Updated FXManifest and removed-replaced deprecated code)

Installation

  1. Download the latest version in the "code" tab on GitHub.
  2. Drag & drop the folder into your resources server folder.
  3. Configure the config file to your liking.
  4. Add start LegacyFuel to your server config.

Exports

There are currently two (client-sided) exports available, which should help you control the fuel level for vehicles whenever needed.

SetFuel(--[[Vehicle--]] vehicle, --[[Float/Int: (0-100)--]] value)
GetFuel(--[[Vehicle--]] vehicle) -- Returns the vehicle's fuel level.

Example usage:

function SpawnVehicle(modelHash)
    local vehicle = CreateVehicle(modelHash, coords.x, coords.y, coords.z, true, false)

    exports["LegacyFuel"]:SetFuel(vehicle, 100)
end

function StoreVehicleInGarage(vehicle)
    local plate = GetVehicleNumberPlateText(vehicle)
    local fuelLevel = exports["LegacyFuel"]:GetFuel(vehicle)

    TriggerServerEvent('vehiclesStored', plate, fuel)
end

About

A simple, lightweight fuel script for FiveM Updated 2024

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Lua 100.0%