> 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/installation.md).

# Installation

Install Cuxial Medical step by step: dependencies, items, convars, start order and the first hospital.

Cuxial Medical needs no SQL import. It creates its own tables on first start. You only add the items to your inventory and set up your hospital.

{% stepper %}
{% step %}

## Check the dependencies

These must be installed and working before you add the script:

* OneSync enabled on the server
* `ox_lib`
* `oxmysql`
* `cuxial_bridge`, with one of its supported frameworks: QBox, QBCore or ESX
* An inventory supported by `cuxial_bridge`: `ox_inventory` or `qb-inventory`
* A target supported by `cuxial_bridge`: `sleepless_interact`, `ox_target` or `qb-target`

Two resources are optional:

* `cuxial_interactions` adds the reception NPC of each hospital. Without it there is no NPC; everything else works.
* `cuxial_police` receives the distress calls in the police dispatch. Without it only the EMS on duty are notified.

{% hint style="warning" %}
On ESX the script needs player metadata (`getMeta` / `setMeta`) and a duty flag on the job. Check both in your ESX version before installing.
{% endhint %}
{% endstep %}

{% step %}

## Copy the resource

Place the `cuxial_medical` folder inside your `resources` directory. Keep the folder name as it is: other resources call its exports by that name.
{% endstep %}

{% step %}

## Remove other medical scripts

Cuxial Medical provides `qb-ambulancejob` and controls death, respawn and revive. Stop every other death or ambulance script:

{% code title="server.cfg" %}

```cfg
# ensure qb-ambulancejob
```

{% endcode %}

{% hint style="danger" %}
Two scripts handling death at once revive, kill and teleport the same player in turns. Leave only Cuxial Medical.
{% endhint %}
{% endstep %}

{% step %}

## Add the items

The item list is in `install/items.lua`.

{% tabs %}
{% tab title="ox\_inventory" %}
Copy the content of `install/items.lua` into `ox_inventory/data/items.lua`, inside the returned table. Translate the labels if you need to.

{% code title="ox\_inventory/data/items.lua" %}

```lua
['medbag'] = {
    label = 'Medical bag',
    weight = 5000,
    stack = false,
    close = true,
},

['defib'] = {
    label = 'Defibrillator',
    weight = 2000,
    stack = false,
    close = true,
},

['medkit'] = {
    label = 'Medkit',
    weight = 1000,
    stack = true,
    close = true,
},
-- ...and the rest of install/items.lua
```

{% endcode %}
{% endtab %}

{% tab title="qb-inventory" %}
Register the same item names in your shared items file, using the names of the table below.
{% endtab %}
{% endtabs %}

| Item                                                                     | Used for                                                  | Needed when                                   |
| ------------------------------------------------------------------------ | --------------------------------------------------------- | --------------------------------------------- |
| `medbag`                                                                 | Medical bag placed on the ground                          | Always                                        |
| `defib`                                                                  | Starts a revive; required for full CPR                    | Always                                        |
| `medkit`                                                                 | Heals a patient; required and consumed by fast CPR        | Always                                        |
| `sedative`                                                               | Sedates a patient                                         | Always                                        |
| `tweezers`                                                               | Treats gunshot wounds                                     | Always                                        |
| `suturekit`                                                              | Treats stab wounds                                        | Always                                        |
| `icepack`                                                                | Treats bruises                                            | Always                                        |
| `burncream`                                                              | Treats burns                                              | Always                                        |
| `bandage`                                                                | Bandage by zone (`TreatZone` export) and self-use bandage | Only if you use either                        |
| `morphine30`, `morphine15`, `perc30`, `perc10`, `perc5`, `vic10`, `vic5` | Painkillers                                               | Only with `extras.painkillers.enabled = true` |

{% hint style="info" %}
The item names can be changed in the config. If you rename an item there, rename it in your inventory too.
{% endhint %}
{% endstep %}

{% step %}

## Set the convars

All of them are optional.

{% code title="server.cfg" %}

```cfg
# Language of the script (en and es are included)
setr ox:locale "en"

# Discord webhook for death, revive and settings logs
set cuxial_medical_webhook "https://discord.com/api/webhooks/..."

# Debug traces in the console
setr cuxial_medical_debug "0"
```

{% endcode %}

{% hint style="info" %}
The webhook goes in `server.cfg`, never in `shared/config.lua`. It is read once, when the resource starts. The name of the convar can be changed in `logs.convar`.
{% endhint %}
{% endstep %}

{% step %}

## Start the resource

Start it after its dependencies, your framework, your inventory and your target:

{% code title="server.cfg" %}

```cfg
ensure ox_lib
ensure oxmysql
# your framework here (qbx_core, qb-core or es_extended)
# your inventory and your target here
ensure cuxial_bridge
# optional
ensure cuxial_interactions
ensure cuxial_police
ensure cuxial_medical
```

{% endcode %}

No SQL to run. On first start the resource creates `cuxial_medical_settings`, `cuxial_medical_logs` and `cuxial_medical_audit`, and copies the values of `shared/config.lua` and `data/hospitals.lua` into the database.

{% hint style="warning" %}
From that first start on, the database copy wins over the files for every section shown in the admin panel. Edit those sections from `/medadmin`. See [Where settings live](/scripts/police-and-medical/cuxial-medical/configuration.md#where-settings-live).
{% endhint %}
{% endstep %}

{% step %}

## Give staff access

The admin panel and the staff commands need permissions:

* `/medadmin` uses the permission in `admin.permission` (`'admin'` by default), checked through your framework.
* `/revive`, `/heal`, `/kill` and `/mdstretcher` are restricted to the ACE group `group.mod` by default.

{% code title="server.cfg" %}

```cfg
add_principal identifier.license:xxxxxxxxxxxxxxxx group.mod
```

{% endcode %}

More detail in [Commands & permissions](/scripts/police-and-medical/cuxial-medical/commands.md).
{% endstep %}

{% step %}

## Set up your hospital

The hospital that ships in `data/hospitals.lua` is an example: Pillbox Hill Medical Center, placed at the outside entrance and with no beds. Move it to your hospital and add the beds of your interior.

1. Join as staff and type `/medadmin`.
2. Open **Hospitals and beds**.
3. Stand where players should respawn and set the respawn point with **Here**.
4. Add each bed with **Add bed here** and pick its model.
5. Place the reception NPC with **Place** (only shown in game with `cuxial_interactions`).
6. Press **Save**.
   {% endstep %}

{% step %}

## Check that it works

1. Type `/kill`. The death screen appears with the countdown.
2. Type `/revive`. You get up.
3. Give yourself the EMS job, go on duty and use a `medbag`. The bag appears on the ground.
4. Walk to a bed and use the target option to lie down.
   {% endstep %}
   {% endstepper %}

Next: see how each part works in the [Features guide](/scripts/police-and-medical/cuxial-medical/features.md) and adjust it in [Configuration](/scripts/police-and-medical/cuxial-medical/configuration.md).


---

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