Client Exports#
This section provides all available client exports for the script. These functions allow you to interact directly with the system from the client side, enabling custom features, UI interactions, and integrations with other resources. Each export includes a short description and usage example for easy implementation.
SetFuel
The SetFuel export allows you to set the fuel level of a specific vehicle programmatically. This is useful for customizing fuel levels during gameplay scenarios such as refueling, debugging, or initializing vehicles with specific fuel values.
To set the fuel level of a vehicle, use the following code:
-- Set the fuel level for a specific vehicle
exports['qs-fuelstations']:SetFuel(vehicle, fuelLevel)Example
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) -- Get the current vehicle
local fuelLevel = 50 -- Set the fuel level to 50%
exports['qs-fuelstations']:SetFuel(vehicle, fuelLevel)
print("Fuel level set to: " .. fuelLevel)GetFuel
The GetFuel export allows you to retrieve the current fuel level of a specified vehicle. This is useful for monitoring fuel levels, implementing fuel consumption mechanics, or integrating fuel data into custom scripts.
To obtain the fuel level of a vehicle, use the following code:
local fuelLevel = exports['qs-fuelstations']:GetFuel(vehicle)
print("Current fuel level: " .. fuelLevel)Example



