Skip to content

Installation

Install Cuxial Medical step by step: dependencies, items, convars, start order and the first hospital.

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_lib
  • oxmysql
  • cuxial_bridge 2.24.1 or later, with one of its supported frameworks: QBox, QBCore or ESX
  • An inventory supported by cuxial_bridge: ox_inventory or qb-inventory
  • A target supported by cuxial_bridge: sleepless_interact, ox_target or qb-target

Two resources are optional:

  • cuxial_interactions adds the reception NPC of each hospital. Without it there is no NPC; everything else works.
  • cuxial_police receives 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:

server.cfg
cfg
# ensure qb-ambulancejob

Two 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.

ox_inventory/data/items.lua
lua
['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
ItemUsed forNeeded when
medbagMedical bag placed on the groundAlways
defibStarts a revive; required for full CPRAlways
medkitHeals a patient; required and consumed by fast CPRAlways
sedativeSedates a patientAlways
tweezersTreats gunshot woundsAlways
suturekitTreats stab woundsAlways
icepackTreats bruisesAlways
burncreamTreats burnsAlways
bandageBandage by zone (TreatZone export) and self-use bandageOnly if you use either
morphine30, morphine15, perc30, perc10, perc5, vic10, vic5PainkillersOnly 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.

server.cfg
cfg
# 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:

server.cfg
cfg
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_medical

No 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:

  • /medadmin uses the permission in admin.permission ('admin' by default), checked through your framework.
  • /revive, /heal, /kill and /mdstretcher are restricted to the ACE group group.mod by default.
server.cfg
cfg
add_principal identifier.license:xxxxxxxxxxxxxxxx group.mod

More 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.

  1. Join as staff and type /medadmin.
  2. Open Hospitals and beds.
  3. Stand where players should respawn and set the respawn point with Here.
  4. Add each bed with Add bed here and pick its model.
  5. Place the reception NPC with Place (only shown in game with cuxial_interactions).
  6. Press Save.

Check that it works ​

  1. Type /kill. The death screen appears with the countdown.
  2. Type /revive. You get up.
  3. Give yourself the EMS job, go on duty and use a medbag. The bag appears on the ground.
  4. 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.

© Cuxial