Files
community_bridge/modules/fuel/_default/client.lua
T

27 lines
806 B
Lua
Raw Normal View History

---@diagnostic disable: duplicate-set-field
2025-03-04 22:07:34 -05:00
Fuel = Fuel or {}
2025-04-08 19:10:02 -04:00
2025-04-19 14:36:10 -04:00
---This will get the name of the Fuel being used (if a supported Fuel).
---@return string
2025-04-28 09:00:45 -04:00
Fuel.GetResourceName = function()
2025-04-19 14:36:10 -04:00
return 'default'
end
2025-04-08 19:10:02 -04:00
---This will get the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@return number fuel The fuel level of the vehicle.
2025-03-04 22:07:34 -05:00
Fuel.GetFuel = function(vehicle)
if not DoesEntityExist(vehicle) then return 0.0 end
return GetVehicleFuelLevel(vehicle)
end
2025-04-08 19:10:02 -04:00
---This will set the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@param fuel number The fuel level to set.
---@return nil
Fuel.SetFuel = function(vehicle, fuel)
2025-03-04 22:07:34 -05:00
if not DoesEntityExist(vehicle) then return end
return SetVehicleFuelLevel(vehicle, fuel)
end
return Fuel