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.
Check the dependencies
These must be installed and working before you add the script:
- OneSync enabled on the server
ox_liboxmysqlcuxial_bridge2.24.1 or later, with one of its supported frameworks: QBox, QBCore or ESX- An inventory supported by
cuxial_bridge:ox_inventoryorqb-inventory - A target supported by
cuxial_bridge:sleepless_interact,ox_targetorqb-target
Two resources are optional:
cuxial_interactionsadds the reception NPC of each hospital. Without it there is no NPC; everything else works.cuxial_policereceives the distress calls in the police dispatch. Without it only the EMS on duty are notified.
On ESX the script needs player metadata (getMeta / setMeta) and a duty flag on the job. Check both in your ESX version before installing.
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.
Remove other medical scripts
Cuxial Medical provides qb-ambulancejob and controls death, respawn and revive. Stop every other death or ambulance script:
# ensure qb-ambulancejobTwo scripts handling death at once revive, kill and teleport the same player in turns. Leave only Cuxial Medical.
Add the items
The item list is in install/items.lua.
Copy the content of install/items.lua into ox_inventory/data/items.lua, inside the returned table. Translate the labels if you need to.
['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| 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 |
The item names can be changed in the config. If you rename an item there, rename it in your inventory too.
Set the convars
All of them are optional.
# 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"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.
Start the resource
Start it after its dependencies, your framework, your inventory and your target:
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_medicalNo 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.
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.
Give staff access
The admin panel and the staff commands need permissions:
/medadminuses the permission inadmin.permission('admin'by default), checked through your framework./revive,/heal,/killand/mdstretcherare restricted to the ACE groupgroup.modby default.
add_principal identifier.license:xxxxxxxxxxxxxxxx group.modMore detail in Commands & permissions.
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.
- Join as staff and type
/medadmin. - Open Hospitals and beds.
- Stand where players should respawn and set the respawn point with Here.
- Add each bed with Add bed here and pick its model.
- Place the reception NPC with Place (only shown in game with
cuxial_interactions). - Press Save.
Check that it works
- Type
/kill. The death screen appears with the countdown. - Type
/revive. You get up. - Give yourself the EMS job, go on duty and use a
medbag. The bag appears on the ground. - Walk to a bed and use the target option to lie down.
Next: see how each part works in the Features guide and adjust it in Configuration.
