> For the complete documentation index, see [llms.txt](https://docs.cuxial.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cuxial.com/scripts/police-and-medical/cuxial-medical/configuration.md).

# Configuration

Every option of Cuxial Medical explained: config file, hospitals, beds and where each setting is stored.

Cuxial Medical is configured in `shared/config.lua`, in `data/hospitals.lua` and, for most options, live from the admin panel. This page lists every option and tells you where to change it.

## Where settings live

On first start the script copies most of `shared/config.lua` and the whole of `data/hospitals.lua` into the database table `cuxial_medical_settings`. From then on **the database copy wins**.

| Section                                                                                        | Edited in the panel | Restart needed           |
| ---------------------------------------------------------------------------------------------- | ------------------- | ------------------------ |
| `jobs`, `death`, `respawn`, `injury`, `treatment`, `stretcher`, `finisher`, `dispatch`, `logs` | Yes                 | No                       |
| `items`, `extras`                                                                              | Yes                 | Yes, to apply completely |
| `data/hospitals.lua`                                                                           | Yes                 | No                       |
| `debug`, `ui`, `admin`, `commands`, `hospital`, `compat`                                       | No, file only       | Yes                      |
| `data/beds.lua` and the other files in `data/`                                                 | No, file only       | Yes                      |

{% hint style="info" %}
After the first start, change the panel sections from `/medadmin`. To load the values of the file again, edit the file, restart the resource and press **Factory** on that section.
{% endhint %}

## General

| Option  | Type    | Default | What it does                                                                                    |
| ------- | ------- | ------- | ----------------------------------------------------------------------------------------------- |
| `debug` | boolean | `false` | Prints traces to the console. Also enabled by setting the convar `cuxial_medical_debug` to `1`. |

## Interface · `ui`

| Option        | Type         | Default      | What it does                      |
| ------------- | ------------ | ------------ | --------------------------------- |
| `accent`      | string (hex) | configurable | Accent colour of the admin panel. |
| `deathAccent` | string (hex) | configurable | Colour of the death screen.       |

## Staff · `admin`

| Option       | Type   | Default   | What it does                                                                                                |
| ------------ | ------ | --------- | ----------------------------------------------------------------------------------------------------------- |
| `permission` | string | `'admin'` | Framework permission needed to open the panel and to use the staff commands that have `restricted = false`. |

## Commands · `commands`

Each entry has a `name` and a `restricted` value. An empty `name` disables the command.

| Entry          | Default name   | Default `restricted` | Command                         |
| -------------- | -------------- | -------------------- | ------------------------------- |
| `admin`        | `medadmin`     | `false`              | Opens the admin panel.          |
| `revive`       | `revive`       | `'group.mod'`        | Revives a player.               |
| `heal`         | `heal`         | `'group.mod'`        | Heals a player.                 |
| `kill`         | `kill`         | `'group.mod'`        | Kills a player.                 |
| `stretcher`    | `stretcher`    | `false`              | Places or picks up a stretcher. |
| `delstretcher` | `delstretcher` | `false`              | Removes the nearest stretcher.  |
| `mdstretcher`  | `mdstretcher`  | `'group.mod'`        | Removes every stretcher.        |

`restricted` accepts an ACE group as a string, or `false`. With `false`, the staff commands (`revive`, `heal`, `kill`, `mdstretcher`) fall back to `admin.permission`. See [Commands & permissions](/scripts/police-and-medical/cuxial-medical/commands.md).

## EMS jobs · `jobs`

| Option | Type      | Default           | What it does                                                |
| ------ | --------- | ----------------- | ----------------------------------------------------------- |
| `jobs` | string\[] | `{ 'ambulance' }` | Job names that count as EMS. A player must also be on duty. |

## Death · `death`

### Phases · `death.phases`

An ordered list. A downed player goes through the phases one after another. At least one phase is required.

| Field       | Type    | What it does                                                   |
| ----------- | ------- | -------------------------------------------------------------- |
| `id`        | string  | Unique identifier: lowercase letters, numbers and `_`.         |
| `label`     | string  | Name shown on the death screen.                                |
| `icon`      | string  | `'heart'`, `'drop'` or `'skull'`.                              |
| `duration`  | number  | Seconds the phase lasts. Minimum 1.                            |
| `respawn`   | boolean | `true` lets the player hold the respawn key during this phase. |
| `cost`      | number  | Fee charged when respawning in this phase. `0` = free.         |
| `laststand` | boolean | `true` lets the player crawl during this phase.                |

{% hint style="info" %}
Phase labels are free text. Write them from the panel in the language of your server.
{% endhint %}

### Voice · `death.mute`

| Option      | Type    | Default | What it does                                                   |
| ----------- | ------- | ------- | -------------------------------------------------------------- |
| `enabled`   | boolean | `true`  | `true` mutes downed players. `false` never mutes them.         |
| `fromPhase` | number  | `2`     | First phase in which the player is muted.                      |
| `holdMs`    | number  | `3000`  | Milliseconds the mute is kept after respawning or checking in. |

### Zoom · `death.zoom`

| Option    | Type    | Default | What it does                                            |
| --------- | ------- | ------- | ------------------------------------------------------- |
| `enabled` | boolean | `true`  | `true` lets downed players zoom the camera.             |
| `fov`     | number  | `22.0`  | Field of view while zooming. Lower is closer.           |
| `smooth`  | number  | `0.12`  | Speed of the transition, from 0 to 1. Higher is faster. |

### Other

| Option                  | Type    | Default | What it does                                                                |
| ----------------------- | ------- | ------- | --------------------------------------------------------------------------- |
| `nearbyWarning.enabled` | boolean | `true`  | `true` asks for confirmation before respawning when other players are near. |
| `nearbyWarning.radius`  | number  | `30.0`  | Radius in metres for that check.                                            |
| `holdMs`                | number  | `5000`  | Milliseconds the respawn key must be held.                                  |

### Keys · `death.keys`

Default keys. Each player can rebind them in the GTA key settings.

| Option          | Default         | Action                                 |
| --------------- | --------------- | -------------------------------------- |
| `callEms`       | `'G'`           | Call EMS while downed.                 |
| `respawn`       | `'E'`           | Hold to respawn.                       |
| `zoom`          | `'MOUSE_RIGHT'` | Zoom while downed.                     |
| `getUp`         | `'E'`           | Get up from a hospital bed.            |
| `stretcherDrop` | `'X'`           | Drop the stretcher, or get up from it. |
| `stretcherUse`  | `'E'`           | Load the stretcher into a vehicle.     |

## Respawn · `respawn`

| Option              | Type      | Default  | What it does                                                                                             |
| ------------------- | --------- | -------- | -------------------------------------------------------------------------------------------------------- |
| `payAccount`        | string    | `'bank'` | Account charged for the respawn fee: `'bank'` or `'cash'`.                                               |
| `useBed`            | boolean   | `true`   | `true` wakes the player up in a hospital bed with a treatment. `false` places them at the respawn point. |
| `clearInventory`    | boolean   | `false`  | `true` empties the inventory when a downed player respawns at the hospital. Revives never clear it.      |
| `keepItems`         | string\[] | `{}`     | Items kept when the inventory is cleared.                                                                |
| `checkIn.enabled`   | boolean   | `false`  | `true` blocks respawn and check-in while enough EMS are on duty.                                         |
| `checkIn.minMedics` | number    | `1`      | EMS on duty needed to block.                                                                             |
| `bedReserveSeconds` | number    | `60`     | Seconds a bed stays reserved for a player on the way to it. Minimum 5.                                   |

## Reception · `hospital.reception`

Defaults for the reception NPC. The NPC of each hospital is set in the panel.

| Option         | Type      | Default                   | What it does                                                    |
| -------------- | --------- | ------------------------- | --------------------------------------------------------------- |
| `enabled`      | boolean   | `true`                    | `false` removes every reception NPC.                            |
| `resource`     | string    | `'cuxial_interactions'`   | Resource that creates the NPC and its dialog.                   |
| `model`        | string    | `'s_f_y_scrubs_01'`       | Ped model used when a hospital does not set one.                |
| `scenario`     | string    | `'WORLD_HUMAN_CLIPBOARD'` | Scenario used when a hospital does not set one.                 |
| `distance`     | number    | `2.5`                     | Metres from which the NPC can be talked to.                     |
| `feetOffset`   | number    | `1.0`                     | Height correction applied while placing the NPC from the panel. |
| `previewAlpha` | number    | `170`                     | Opacity of the placement preview, from 0 to 255.                |
| `modelTimeout` | number    | `5000`                    | Milliseconds to wait for the preview model.                     |
| `maxLen`       | number    | `48`                      | Maximum length of the model, scenario, name and role texts.     |
| `models`       | string\[] | list                      | Ped models offered in the panel.                                |
| `scenarios`    | string\[] | list                      | Scenarios offered in the panel.                                 |

## Injuries · `injury`

| Option                     | Type      | Default                                             | What it does                                                                                  |
| -------------------------- | --------- | --------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `enabled`                  | boolean   | `true`                                              | `false` disables injuries completely.                                                         |
| `trackingOnly`             | boolean   | `false`                                             | `true` records injuries without effects or bleeding.                                          |
| `damageThreshold`          | number    | `10`                                                | Minimum health lost in one hit to cause an injury.                                            |
| `armourThreshold`          | number    | `5`                                                 | Minimum armour lost in one hit to cause an injury.                                            |
| `injuryChance`             | number    | `90`                                                | Chance in % that a qualifying hit leaves an injury.                                           |
| `stackLimit`               | number    | `4`                                                 | Maximum level and maximum bleeding of one injury.                                             |
| `bleedEnabled`             | boolean   | `true`                                              | `false` stops all health loss by bleeding.                                                    |
| `bleedTickInterval`        | number    | `10`                                                | Seconds between bleeding ticks.                                                               |
| `bleedMovement.enabled`    | boolean   | `true`                                              | `true` increases the bleeding while moving fast.                                              |
| `bleedMovement.runSpeed`   | number    | `2.0`                                               | Speed above which the multiplier applies.                                                     |
| `bleedMovement.multiplier` | number    | `2.0`                                               | Bleeding multiplier while moving fast.                                                        |
| `bleedMultiplier`          | table     | `shot = 2`, `stabbed = 2`, `beat = 0`, `burned = 0` | Which wound types bleed. Any value above `0` makes the type bleed; `0` means it never bleeds. |
| `speedByLevel`             | number\[] | `{ 0.9, 0.8, 0.6, 0.4 }`                            | Movement speed for the highest injury level, from 1 to 4.                                     |
| `notifications.enabled`    | boolean   | `true`                                              | `false` hides every injury notification.                                                      |
| `notifications.cooldown`   | number    | `4500`                                              | Milliseconds between two injury notifications.                                                |
| `notifications.showOnHit`  | boolean   | `true`                                              | `true` notifies the player when they get injured.                                             |

### Effects · `injury.effects`

| Option                    | Type    | Default                               | What it does                                                   |
| ------------------------- | ------- | ------------------------------------- | -------------------------------------------------------------- |
| `limp.enabled`            | boolean | `true`                                | Enables the limp.                                              |
| `limp.minLevel`           | number  | `2`                                   | Injury level from which the player limps.                      |
| `aimShake.enabled`        | boolean | `true`                                | Enables the aim shake with an arm injury.                      |
| `aimShake.minArmLevel`    | number  | `1`                                   | Arm injury level from which it applies.                        |
| `aimShake.amplitude`      | number  | `4.0`                                 | Strength of the camera shake.                                  |
| `aimShake.deviation`      | number  | `0.2`                                 | Deviation of the shots.                                        |
| `noJump.enabled`          | boolean | `true`                                | Blocks jumping with a leg injury.                              |
| `noJump.minLegLevel`      | number  | `2`                                   | Leg injury level from which it applies.                        |
| `noJump.chance`           | number  | `20`                                  | Chance in % of falling when trying to jump.                    |
| `noSprint.enabled`        | boolean | `true`                                | Blocks sprinting when the player is slowed down.               |
| `noSprint.speedThreshold` | number  | `0.6`                                 | Movement speed below which sprint is blocked.                  |
| `blackout.enabled`        | boolean | `true`                                | Enables blackouts with head or spine injuries of level 3 or 4. |
| `blackout.cooldown`       | number  | `18`                                  | Seconds between two blackouts.                                 |
| `blackout.fadeTime`       | number  | `700`                                 | Milliseconds of the screen fade.                               |
| `blackout.duration`       | table   | `level3 = 3000`, `level4 = 4000`      | Milliseconds of the blackout by level.                         |
| `blackout.chance`         | table   | head `100` / `100`, spine `60` / `50` | Chance in % by zone and level (`level3`, `level4`).            |

## Treatment · `treatment`

| Option           | Type   | Default                                                                                  | What it does                                                                                                                                    |
| ---------------- | ------ | ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `reviveAnimMode` | string | `'fast'`                                                                                 | CPR mode used by default: `'fast'` or `'full'`.                                                                                                 |
| `treatmentTime`  | number | `9000`                                                                                   | Milliseconds to treat a wound type.                                                                                                             |
| `diagnoseTime`   | number | `7000`                                                                                   | Milliseconds to diagnose a patient.                                                                                                             |
| `range`          | number | `3.0`                                                                                    | Metres within which a medic can act on a patient.                                                                                               |
| `reviveHealth`   | table  | `100` for every wound                                                                    | Health given back on a revive, from 0 to 100, by the wound that downed the patient: `shot`, `stabbed`, `beat`, `burned`, `bleedout`, `default`. |
| `treatmentItems` | table  | `shot = 'tweezers'`, `stabbed = 'suturekit'`, `beat = 'icepack'`, `burned = 'burncream'` | Item that treats each wound type.                                                                                                               |

### CPR · `treatment.cpr`

| Option         | Type    | Default    | What it does                                                     |
| -------------- | ------- | ---------- | ---------------------------------------------------------------- |
| `full.item`    | string  | `'defib'`  | Item required for full CPR.                                      |
| `full.consume` | boolean | `false`    | `true` consumes the item on a successful revive.                 |
| `full.label`   | string  | text       | Name shown in the "You need…" message.                           |
| `fast.item`    | string  | `'medkit'` | Item required for fast CPR.                                      |
| `fast.consume` | boolean | `true`     | `true` consumes the item on a successful revive.                 |
| `fast.label`   | string  | text       | Name shown in the "You need…" message.                           |
| `maxDistance`  | number  | `5.0`      | Maximum metres between medic and patient, checked by the server. |
| `cooldownMs`   | number  | `1500`     | Milliseconds between two revives or bandages by the same medic.  |

### Bandage by zone · `treatment.bandage`

Used by the `TreatZone` export.

| Option        | Type    | Default     | What it does                                         |
| ------------- | ------- | ----------- | ---------------------------------------------------- |
| `item`        | string  | `'bandage'` | Item required.                                       |
| `consume`     | boolean | `true`      | `true` consumes the item.                            |
| `maxDistance` | number  | `3.0`       | Maximum metres between medic and patient.            |
| `cooldownMs`  | number  | `600`       | Milliseconds between two bandages by the same medic. |

## Items · `items`

| Option            | Type    | Default      | What it does                            |
| ----------------- | ------- | ------------ | --------------------------------------- |
| `revive.item`     | string  | `'defib'`    | Item that starts a revive when used.    |
| `heal.item`       | string  | `'medkit'`   | Item that heals a patient.              |
| `heal.duration`   | number  | `5000`       | Milliseconds of the heal.               |
| `heal.remove`     | boolean | `true`       | `true` consumes the item.               |
| `sedate.item`     | string  | `'sedative'` | Item that sedates a patient.            |
| `sedate.duration` | number  | `8000`       | Milliseconds the patient stays sedated. |
| `sedate.remove`   | boolean | `true`       | `true` consumes the item.               |
| `medbag.item`     | string  | `'medbag'`   | Item of the medical bag.                |
| `medbag.prop`     | string  | prop model   | Prop placed on the ground.              |

## Stretcher · `stretcher`

| Option        | Type     | Default        | What it does                                                    |
| ------------- | -------- | -------------- | --------------------------------------------------------------- |
| `enabled`     | boolean  | `true`         | `false` disables the stretcher and its commands.                |
| `model`       | string   | `'strykerpro'` | Stretcher model. It is included in the resource.                |
| `carryOffset` | table    | `x`, `y`, `z`  | Position of the stretcher relative to the medic who carries it. |
| `vehicles`    | table\[] | one example    | Vehicles that accept the stretcher.                             |

Each entry in `vehicles`:

| Field                           | Type    | What it does                                                                              |
| ------------------------------- | ------- | ----------------------------------------------------------------------------------------- |
| `model`                         | string  | Vehicle model.                                                                            |
| `dist`                          | number  | Maximum metres between the medic and the vehicle to load it.                              |
| `xOffset`, `yOffset`, `zOffset` | number  | Position of the stretcher inside the vehicle.                                             |
| `rotOffset`                     | number  | Rotation of the stretcher inside the vehicle.                                             |
| `powerload`                     | boolean | `true` attaches the stretcher to the `bonnet` bone of the vehicle instead of the chassis. |

## Finisher · `finisher`

| Option            | Type      | Default    | What it does                                           |
| ----------------- | --------- | ---------- | ------------------------------------------------------ |
| `enabled`         | boolean   | `true`     | `false` removes the finisher.                          |
| `cooldownMs`      | number    | `5000`     | Milliseconds between two finishers by the same player. |
| `maxDistance`     | number    | `4.0`      | Maximum metres between attacker and victim.            |
| `forceFinalPhase` | boolean   | `true`     | `true` sends the victim to the last phase.             |
| `weapons`         | string\[] | melee list | Weapons that allow the finisher.                       |

## Extras · `extras`

| Option                     | Type    | Default     | What it does                                                                                            |
| -------------------------- | ------- | ----------- | ------------------------------------------------------------------------------------------------------- |
| `knockout.enabled`         | boolean | `false`     | Enables the knockout by punches.                                                                        |
| `knockout.healthThreshold` | number  | `150`       | Health at or below which a punch knocks out.                                                            |
| `knockout.regainHealth`    | number  | `20`        | Health regained every second while knocked out.                                                         |
| `knockout.duration`        | number  | `7000`      | Milliseconds of the knockout.                                                                           |
| `painkillers.enabled`      | boolean | `false`     | Enables the painkiller items.                                                                           |
| `painkillers.drugEffect`   | boolean | `true`      | `true` adds a visual effect while they are active.                                                      |
| `painkillers.items`        | table   | seven items | Each item with its `duration` in seconds and its `level`, which sets the strength of the visual effect. |
| `bandage.enabled`          | boolean | `false`     | Enables the self-use bandage.                                                                           |
| `bandage.item`             | string  | `'bandage'` | Item used.                                                                                              |
| `bandage.hpRegen`          | number  | `30`        | Health restored.                                                                                        |
| `bandage.healBleed`        | boolean | `false`     | `true` also stops the bleeding.                                                                         |
| `bandage.duration`         | number  | `7000`      | Milliseconds of the action.                                                                             |

## Dispatch · `dispatch`

| Option       | Type    | Default | What it does                                                                              |
| ------------ | ------- | ------- | ----------------------------------------------------------------------------------------- |
| `cooldownMs` | number  | `5000`  | Milliseconds between two distress calls by the same player.                               |
| `police`     | boolean | `true`  | `true` also sends the call to `cuxial_police`. Ignored when that resource is not running. |

## Logs · `logs`

| Option        | Type    | Default                    | What it does                                                                     |
| ------------- | ------- | -------------------------- | -------------------------------------------------------------------------------- |
| `death`       | boolean | `true`                     | Sends each death to the webhook.                                                 |
| `revive`      | boolean | `true`                     | Sends each revive to the webhook.                                                |
| `combat`      | boolean | `true`                     | Sends a log when a player disconnects while downed.                              |
| `persistence` | boolean | `true`                     | Saves deaths, revives, heals, treatments and diagnoses to `cuxial_medical_logs`. |
| `convar`      | string  | `'cuxial_medical_webhook'` | Name of the convar that holds the webhook. Read when the resource starts.        |

## Compatibility · `compat`

| Option               | Type    | Default | What it does                                                                                                       |
| -------------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------ |
| `qbxMedicalStateBag` | boolean | `true`  | `true` also writes the player state bag `qbx_medical:deathState` (1 alive, 2 last stand, 3 dead).                  |
| `qbxMedicalEvents`   | boolean | `false` | `true` also triggers the client events `qbx_medical:client:onPlayerDied`, `onPlayerLaststand` and `playerRevived`. |
| `esxDead`            | boolean | `true`  | On ESX, tells the framework when the player is downed.                                                             |

## Hospitals · `data/hospitals.lua`

The factory list of hospitals. It ships with one example, Pillbox Hill Medical Center, placed at the outside entrance and with no beds. After the first start, edit hospitals from the panel.

| Field           | Type     | What it does                                                                                            |
| --------------- | -------- | ------------------------------------------------------------------------------------------------------- |
| `id`            | string   | Unique identifier: lowercase letters, numbers and `_`. Do not reuse it.                                 |
| `name`          | string   | Name shown on the blip and in the reception dialog.                                                     |
| `enabled`       | boolean  | `false` hides the hospital: no blip, beds, reception or respawn.                                        |
| `respawn`       | vector4  | Point where players appear. Distances to the hospital are measured from here.                           |
| `checkInRadius` | number   | Metres around `respawn` within which a check-in is accepted.                                            |
| `blip`          | table    | `enabled`, `sprite`, `color`, `scale`.                                                                  |
| `reception`     | table    | `enabled`, `coords`, `model`, `scenario`, `name`, `role`. Empty `name` and `role` use the locale texts. |
| `beds`          | table\[] | List of beds. Without beds, the patient appears at `respawn`.                                           |

Each bed:

| Field      | Type    | What it does                                                              |
| ---------- | ------- | ------------------------------------------------------------------------- |
| `model`    | string  | Bed model. It must exist in `data/beds.lua`.                              |
| `coords`   | vector4 | Position and heading of the bed prop.                                     |
| `private`  | boolean | `true` keeps the bed out of the automatic assignment.                     |
| `override` | table   | Optional. Replaces the animations of this bed, for example `anims.getup`. |

## Bed models · `data/beds.lua`

Tells the script where a player lies on each bed prop: a local `offset` and a `heading`. Add an entry for every bed model of your map before using it in a hospital.

{% code title="data/beds.lua" %}

```lua
my_map_bed = { lying = { offset = vec3(0.0, 0.0, 0.9), heading = 180.0 } },
```

{% endcode %}

## Common changes

### Add a second EMS job

In the panel, open **EMS jobs** and add the job name. In the file it looks like this:

{% code title="shared/config.lua" %}

```lua
jobs = { 'ambulance', 'doctor' },
```

{% endcode %}

### Make the players wait for the medics

In **Respawn**, enable **Check-in with medics** and set the minimum number of medics:

{% code title="shared/config.lua" %}

```lua
checkIn = { enabled = true, minMedics = 2, radius = 150.0 },
```

{% endcode %}

### Use the full CPR with the defibrillator

In **Treatment**, set the CPR animation mode to `full`:

{% code title="shared/config.lua" %}

```lua
reviveAnimMode = 'full',
```

{% endcode %}

### Let staff commands follow the framework permission

{% code title="shared/config.lua" %}

```lua
revive = { name = 'revive', restricted = false },
```

{% endcode %}

With `restricted = false` the command checks `admin.permission` instead of an ACE group. `commands` is read from the file, so restart the resource.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.cuxial.com/scripts/police-and-medical/cuxial-medical/configuration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
