Files
community_bridge/modules/fuel/ps-fuel/client.lua
T
MrNewb a7b3a34998 Add LuaDoc @description to fuel API functions
Replaced comment blocks with LuaDoc @description tags for GetResourceName, GetFuel, and SetFuel functions across all fuel module client files. This improves code documentation consistency and supports better tooling integration.
2025-10-12 21:54:52 -04:00

30 lines
997 B
Lua

---@diagnostic disable: duplicate-set-field
local resourceName = "ps-fuel"
if GetResourceState(resourceName) == 'missing' then return end
Fuel = Fuel or {}
---@description Returns the name of the active fuel resource.
---@return string
Fuel.GetResourceName = function()
return resourceName
end
---@description Returns the current fuel level of a vehicle.
---@param vehicle number The vehicle entity handle.
---@return number The vehicle fuel level.
Fuel.GetFuel = function(vehicle)
if not DoesEntityExist(vehicle) then return 0.0 end
return exports["ps-fuel"]:GetFuel(vehicle)
end
---@description Sets the fuel level of a vehicle.
---@param vehicle number The vehicle entity handle.
---@param fuel number The fuel level to assign.
---@param type? string The fuel type, used only in ti_fuel. (default: RON91)
---@return nil
Fuel.SetFuel = function(vehicle, fuel, type)
if not DoesEntityExist(vehicle) then return end
exports["ps-fuel"]:SetFuel(vehicle, fuel)
end
return Fuel