Client Side Exports

Fuel Management

GetFuel

Gets the current fuel level of a vehicle.

local fuel = exports['lyre_fuel']:GetFuel(vehicle)

Parameters:

Name
Type
Description

vehicle

number

The vehicle entity handle

Returns:

Type
Description

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:

Name
Type
Description

vehicle

number

The vehicle entity handle

fuel

number

The fuel level to set (0-100)

Returns:

Type
Description

boolean

Whether the operation was successful

Example:


Fuel Type Detection

GetFuelType

Gets the fuel type key of a vehicle based on its model.

Parameters:

Name
Type
Description

vehicle

number

The vehicle entity handle

Returns:

Type
Description

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:

Name
Type
Description

fuelType

string

The fuel type key (e.g., "general", "diesel", "electric")

Returns:

Type
Description

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:

Name
Type
Description

vehicle

number

The vehicle entity handle

Returns:

Type
Description

table or nil

The fuel type configuration table, or nil if blacklisted

Example:


Quick Reference

Export
Parameters
Returns
Description

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