Client Side Exports
Fuel Management
GetFuel
Gets the current fuel level of a vehicle.
local fuel = exports['lyre_fuel']:GetFuel(vehicle)Parameters:
vehicle
number
The vehicle entity handle
Returns:
number
The current fuel level (0-100)
Example:
local playerVehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local currentFuel = exports['lyre_fuel']:GetFuel(playerVehicle)
print("Current fuel: " .. currentFuel .. "%")SetFuel
Sets the fuel level of a vehicle.
local success = exports['lyre_fuel']:SetFuel(vehicle, fuel)Parameters:
vehicle
number
The vehicle entity handle
fuel
number
The fuel level to set (0-100)
Returns:
boolean
Whether the operation was successful
Example:
Fuel Type Detection
GetFuelType
Gets the fuel type key of a vehicle based on its model.
Parameters:
vehicle
number
The vehicle entity handle
Returns:
string or nil
The fuel type key (e.g., "general", "diesel", "electric", "boats", "aviation"), or nil if blacklisted
Example:
GetFuelTypeConfig
Gets the full configuration table for a specific fuel type.
Parameters:
fuelType
string
The fuel type key (e.g., "general", "diesel", "electric")
Returns:
table or nil
The fuel type configuration table, or nil if not found
Returned Table Structure:
Example:
GetVehicleFuelTypeConfig
Gets the full fuel type configuration for a specific vehicle.
Parameters:
vehicle
number
The vehicle entity handle
Returns:
table or nil
The fuel type configuration table, or nil if blacklisted
Example:
Quick Reference
GetFuel
vehicle
number
Gets vehicle fuel level (0-100)
SetFuel
vehicle, fuel
boolean
Sets vehicle fuel level
GetFuelType
vehicle
string/nil
Gets fuel type key for vehicle
GetFuelTypeConfig
fuelType
table/nil
Gets fuel type configuration
GetVehicleFuelTypeConfig
vehicle
table/nil
Gets fuel config for vehicle
IsVehicleBlacklisted
vehicle
boolean
Checks if vehicle is blacklisted
Last updated