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_liboxmysqlcuxial_bridge, connected to your frameworkox_inventoryorqb-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:
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.
| Item | Used for |
|---|---|
vacuna_urbana, pastilla_rutina, caja_rutina | Urban flu: vaccine, treatment and the box that gives 7 pills. |
vacuna_gripe, paracetamol | Flu: vaccine and fever treatment. |
suero_fisiologico, ciprofloxacino | Gastroenteritis: rehydration and antibiotic. |
vacuna_neumococo, amoxicilina | Pneumonia: vaccine and antibiotic doses. |
hiv_test, jeringa_antiviral | HIV: test and antiviral injection. |
rapid_test | Rapid 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:
['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:
add_principal identifier.license:xxxxxxxxxxxxxxxx group.adminThe 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.
# 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:
ensure ox_lib
ensure oxmysql
# your framework here
ensure ox_inventory
ensure cuxial_bridge
ensure cuxial_diseases
# optional
ensure cuxial_emotes
ensure cuxial_policeNo 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
- Start the server and look at the console. There should be no errors from
cuxial_diseases. - Join with a staff account and run
/disease list. The ids of the catalog appear. - Run
/disease symptom <your id> cough. Your character coughs. - 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. - Use the test item of that disease from your inventory. The result is positive, or inconclusive if the disease has an incubation time.
- Run
/disease cure <your id> <disease>. The case is closed.
Next: adjust the script and the catalog in Configuration.
