Skip to content

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.

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 lists what each one adds.

Copy the resource ​

Place the cuxial_diseases folder inside your resources directory.

Keep the folder name. The items call the script as cuxial_diseases.<item>, and the optional resources look for it by that name.

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:

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

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.

On ESX, keep onboarding.enabled = false. The deadline needs the columns id and citizenid in the character table.

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.

ItemUsed for
vacuna_urbana, pastilla_rutina, caja_rutinaUrban flu: vaccine, treatment and the box that gives 7 pills.
vacuna_gripe, paracetamolFlu: vaccine and fever treatment.
suero_fisiologico, ciprofloxacinoGastroenteritis: rehydration and antibiotic.
vacuna_neumococo, amoxicilinaPneumonia: vaccine and antibiotic doses.
hiv_test, jeringa_antiviralHIV: test and antiviral injection.
rapid_testRapid test of urban flu, flu, gastroenteritis and pneumonia.

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:

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' },
    },
},

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.

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.

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:

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

The script also asks cuxial_bridge whether the player has the admin permission of your framework. Both checks must pass. See Commands & permissions.

Set the convars ​

Both are optional.

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"

Start the resource ​

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

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

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.

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.

Next: adjust the script and the catalog in Configuration.

© Cuxial