# Configuration

This document describes the configuration settings for AI  transportation, including buses, planes, trains, taxis and boats. Each section provides details on enabling/disabling the vehicles, customizing their routes, and other settings.

### Core Framework Configuration

* `Config.core`: Defines the core framework in use for the game.
  * Options: `"qb-core"`, `"ESX"`, `"VRP"`

### Language Settings

* `Config.language`: Defines the language used for menus and notifications.
  * Available languages: `"English"`, `"Arabic"`, `"Chinese"`, `"Spanish"`, `"French"`, `"German"`

### Inventory

`Config.Inventory`: Defines which inventory system to use for item checks.

Options: `'qb'`, `'ox'`, `'custom'`

`Config.UseItems`: Set to `true` to require physical items (tickets) to use transport. Set to `false` for a virtual money-only system.

`Config.TicketItems`: Defines the item names required in your database if `UseItems` is enabled.

* `train`: Item name for train tickets.
* `plane`: Item name for plane tickets.
* `boat`: Item name for boat tickets.

***

### Bus Configuration

#### General Settings

* `Config.ENABLE_AI_BUS`: Set to `true` to enable AI-driven buses.
* `Config.ENABLE_BUS_BLIPS`: Set to `true` to display bus routes on the map.
* `Config.BLIP_CODE_BUS`: The icon code for bus routes on the map.
* `Config.BLIP_COLOR_BUS`: The color of the bus route icon.
* `Config.BLIP_SIZE_BUS`: The size of the bus route icon.

#### Bus Routes

`Config.BusRoutes` defines the list of bus routes with their specific settings.

Each bus route includes:

