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

# Troubleshooting

Common Cuxial Medical problems, with their cause and fix.

The most frequent problems after installing Cuxial Medical, with the cause and the fix for each one.

<details>

<summary>The resource does not start</summary>

**Cause.** A dependency is missing or starts later than the script. Cuxial Medical needs OneSync, `ox_lib`, `oxmysql` and `cuxial_bridge`.

**Fix.** Enable OneSync and start the dependencies first:

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

```cfg
ensure ox_lib
ensure oxmysql
ensure cuxial_bridge
ensure cuxial_medical
```

{% endcode %}

</details>

<details>

<summary>I changed shared/config.lua or data/hospitals.lua and nothing changed in game</summary>

**Cause.** On first start the script copies those values to the database, and from then on the database copy wins for every section of the admin panel.

**Fix.** Change the option from `/medadmin`. To load the values of the file instead, restart the resource and press **Factory** on that section of the panel. The blocks `debug`, `ui`, `admin`, `commands`, `hospital` and `compat` are always read from the file and only need a restart.

</details>

<details>

<summary>Players die and respawn, get revived or teleported at random</summary>

**Cause.** Another death or ambulance script is running. Cuxial Medical provides `qb-ambulancejob` and cannot share that role.

**Fix.** Remove every other medical script from `server.cfg` and restart the server.

</details>

<details>

<summary>The death screen or the admin panel never shows</summary>

**Cause.** The interface is not loading. The folder `web/dist` is missing or incomplete, usually after a partial upload.

**Fix.** Make sure `web/dist/index.html` and the folder `web/dist/assets` exist inside the resource. If they do not, copy the resource again from the original package and restart the server.

</details>

<details>

<summary>/medadmin answers that I have no access</summary>

**Cause.** Your framework does not grant you the permission in `admin.permission` (`'admin'` by default).

**Fix.** Give yourself that permission in your framework, or change `admin.permission` in `shared/config.lua` and restart the resource.

</details>

<details>

<summary>/revive, /heal or /kill are not available to my staff</summary>

**Cause.** By default those commands are restricted to the ACE group `group.mod`, not to the framework permission.

**Fix.** Add the staff member to the group:

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

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

{% endcode %}

Or set `restricted = false` on the command in `shared/config.lua`, so it uses `admin.permission`.

</details>

<details>

<summary>"You are not on duty as EMS" when using an item</summary>

**Cause.** The job of the player is not in `jobs`, or the player is off duty. Every medical item, the medical bag and the stretcher need both.

**Fix.** Add the job in the **EMS jobs** section of the panel and go on duty with the duty system of your framework. On ESX, check that your version stores the duty state of the job.

</details>

<details>

<summary>Using a medical item does nothing</summary>

**Cause.** One of these:

* The item does not exist in your inventory under the name set in the config.
* The inventory is not one supported by `cuxial_bridge`.
* The item name was changed in the **Items** or **Extras** section of the panel and the resource has not been restarted.

**Fix.** Check the item names against `install/items.lua`, and restart the resource after changing them.

</details>

<details>

<summary>The defibrillator asks for a medkit</summary>

**Cause.** The `defib` item starts the CPR mode set in `treatment.reviveAnimMode`. The default mode, `fast`, requires and consumes the item in `treatment.cpr.fast`, a `medkit`.

**Fix.** Set `reviveAnimMode` to `full` to revive with the defibrillator only, or change the items in `treatment.cpr`.

</details>

<details>

<summary>A downed player cannot respawn</summary>

**Cause.** One of these:

* The current phase has `respawn = false`. With the defaults, the first phase does not allow it.
* `respawn.checkIn.enabled` is `true` and enough EMS are on duty.
* The player cannot pay the fee of the phase from the account in `respawn.payAccount`.

**Fix.** Wait for the next phase or for a medic, or adjust the phases in the **Death and phases** section. When the last phase ends the player respawns at no cost.

</details>

<details>

<summary>The player respawns standing at the hospital instead of in a bed</summary>

**Cause.** `respawn.useBed` is `false`, or the hospital has no free public bed. Beds marked as private are never assigned.

**Fix.** Enable `useBed` and add more public beds to the hospital.

