# Configuration

### Introduction

This page explains how to configure the **Enyo Medical System** to fit your FiveM server.<br>

***

### Core Server Settings

These are **mandatory** settings. Make sure they match your server’s framework and scripts.

| Setting                 | Description                                       | Options                                    |
| ----------------------- | ------------------------------------------------- | ------------------------------------------ |
| `Config.Framework`      | Main server framework.                            | `'QB'`, `'ESX'`, `'QBX'`                   |
| `Config.inventory`      | Inventory system name.                            | `'qb'`, `'ox'`, `'qs'`, `'ps'`, `'origen'` |
| `Config.TargetSystem`   | Targeting system (eye icon).                      | `'qb-target'`, `'ox_target'`               |
| `Config.AmbulanceJob`   | EMS job name as defined in your framework.        | Example: `'OSP'`                           |
| `Config.Debug`          | Enables extra console messages for debugging.     | `true` / `false`                           |
| `Config.AdminAceGroups` | ACE groups allowed to use admin medical commands. | e.g. `{ "admin", "god", "command" }`       |

***

### General Gameplay Settings

These control the core medical mechanics, including how illnesses spread and affect players.

| Setting               | Description                                              | Default            |
| --------------------- | -------------------------------------------------------- | ------------------ |
| `RandomIllnessChance` | % chance a player will catch a random illness per cycle. | `10`               |
| `RandomIllnessCycle`  | Time between random illness checks (ms).                 | `3600000` (1 hour) |
| `HealthDropInterval`  | How often sick players lose health (ms).                 | `10000` (10 sec)   |
| `EquipmentRange`      | Max distance for EMS to use medical tools.               | `20.0`             |

***

### 3D Models (Props)

Defines the models used for medical equipment. You can replace these with custom props if desired.

```lua
Config.EquipmentModels = {
    pulseOximeter = `oximeter_prop_01`,
    thermometer = `thermometer_prop_01`,
    bloodPressure = `medic_prop_01`,
    bodyScanner = `mri_prop_01`,
    book = `v_res_fa_book03`,
    table = `v_med_trolley`
}
```

***

### Tool Attachment Positions

**Advanced** section, controls how props attach to the player’s body using bone IDs and offsets.\
Modify only if you understand GTA V bone structures and rotations.

Example:

```lua
Config.ToolAttachments = {
    thermometer = {
        bone = 12844,
        offset = vector3(-0.0150, 0.190, -0.010),
        rotation = vector3(83.000, 370.000, 81.000)
    }
}
```

`Config.PlayerOnScannerOffset` adjusts where the player is positioned relative to the scanner machine.

***

### Medical Room & Equipment Locations

Define where your hospital rooms, tables, and scanners are placed.

Each room has:

* A **center position**
* One or more **tables**
* **One scanner** location

Example:

```lua
Config.Rooms = {
    pillbox = {
        position = vector3(348.67, -572.54, 27.69),
        tables = {
            table1 = {
                position = vector4(348.67, -572.54, 27.69, 170.0),
                rotation = vector3(0.0,0.0,-20.1)
            }
        },
        bodyScanner = {
            position = vector4(366.12, -570.30, 27.69, 73.94),
            rotation = vector3(0.0,0.0,-110.0)
        }
    }
}
```

You can add multiple hospitals by copying the format.

***

### Equipment Placement on Tables

Specifies how small tools are positioned on top of the tables defined in `Config.Rooms`.

```lua
Config.TableEquipment = {
    {
        name = "pulseOximeter",
        offset = vector3(0.33, -0.15, 1.04),
        rotation = vector3(0.00, 0.00, 150.00)
    }
}
```

* `name` must match `Config.EquipmentModels`
* `offset` & `rotation` are relative to the table.

***

### 🩺 8. Visual Symptoms (Animations)

Defines how illnesses manifest visually through **animations** and **movement styles**.

Each symptom includes:

* `type`: `"animation"` or `"clipset"`
* `dict` and `data`: animation dictionary & name
* `loop` and `duration`: repeat frequency and play time
* Optional sound effects through `pain`

Example (coughing):

```lua
coughing = {
    id = "coughing",
    type = "animation",
    dict = "timetable@gardener@smoking_joint",
    data = "idle_cough",
    pain = {"cough1","cough2"},
    loop = 5000,
    duration = 3000
}
```

***

### Reference Lists

#### Injury Pack Names

Use these in the `injury` field of a condition to apply visible wounds.\
Examples: `HOSPITAL_0`, `SCR_Finale_Michael_Face`, `Burnt_Ped_Limbs`, `Car_Crash_Heavy`, `TD_KNIFE_FRONT`, `None`

#### Event Keys

Used in the `source` field to define how illnesses or injuries are triggered.

* **Player actions**\
  `event:fall`, `event:hit_by_car`, `event:shot`, `event:melee`
* **Environment**\
  `event:environment:snow`, `:heat`, `:smog`, `:rain`, `:inwater`

#### Mask & Contagion Rules

* Healthy player + mask → **1% infection chance**
* Sick player + mask → **1% infection chance for everyone nearby**

***

### Medical Conditions

This is the **core** of the medical system.

Example:

```lua
{
    name = "Respiratory Virus",
    description = "Viral infection causing cough and fever",
    source = "event:environment:rain",
    chance = 1,
    random = true,
    contagious = 0,
    symptoms = {
        heartRate = {min = 95, max = 110},
        temperature = {min = 38.0, max = 39.2},
        o2Saturation = {min = 82, max = 90},
        bloodPressure = {min = 110, max = 125},
        injury = "HOSPITAL_1",
        movement = {"coughing", "sneezing"}
    },
    treatment = "ribavirin",
    possibleBodyParts = {"Lungs"},
    bodyPartProbability = 0.9,
    hpDrop = 1
}
```

You can **add new illnesses** by copying the structure and adjusting the fields.

\
For troubleshooting or advanced customization, enable `Config.Debug = true` to see logs in your console.


---

# 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/illness-and-treatment-system/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.
