overextended / ox_fuel

Simplistic fuel resource meant for use with ox_inventory
https://overextended.dev/ox_fuel
GNU General Public License v3.0
60 stars 77 forks source link

Enhancement/Feature: Exports (setFuel, getFuel) #19

Closed PoorLatency closed 2 years ago

PoorLatency commented 2 years ago

Please hear out the people and other people who think it's beneficial. I've seen that you closed the request that was posted https://github.com/overextended/ox_fuel/pull/16 here to have an export for GetFuel because you rather people use state bags, not against that. but I believe that for people that are swapping from existing fuel systems i.e.; Legacy Fuel, etc. or any other, this would be more convenient. Suggestion is to add two exports to the fuel system which are exports.ox_fuel:getFuel(vehicle) and exports.ox_fuel:setFuel(vehicle, amount). Reason to that is because it seems much cleaner than something like this;

local vehicle = GetVehiclePedIsIn(PlayerPedId())
local Vehicle = Entity(vehicle).state
Vehicle:set('fuel', 100, true)
SetVehicleFuelLevel(vehicle, 100)

Versus:

local vehicle = GetVehiclePedIsIn(PlayerPedId())
exports.ox_fuel:setFuel(vehicle, 100)

It seems like the exports are more cleaner and less tedious to implement. Thank you for hearing the 'feature/enhancement' out. 👌 🙏

thelindat commented 2 years ago

No.