</details>

<details>

<summary>The player lies in the air or inside the bed</summary>

**Cause.** The bed model has no entry in `data/beds.lua`, or its offset does not match the prop.

**Fix.** Add your bed model to `data/beds.lua` with the right `offset` and `heading`, restart the resource and pick that model for the beds in the panel.

</details>

<details>

<summary>Saving in the panel answers "Invalid setting shape"</summary>

**Cause.** The section did not pass the validation:

* A phase or hospital `id` is repeated, or has characters other than lowercase letters, numbers and `_`.
* A phase lasts less than 1 second, or its icon is not `heart`, `drop` or `skull`.
* The account is not `cash` or `bank`.
* A bed uses a model that is not in `data/beds.lua`.

**Fix.** Correct the value and save again.

</details>

<details>

<summary>There is no NPC at the reception</summary>

**Cause.** One of these:

* `cuxial_interactions` is not running.
* `hospital.reception.enabled` is `false`.
* The hospital is disabled, or its reception is disabled or has no position.

**Fix.** Start `cuxial_interactions`, then open **Hospitals and beds** in the panel and place the NPC with **Place**. The NPC appears without restarting.

</details>

<details>

<summary>The stretcher does not appear or cannot be loaded into the ambulance</summary>

**Cause.** One of these:

* `stretcher.enabled` is `false`.
* The player is not EMS on duty.
* `stretcher.model` was changed to a model the server does not stream.
* The vehicle model is not listed in `stretcher.vehicles`, or the medic is further than its `dist`.

**Fix.** Keep the default model, which is included in the resource, and add your ambulance models to **Compatible vehicles** in the **Stretcher** section.

</details>

<details>

<summary>The police do not receive the distress calls</summary>

**Cause.** `cuxial_police` is not running, or `dispatch.police` is `false`.

**Fix.** Start `cuxial_police` and enable **Send to cuxial\_police** in the **Dispatch** section. EMS on duty are notified in any case.

</details>

<details>

<summary>Logs do not reach Discord</summary>

**Cause.** The webhook convar is empty, has a different name from `logs.convar`, or was set after the resource started.

**Fix.** Add the convar to `server.cfg` before the resource starts. It is read once:

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

```cfg
set cuxial_medical_webhook "https://discord.com/api/webhooks/..."
```

{% endcode %}

Then check that `death`, `revive` and `combat` are enabled in the **Logs** section.

</details>

<details>

<summary>I changed a key in death.keys but the old key still works</summary>

**Cause.** `death.keys` holds only the defaults. Once a player has joined, FiveM remembers their key binding.

**Fix.** Each player changes it in the GTA settings, under key bindings for FiveM. New players get the new default after a restart.

</details>

<details>

<summary>A player joins the server already downed</summary>

**Cause.** They disconnected while downed. The state is saved with the character and restored on the next login, in the phase that matches the time elapsed.

**Fix.** None needed. It is intended. Staff can use `/revive`.

</details>

<details>

<summary>A player takes no injuries and never goes down</summary>

**Cause.** The player has the state bag `inDuel` or `inEvent`. Cuxial Medical ignores them on purpose so duel and event resources can handle death themselves. It also happens with `injury.enabled = false`, which disables injuries only.

**Fix.** Clear the state bag from the resource that set it.

</details>

<details>

<summary>Hunger and thirst are not restored after a revive on ESX</summary>

**Cause.** The script resets hunger and thirst through the player metadata `hunger` and `thirst`. Status scripts that keep their own values do not read them.

**Fix.** Reset your status script from a server hook:

```lua
exports.cuxial_medical:onTreatment('revive', function(medic, target)
    -- reset hunger and thirst of target in your status script
end)
```

</details>

<details>

<summary>Texts appear in the wrong language</summary>

**Cause.** The script follows the `ox:locale` convar. Phase labels and the name and role of the reception NPC are plain text set in the panel.

**Fix.** Set the convar in `server.cfg` and restart. `en` and `es` are included, and both files in `locales/` can be edited:

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

```cfg
setr ox:locale "en"
```

{% endcode %}

Then rename the phases in **Death and phases**.

</details>


---

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