* `Name`: Display name of the bus route.
* `Stations`: A list of stations (waypoints) along the route represented by coordinates.
* `BusModel`: The bus model used for the route (e.g., `"bus"`, `"coach"`).
* `Speed`: Maximum speed for the bus.
* `DrivingStyle`: AI driving behavior represented by an ID (e.g., `319` for cautious driving). You can change driving style using this [tool](https://vespura.com/fivem/drivingstyle/).
* `WaitTime`: Time (in seconds) the bus will wait at each station.
* `Price`: The cost of a ticket for the route.

Example:

```lua
Config.BusRoutes = {
    {
        Name = "Central Los Santos", 
        Stations = {
            vector3(771.9880, -941.0090, 25.6858),
            vector3(788.3823, -1369.4036, 26.5249),
            vector3(826.5194, -1639.2437, 30.2806),
        },
        BusModel = "bus",
        Speed = 10.0,
        DrivingStyle = 319,
        WaitTime = 20,
        Price = 10,
    },
}
```

### Plane Configuration

#### General Settings

* `Config.ENABLE_AI_PLANES`: Set to `true` to enable AI-controlled planes.
* `Config.ENABLE_PLANES_BLIPS`: Set to `true` to display plane routes on the map.
* `Config.BLIP_CODE_PLANE`: The icon code for plane routes on the map.
* `Config.BLIP_COLOR_PLANE`: The color of the plane route icon.
* `Config.BLIP_SIZE_PLANE`: The size of the plane route icon.

#### Plane Routes

`Config.PlaneRoutes` defines the list of plane routes with their specific settings.

Each plane route includes:

* `Name`: Display name of the plane route.
* `start`: Starting runway configuration (coordinates for takeoff).
* `finish`: Ending runway configuration (coordinates for landing).
* `planeModel`: The plane model used for the route (e.g., `"luxor"`, `"shamal"`, `"miljet"`).
* `Price`: The ticket price for the plane route.

Example:

```lua
Config.PlaneRoutes = {
    {
        Name = "LS International to Sandy Shores",
        start = {
            runwayStart = vector3(-1290.3481, -2879.7759, 14.5473),
            runwayEnd = vector3(-1499.2947, -2761.7888, 13.9449),
        },
        finish = {
            runwayStart = vector3(1062.9083, 3011.6797, 41.8074),
            runwayEnd = vector3(1474.9471, 3121.3032, 40.5341),
        },
        planeModel = "luxor",
        Price = 1000,
    },
}
```

#### Additional Plane Settings

`Config.PlanesAlt`: The target altitude (float) for planes to cruise. Recommended: `200.0` or `300.0`.

`Config.PlanesFrequency`: Frequency for plane departures in minutes (1–60). Planes depart at intervals of the hour (e.g., if set to 5, they depart at :05, :10, :15, etc.).

Plane Ticket Locations:

* `Config.EnablePlaneTicketBlips`: Toggle map icons for ticket purchasing.
* `Config.PlaneTicketScreens`: Coordinates and headings for ticket kiosks (typically used inside airports).
* `Config.PlaneTicketHuts`: Coordinates for outdoor ticket booths.

`Config.AirportDoors`: Defines teleportation points for airport interiors.

* `Enter`: The coordinate to trigger the teleport.
* `Destination`: Where the player is sent.
* `message`: The prompt displayed to the player.

***

### Train Configuration

#### General Settings

* `Config.ENABLE_AI_TRAINS`: Set to `true` to enable AI-driven trains.
* `Config.ENABLE_TRAINS_BLIPS`: Set to `true` to display train routes on the map.
* `Config.BLIP_CODE_TRAIN`: The icon code for train routes on the map.
* `Config.BLIP_COLOR_TRAIN`: The color of the train route icon.
* `Config.BLIP_SIZE_TRAIN`: The size of the train route icon.

#### Train Settings

* `Config.TrainPrice`: The price of a train ticket.
* `Config.TrainsSpawnRate`: Density of trains spawned around players (1 to 10 scale).

Example:

```lua
Config.TrainPrice = 5
Config.TrainsSpawnRate = 10
```

#### Advanced Settings

`Config.BoostTrainSpeed`: Set to `true` to increase the default GTA train speed.

`Config.TrainSeats`: Offsets and headings for where players sit inside the train carriage.

> \[!TIP] Use `Config.sitDict` and `Config.sitAnim` to customize the sitting posture.

**Example**

```lua
-- Sitting animation
Config.sitDict = "timetable@michael@on_chairidle_a"
Config.sitAnim = "on_chair_a"

Config.BoostTrainSpeed = true

-- Offset coordinates for player seating inside the train carriage
Config.TrainSeats = {
    { offset = vector3(-0.983, 0.51, 3.1), heading = -99.7 },   
    { offset = vector3(0.976, 0.490, 3.1), heading = -268.2 },
}
```

***

### Taxi Configuration

#### General Settings

* `Config.ENABLE_AI_TAXI`: Set to `true` to enable AI-driven taxis.

#### Taxi Actions

* `Config.WaveAtTaxiButton`: Key press (e.g., `E`) to wave at a taxi to stop.
* `Config.CallTaxiCommand`: Command to call a taxi via chat (e.g., `/taxi`).

#### Taxi Model & Pricing

* `Config.TaxiModel`: The taxi model used in the game.
* `Config.TaxiSpawnRate`: Density of taxis spawned around players (1 to 10 scale).
* `Config.TaxiPrice`: Price per 30 meters traveled.
* `Config.TaxiStartMeter`: Initial price for a taxi ride.

#### Bribery System

* `Config.TaxiCanBeBribed`: Set to `true` to enable bribing option for taxis.
* `Config.TaxiBribePrice`: The price for bribing a taxi driver.

#### Taxi Driving Styles

* `Config.NormalDrivingStyle`: Standard driving behavior.
* `Config.CrazyDrivingStyle`: Aggressive driving behavior.

Example:

```lua
Config.TaxiModel = "taxi"
Config.TaxiPrice = 2
Config.TaxiStartMeter = 9
Config.TaxiCanBeBribed = true
Config.TaxiBribePrice = 200
```

### Driverless Taxi&#x20;

`Config.ENABLE_DRIVERLESS_TAXI`: Enables the autonomous "Vivanite" taxi service.

`Config.CallDriverlessCommand`: The chat command to request a robot taxi (Default: `/robotaxi`).

`Config.DriverlessModel`: The vehicle model used (Default: `vivanite2`).

`Config.DriverlessPrice`: Price per distance unit (usually more expensive than human taxis).

`Config.DriverlessDrivingStyle`: The AI behavior ID for the autonomous vehicle.

***

### Boat Configuration

#### General Settings

`Config.ENABLE_AI_BOATS`: Set to `true` to enable AI-driven boat routes.

`Config.ENABLE_BOATS_BLIPS`: Displays boat routes on the map.

* `Config.BLIP_CODE_BOAT`: The icon code (Default: `455`).
* `Config.BLIP_COLOR_BOAT`: The color ID.
* `Config.BLIP_SIZE_BOAT`: The scale of the icon.

#### Boat Routes

`Config.BoatRoutes`: A list of maritime routes. Each entry includes:

* `id`: Unique identifier for the route.
* `start/finish`: `vector4` coordinates for spawning and docking.
* `Checkpoints`: A list of `vector3` waypoints the AI uses to navigate around landmasses.
* `Speed`: Travel speed of the boat.

**Example**

```lua
Config.BoatRoutes = {
    {
        Name = "LSYMC to Paletto Bay",
        id = "H50",
        start = vector4(-768.31, -1420.02, 0.42, 136.78),
        finish = vector4(-282.35, 6620.04, 0.33, 230.16),
        boatModel = "marquis",
        Price = 500,
        Speed = 60.0, 
        Checkpoints = {
            vector3(-823.6038, -1496.2340, 0.8011), 
            vector3(-1385.3025, -2049.5481, 1.1631),
        }
    },
}
```

Ticket Locations:

* `Config.BoatTicketScreens` / `Config.BoatTicketHuts`: Coordinates for boat ticket sales.
* `Config.BoatFrequency`: Minutes between boat departures.

***

### Job & Limit Settings

`Config.useMaxTaxisPlayers`: If `true`, AI taxis will only be available if human taxi drivers are offline.

`Config.MaxTaxisPlayers`: The threshold of active players with the taxi job required to disable AI taxis.

`Config.JobTax`i: A list of job names (e.g., `{'taxi', 'taxi2'}`) recognized by the script to count "active" drivers.

**Example**

```lua
Config.useMaxTaxisPlayers = true  
Config.MaxTaxisPlayers = 5  
Config.JobTaxi = {'taxi', 'taxi2'}
```

***

### Debugging

Config.debug: Set to `true` to show coordinate logs and logic paths in the F8 console/server artifacts for troubleshooting.

***

### Notes

* Ensure that the coordinates for stations, runways, and taxi locations are correct to ensure smooth gameplay.
* Modify the `Price`, `Speed`, `WaitTime`, and other settings to balance the transportation system according to your game’s economy and difficulty level.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://enyo-scripts.gitbook.io/documentations/fivem-scripts/ai-transport/configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
