# Configuration

## Introduction

This script configures an advanced backup system for **FiveM** servers, including AI-controlled ambulances, player revival options, and hospital management. The system supports multiple frameworks like **ESX** and **qb-core**. Below are the configurable options and their descriptions.

***

### Configuration Options

#### Core Framework

* **Key:** `Config.core`
* **Description:** Specifies the core framework being used.
* **Options:**
  * `'ESX'`
  * `'qb-core'` (default)

***

#### Automatic Assistance

* **Key:** `Config.auto`
* **Description:** Enables or disables automatic AI assistance when no human medics are nearby.
* **Default:** `true`

***

#### Commands

* **Help Command**
  * **Key:** `Config.command`
  * **Description:** Command to request AI ambulance assistance.
  * **Default:** `"help"`
* **Cancel Command**
  * **Key:** `Config.cancel_command`
  * **Description:** Command to cancel AI ambulance dispatch.
  * **Default:** `"cancelhelp"`

***

#### AI Medic Behavior

* **Revive on Spot**
  * **Key:** `Config.revive`
  * **Description:** Determines if AI medics revive the player after transport to hospital or only transport them to the hospital.
  * **Default:** `true`
* **Service Billing**
  * **Key:** `Config.Bill`
  * **Description:** Cost of AI medic services.
  * **Default:** `1000`

***

#### Models

* **Medic Model**
  * **Key:** `Config.MedicModel`
  * **Description:** Model used for AI medics.
  * **Default:** `"s_m_m_paramedic_01"`
* **Ambulance Model**
  * **Key:** `Config.AmbulanceModel`
  * **Description:** Model for AI ambulances.
  * **Default:** `"ambulance"`
* **Boat Model**
  * **Key:** `Config.BoatModel`
  * **Description:** Model for AI water rescue vehicles.
  * **Default:** `"suntrap"`
* **Helicopter Model**
  * **Key:** `Config.HelicopterModel`
  * **Description:** Model for AI air rescue vehicles.
  * **Default:** `"polmav"`

***

#### Livery

* **Ambulance Livery**
  * **Key:** `Config.AmbulanceLivery`
  * **Description:** Visual skin for ambulances.
  * **Default:** `0`
* **Boat Livery**
  * **Key:** `Config.BoatLivery`
  * **Description:** Visual skin for boats.
  * **Default:** `0`
* **Helicopter Livery**
  * **Key:** `Config.HelicopterLivery`
  * **Description:** Visual skin for helicopters.
  * **Default:** `1`

***

#### Performance Settings

* **Maximum Speed**
  * **Key:** `Config.MaxSpeed`
  * **Description:** Top speed for AI ambulances (mph).
  * **Default:** `15.0`
* **Driving Style**
  * **Key:** `Config.customDrivingStyle`
  * **Description:** Custom driving behavior for AI drivers.
  * **Default:** `319`
  * **Note:** Use [this tool](https://vespura.com/fivem/drivingstyle/) to generate custom styles.

***

#### Air Ambulance

* **Only Air Ambulance**
  * **Key:** `Config.onlyAirAmbulance`
  * **Description:** Dispatch helicopters exclusively for AI medical assistance.
  * **Default:** `false`
* **Cayo Perico Air Ambulance**
  * **Key:** `Config.cayoAirAmbulance`
  * **Description:** Helicopters will handle Cayo Perico Island.
  * **Default:** `true`

***

#### EMS Limits

* **Maximum EMS Players**
  * **Key:** `Config.useMaxEMS`
  * **Description:** Limit AI assistance based on the number of online human medics.
  * **Default:** `true`
* **Max EMS Count**
  * **Key:** `Config.maxEMS`
  * **Description:** Maximum number of EMS players before AI is disabled.
  * **Default:** `5`

***

#### Hospitals

Define hospital details for AI operations.

**Example: Pillbox Hill Medical Center**

* **Water Point:** `vector3(-779.68, -1440.69, 1.6)`
* **Parking:** `vector3(292.8502, -582.4973, 43.1924)`
* **Door:** `vector3(298.0710, -584.4695, 43.2608)`
* **Helipad:** `vector3(352.6935, -587.5623, 74.1657)`
* **Go Inside:** `false`

#### Additional Options

* Path Inside: Configurable path for AI to navigate indoors.
* Extra Variables:
  * Check-In Point: `vector3(308.4696, -595.0331, 43.2918)`
  * Revive Cutscene Video: `https://youtu.be/JfNRjFB9tBI`

***

### Zones

#### OnlyAir Zones

Restrict AI ambulances to air support within defined areas.

* **Key:** `Config.useOnlyAirZones`
* **Default:** `false`

**Example Zone**

* Name: `"Cayo"`
* Northwest: `{x = 3667.6230, y = -4227.0049}`
* Southeast: `{x = 5863.0356, y = -6076.5122}`
* MinZ: `0.0`
* MaxZ: `100.0`

***

#### Blacklisted Zones

Prevent AI ambulance dispatch in certain areas.

* **Key:** `Config.useBlacklistedZones`
* **Default:** `false`

**Example Zone**

* Name: `"Prison"`
* Northwest: `{x = 1526.9114, y = 2719.1841}`
* Southeast: `{x = 1774.7125, y = 2329.361}`
* MinZ: `0.0`
* MaxZ: `100.0`

***

### Notifications

Customize messages for dispatch notifications.

* **Ambulance:** `"An ambulance has been dispatched to your location."`
* **Boat:** `"A water ambulance has been dispatched to your location."`
* **Heli:** `"An air ambulance has been dispatched to your location."`

***

### Debugging

Enable debug mode for developers.

* **Key:** `Config.debug`
* **Default:** `false`

***

### Max Spawn Distance

* **Key:** `Config.maxSpawnDistance`
* **Description:** Maximum distance for ambulance spawn.
* **Default:** `160`
* **Range:** `20` to `160`

***

### Notes

For advanced configurations, modify the editable files in accordance with your server's requirements.


---

# 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-ambulance/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.
