> For the complete documentation index, see [llms.txt](https://sbscripts.gitbook.io/sb-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sbscripts.gitbook.io/sb-scripts/sb-fuel/exports.md).

# Exports

### Client

```lua
exports['sbfuel']:GetFuel(vehicle)                -- 0-100
exports['sbfuel']:SetFuel(vehicle, 100.0)         -- optional 3rd argument: fuel type in the tank
exports['sbfuel']:GetFuelType(vehicle)            -- what the vehicle is built for
exports['sbfuel']:GetTankFuelType(vehicle)        -- what is in the tank right now
exports['sbfuel']:IsBrokenDown(vehicle)           -- wrong fuel in the tank
exports['sbfuel']:IsElectric(vehicle)
exports['sbfuel']:GetTankSize(vehicle)
exports['sbfuel']:ChargeVehicle(vehicle, 25)      -- electric only: add 25%. No amount = full.
exports['sbfuel']:IsFueling()
exports['sbfuel']:IsHoldingNozzle()
```

### Server

```lua
exports['sbfuel']:GetFuel(vehicle)
exports['sbfuel']:SetFuel(vehicle, 50.0, 'premium')   -- type optional
exports['sbfuel']:GetTankFuelType(vehicle)            -- nil = the vehicle's own fuel
exports['sbfuel']:ChargeVehicle(vehicleOrPlate, 25)   -- electric only. Plates work for stored vehicles.
exports['sbfuel']:GetStation(stationId)
exports['sbfuel']:GetStationPrice(stationId, 'premium')
exports['sbfuel']:GetStationAtCoords(vector3(...))
exports['sbfuel']:AddStationStock(stationId, 'regular', 1000)
```

`exports['LegacyFuel']:GetFuel` and `SetFuel` always work on both client and server.

### Charging stored EVs

Call the server export from your garage's store event, with the plate. Non-electric plates are ignored.

```lua
-- qb-garages (server), inside the event that stores a vehicle:
exports['sbfuel']:ChargeVehicle(plate)       -- charge to full
exports['sbfuel']:ChargeVehicle(plate, 30)   -- add 30% (40% becomes 70%)
```
