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

# Installation

Install Cuxial Diseases step by step: dependencies, items, permissions and start order.

Cuxial Diseases needs no SQL import. It creates its own tables on first start. It does need a few inventory items and one decision before you start it for the first time.

{% 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`, connected to your framework
* `ox_inventory` or `qb-inventory`

Optional: `cuxial_police`, `cuxial_medical`, `cuxial_emotes` and `lb-phone`. The [overview](/scripts/police-and-medical/cuxial-diseases.md#what-works-without-the-optional-resources) lists what each one adds.
{% endstep %}

{% step %}

## Copy the resource

Place the `cuxial_diseases` folder inside your `resources` directory.

{% hint style="warning" %}
Keep the folder name. The items call the script as `cuxial_diseases.<item>`, and the optional resources look for it by that name.
{% endhint %}
{% endstep %}

{% step %}

## Decide the vaccination deadline

The vaccination deadline is off by default. When it is on, every character gets a deadline to be vaccinated and falls ill when it expires. With `applyToExisting = true` this includes the characters that already exist on your server: they get 72 real hours, counted from their first login.

To use it, open `shared/config.lua` and set the `onboarding` block **before the first start**:

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

```lua
onboarding = {
    enabled = true,           -- false = no vaccination deadline at all
    applyToExisting = false,  -- true = also the characters that already exist
    -- ...
},
```

{% endcode %}

{% hint style="danger" %}
If you enable it, the vaccine item must exist in your inventory and players need a way to get it. Otherwise everyone ends up sick with no way to avoid it.
{% endhint %}

{% hint style="warning" %}
On ESX, keep `onboarding.enabled = false`. The deadline needs the columns `id` and `citizenid` in the character table.
{% endhint %}
{% endstep %}

{% step %}

## Add the items

The catalog refers to items by name: a test, a treatment, a vaccine, a box of pills. Every item named in `data/diseases.lua` must exist in your inventory.

Three of them come ready in `install/items.lua`: the antiretroviral treatment, the rapid test and the face mask. The rest of the items used by the included catalog are examples; create them with the names you find in `data/diseases.lua`, or change those names to items you already have.

{% tabs %}
{% tab title="ox\_inventory" %}
Copy the entries of `install/items.lua` into `ox_inventory/data/items.lua`. For any other catalog item, use the same shape and point `server.export` to the script with the item name:

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

```lua
['rapid_test'] = {
    label = 'Rapid test',
    weight = 20,
    stack = true,
    close = true,
    description = 'Quick test for common infections.',
    server = {
        export = 'cuxial_diseases.rapid_test',
    },
    client = {
        usetime = 4000,
        anim = { dict = 'mp_common', clip = 'givetake1_a' },
    },
},
```

{% endcode %}

The script registers one export per item that the catalog uses as `test.item`, `treatment.item`, `treatment.box.item` or `vaccine.item`. The face mask needs no export: it only has to be in the inventory.
{% endtab %}

{% tab title="qb-inventory" %}
Add the items to the item list of your framework, with the same names used in `data/diseases.lua`. The script registers them as usable items when it starts and removes one unit each time one is used.
{% endtab %}
{% endtabs %}

{% hint style="info" %}
With Cuxial Police installed, the medicines and vaccines that it already defines keep their own item definition. Cuxial Police passes each use on to Cuxial Diseases, which counts the dose or the vaccine.
{% endhint %}
{% endstep %}

{% step %}

## Give your staff the permission

The staff commands are limited to the ACE group in `admin.restricted`, `group.admin` by default. Your staff must belong to it:

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

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

{% endcode %}

The script also asks `cuxial_bridge` whether the player has the `admin` permission of your framework. Both checks must pass. See [Commands & permissions](/scripts/police-and-medical/cuxial-diseases/commands.md#permissions).
{% endstep %}

{% step %}

## Set the convars

Both are optional.

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

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

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

{% endcode %}
{% endstep %}

{% step %}

## Start the resource

Start it after its dependencies and before the optional resources that use it:

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

```cfg
ensure ox_lib
ensure oxmysql
# your framework here
ensure ox_inventory
ensure cuxial_bridge
ensure cuxial_diseases
# optional
ensure cuxial_emotes
ensure cuxial_police
```

{% endcode %}

No SQL to run. On start the resource creates `cuxial_disease_cases`, `cuxial_disease_immunity`, `cuxial_disease_log`, `cuxial_disease_onboarding`, `cuxial_disease_pregnancies` and `cuxial_disease_meta`.
{% endstep %}

{% step %}

## Check that it works

1. Start the server and look at the console. There should be no errors from `cuxial_diseases`.
2. Join with a staff account and run `/disease list`. The ids of the catalog appear.
3. Run `/disease symptom <your id> cough`. Your character coughs.
4. Pick an id from the list and run `/disease infect <your id> <disease>`, then `/disease status <your id>`. The case is listed with its stage.
5. Use the test item of that disease from your inventory. The result is positive, or inconclusive if the disease has an incubation time.
6. Run `/disease cure <your id> <disease>`. The case is closed.
   {% endstep %}
   {% endstepper %}

Next: adjust the script and the catalog in [Configuration](/scripts/police-and-medical/cuxial-diseases/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-diseases/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.
