Skip to content

Configuration

Every option of Cuxial Medical explained: config file, hospitals, beds and where each setting is stored.

Cuxial Medical is configured in shared/config.lua, in data/hospitals.lua and, for most options, live from the admin panel. This page lists every option and tells you where to change it.

Where settings live ​

On first start the script copies most of shared/config.lua and the whole of data/hospitals.lua into the database table cuxial_medical_settings. From then on the database copy wins.

SectionEdited in the panelRestart needed
jobs, death, respawn, injury, treatment, stretcher, finisher, dispatch, logsYesNo
items, extrasYesYes, to apply completely
data/hospitals.luaYesNo
debug, ui, admin, commands, hospital, wounds, compatNo, file onlyYes
data/beds.lua and the other files in data/No, file onlyYes

After the first start, change the panel sections from /medadmin. To load the values of the file again, edit the file, restart the resource and press Factory on that section.

General ​

OptionTypeDefaultWhat it does
debugbooleanfalsePrints traces to the console. Also enabled by setting the convar cuxial_medical_debug to 1.

Interface · ui ​

OptionTypeDefaultWhat it does
accentstring (hex)configurableAccent colour of the admin panel.
deathAccentstring (hex)configurableColour of the death screen.

Staff · admin ​

OptionTypeDefaultWhat it does
permissionstring'admin'Framework permission needed to open the panel and to use the staff commands that have restricted = false.

Commands · commands ​

Each entry has a name and a restricted value. An empty name disables the command.

EntryDefault nameDefault restrictedCommand
adminmedadminfalseOpens the admin panel.
reviverevive'group.mod'Revives a player.
healheal'group.mod'Heals a player.
killkill'group.mod'Kills a player.
stretcherstretcherfalsePlaces or picks up a stretcher.
delstretcherdelstretcherfalseRemoves the nearest stretcher.
mdstretchermdstretcher'group.mod'Removes every stretcher.
test2medtest2'group.admin'Staff test of visible wounds.
test4medtest4'group.admin'Staff test of paramedic animations.

restricted accepts an ACE group as a string, or false. With false, the staff commands (revive, heal, kill, mdstretcher) fall back to admin.permission. See Commands & permissions.

EMS jobs · jobs ​

OptionTypeDefaultWhat it does
jobsstring[]{ 'ambulance' }Job names that count as EMS. A player must also be on duty.

Death · death ​

Phases · death.phases ​

An ordered list. A downed player goes through the phases one after another. At least one phase is required.

FieldTypeWhat it does
idstringUnique identifier: lowercase letters, numbers and _.
labelstringName shown on the death screen.
iconstring'heart', 'drop' or 'skull'.
durationnumberSeconds the phase lasts. Minimum 1.
respawnbooleantrue lets the player hold the respawn key during this phase.
costnumberFee charged when respawning in this phase. 0 = free.
laststandbooleantrue lets the player crawl during this phase.

Phase labels are free text. Write them from the panel in the language of your server.

Voice · death.mute ​

OptionTypeDefaultWhat it does
enabledbooleantruetrue mutes downed players. false never mutes them.
fromPhasenumber2First phase in which the player is muted.
holdMsnumber3000Milliseconds the mute is kept after respawning or checking in.

Zoom · death.zoom ​

OptionTypeDefaultWhat it does
enabledbooleantruetrue lets downed players zoom the camera.
fovnumber22.0Field of view while zooming. Lower is closer.
smoothnumber0.12Speed of the transition, from 0 to 1. Higher is faster.

Other ​

OptionTypeDefaultWhat it does
nearbyWarning.enabledbooleantruetrue asks for confirmation before respawning when other players are near.
nearbyWarning.radiusnumber30.0Radius in metres for that check.
holdMsnumber5000Milliseconds the respawn key must be held.

Keys · death.keys ​

Default keys. Each player can rebind them in the GTA key settings.

OptionDefaultAction
callEms'G'Call EMS while downed.
respawn'E'Hold to respawn.
zoom'MOUSE_RIGHT'Zoom while downed.
getUp'E'Get up from a hospital bed.
stretcherDrop'X'Drop the stretcher, or get up from it.
stretcherUse'E'Load the stretcher into a vehicle.

Respawn · respawn ​

OptionTypeDefaultWhat it does
payAccountstring'bank'Account charged for the respawn fee: 'bank' or 'cash'.
useBedbooleantruetrue wakes the player up in a hospital bed with a treatment. false places them at the respawn point.
clearInventorybooleanfalsetrue empties the inventory when a downed player respawns at the hospital. Revives never clear it.
keepItemsstring[]{}Items kept when the inventory is cleared.
checkIn.enabledbooleanfalsetrue blocks respawn and check-in while enough EMS are on duty.
checkIn.minMedicsnumber1EMS on duty needed to block.
bedReserveSecondsnumber60Seconds a bed stays reserved for a player on the way to it. Minimum 5.

Reception · hospital.reception ​

Defaults for the reception NPC. The NPC of each hospital is set in the panel.

OptionTypeDefaultWhat it does
enabledbooleantruefalse removes every reception NPC.
resourcestring'cuxial_interactions'Resource that creates the NPC and its dialog.
modelstring's_f_y_scrubs_01'Ped model used when a hospital does not set one.
scenariostring'WORLD_HUMAN_CLIPBOARD'Scenario used when a hospital does not set one.
distancenumber2.5Metres from which the NPC can be talked to.
feetOffsetnumber1.0Height correction applied while placing the NPC from the panel.
previewAlphanumber170Opacity of the placement preview, from 0 to 255.
modelTimeoutnumber5000Milliseconds to wait for the preview model.
maxLennumber48Maximum length of the model, scenario, name and role texts.
modelsstring[]listPed models offered in the panel.
scenariosstring[]listScenarios offered in the panel.

Injuries · injury ​

OptionTypeDefaultWhat it does
enabledbooleantruefalse disables injuries completely.
trackingOnlybooleanfalsetrue records injuries without effects or bleeding.
damageThresholdnumber10Minimum health lost in one hit to cause an injury.
armourThresholdnumber5Minimum armour lost in one hit to cause an injury.
injuryChancenumber90Chance in % that a qualifying hit leaves an injury.
stackLimitnumber4Maximum level and maximum bleeding of one injury.
bleedEnabledbooleantruefalse stops all health loss by bleeding.
bleedTickIntervalnumber10Seconds between bleeding ticks.
bleedMovement.enabledbooleantruetrue increases the bleeding while moving fast.
bleedMovement.runSpeednumber2.0Speed above which the multiplier applies.
bleedMovement.multipliernumber2.0Bleeding multiplier while moving fast.
bleedMultipliertableshot = 2, stabbed = 2, beat = 0, burned = 0Which wound types bleed. Any value above 0 makes the type bleed; 0 means it never bleeds.
speedByLevelnumber[]{ 0.9, 0.8, 0.6, 0.4 }Movement speed for the highest injury level, from 1 to 4.
notifications.enabledbooleantruefalse hides every injury notification.
notifications.cooldownnumber4500Milliseconds between two injury notifications.
notifications.showOnHitbooleantruetrue notifies the player when they get injured.

Effects · injury.effects ​

OptionTypeDefaultWhat it does
limp.enabledbooleantrueEnables the limp.
limp.minLevelnumber2Injury level from which the player limps.
aimShake.enabledbooleantrueEnables the aim shake with an arm injury.
aimShake.minArmLevelnumber1Arm injury level from which it applies.
aimShake.amplitudenumber4.0Strength of the camera shake.
aimShake.deviationnumber0.2Deviation of the shots.
noJump.enabledbooleantrueBlocks jumping with a leg injury.
noJump.minLegLevelnumber2Leg injury level from which it applies.
noJump.chancenumber20Chance in % of falling when trying to jump.
noSprint.enabledbooleantrueBlocks sprinting when the player is slowed down.
noSprint.speedThresholdnumber0.6Movement speed below which sprint is blocked.
blackout.enabledbooleantrueEnables blackouts with head or spine injuries of level 3 or 4.
blackout.cooldownnumber18Seconds between two blackouts.
blackout.fadeTimenumber700Milliseconds of the screen fade.
blackout.durationtablelevel3 = 3000, level4 = 4000Milliseconds of the blackout by level.
blackout.chancetablehead 100 / 100, spine 60 / 50Chance in % by zone and level (level3, level4).

Visible wounds · wounds ​

Wounds that everyone can see on a player, according to the cause of death: damage packs, decals and blood on the body. They are read from the file and need a restart.

OptionTypeDefaultWhat it does
enabledbooleantruefalse turns visible wounds off.
healMinutesnumber20Minutes the player keeps hospital bandages after being revived or leaving the hospital.

Which wound each cause shows is defined in data/wounds.lua. Each cause is a list of layers, and each layer uses pack, decal or blood with damage, mult, zone, x, y, rot and scale. byWeapon and byCategory link weapons to causes, and heal sets the bandage stage shown after a revive.

Treatment · treatment ​

OptionTypeDefaultWhat it does
reviveAnimModestring'fast'CPR mode used by default: 'fast' or 'full'.
treatmentTimenumber9000Milliseconds to treat a wound type.
diagnoseTimenumber7000Milliseconds to diagnose a patient.
rangenumber3.0Metres within which a medic can act on a patient.
reviveHealthtable100 for every woundHealth given back on a revive, from 0 to 100, by the wound that downed the patient: shot, stabbed, beat, burned, bleedout, default.
treatmentItemstableshot = 'tweezers', stabbed = 'suturekit', beat = 'icepack', burned = 'burncream'Item that treats each wound type.

CPR · treatment.cpr ​

OptionTypeDefaultWhat it does
full.itemstring'defib'Item required for full CPR.
full.consumebooleanfalsetrue consumes the item on a successful revive.
full.labelstringtextName shown in the "You need…" message.
fast.itemstring'medkit'Item required for fast CPR.
fast.consumebooleantruetrue consumes the item on a successful revive.
fast.labelstringtextName shown in the "You need…" message.
maxDistancenumber5.0Maximum metres between medic and patient, checked by the server.
cooldownMsnumber1500Milliseconds between two revives or bandages by the same medic.

Bandage by zone · treatment.bandage ​

Used by the TreatZone export.

OptionTypeDefaultWhat it does
itemstring'bandage'Item required.
consumebooleantruetrue consumes the item.
hpByZonetablehead = 15, neck = 8, spine = 12, upper_body = 18, lower_body = 15, left_arm = 8, right_arm = 8, left_leg = 8, right_leg = 8Health restored by a bandage on each of the nine zones.
defaultHpnumber10Health restored when the zone is not in hpByZone.
maxDistancenumber3.0Maximum metres between medic and patient.
cooldownMsnumber600Milliseconds between two bandages by the same medic.

Items · items ​

OptionTypeDefaultWhat it does
revive.itemstring'defib'Item that starts a revive when used.
heal.itemstring'medkit'Item that heals a patient.
heal.durationnumber5000Milliseconds of the heal.
heal.removebooleantruetrue consumes the item.
sedate.itemstring'sedative'Item that sedates a patient.
sedate.durationnumber8000Milliseconds the patient stays sedated.
sedate.removebooleantruetrue consumes the item.
medbag.itemstring'medbag'Item of the medical bag.
medbag.propstringprop modelProp placed on the ground.

Stretcher · stretcher ​

OptionTypeDefaultWhat it does
enabledbooleantruefalse disables the stretcher and its commands.
modelstring'strykerpro'Stretcher model. It is included in the resource.
carryOffsettablex, y, zPosition of the stretcher relative to the medic who carries it.
vehiclestable[]one exampleVehicles that accept the stretcher.

Each entry in vehicles:

FieldTypeWhat it does
modelstringVehicle model.
distnumberMaximum metres between the medic and the vehicle to load it.
xOffset, yOffset, zOffsetnumberPosition of the stretcher inside the vehicle.
rotOffsetnumberRotation of the stretcher inside the vehicle.
powerloadbooleantrue attaches the stretcher to the bonnet bone of the vehicle instead of the chassis.

Finisher · finisher ​

OptionTypeDefaultWhat it does
enabledbooleantruefalse removes the finisher.
cooldownMsnumber5000Milliseconds between two finishers by the same player.
maxDistancenumber4.0Maximum metres between attacker and victim.
forceFinalPhasebooleantruetrue sends the victim to the last phase.
weaponsstring[]melee listWeapons that allow the finisher.

Extras · extras ​

OptionTypeDefaultWhat it does
knockout.enabledbooleanfalseEnables the knockout by punches.
knockout.healthThresholdnumber150Health at or below which a punch knocks out.
knockout.regainHealthnumber20Health regained every second while knocked out.
knockout.durationnumber7000Milliseconds of the knockout.
painkillers.enabledbooleanfalseEnables the painkiller items.
painkillers.drugEffectbooleantruetrue adds a visual effect while they are active.
painkillers.itemstableseven itemsEach item with its duration in seconds and its level, which sets the strength of the visual effect.
bandage.enabledbooleanfalseEnables the self-use bandage.
bandage.itemstring'bandage'Item used.
bandage.hpRegennumber30Health restored.
bandage.healBleedbooleanfalsetrue also stops the bleeding.
bandage.durationnumber7000Milliseconds of the action.

Dispatch · dispatch ​

OptionTypeDefaultWhat it does
cooldownMsnumber5000Milliseconds between two distress calls by the same player.
policebooleantruetrue also sends the call to cuxial_police. Ignored when that resource is not running.

Logs · logs ​

OptionTypeDefaultWhat it does
deathbooleantrueSends each death to the webhook.
revivebooleantrueSends each revive to the webhook.
combatbooleantrueSends a log when a player disconnects while downed.
persistencebooleantrueSaves deaths, revives, heals, treatments and diagnoses to cuxial_medical_logs.
convarstring'cuxial_medical_webhook'Name of the convar that holds the webhook. Read when the resource starts.

Compatibility · compat ​

OptionTypeDefaultWhat it does
qbxMedicalStateBagbooleantruetrue also writes the player state bag qbx_medical:deathState (1 alive, 2 last stand, 3 dead).
qbxMedicalEventsbooleanfalsetrue also triggers the client events qbx_medical:client:onPlayerDied, onPlayerLaststand and playerRevived.
esxDeadbooleantrueOn ESX, tells the framework when the player is downed.

Hospitals · data/hospitals.lua ​

The factory list of hospitals. It ships with one example, Pillbox Hill Medical Center, placed at the outside entrance and with no beds. After the first start, edit hospitals from the panel.

FieldTypeWhat it does
idstringUnique identifier: lowercase letters, numbers and _. Do not reuse it.
namestringName shown on the blip and in the reception dialog.
enabledbooleanfalse hides the hospital: no blip, beds, reception or respawn.
respawnvector4Point where players appear. Distances to the hospital are measured from here.
checkInRadiusnumberMetres around respawn within which a check-in is accepted.
bliptableenabled, sprite, color, scale.
receptiontableenabled, coords, model, scenario, name, role. Empty name and role use the locale texts.
bedstable[]List of beds. Without beds, the patient appears at respawn.

Each bed:

FieldTypeWhat it does
modelstringBed model. It must exist in data/beds.lua.
coordsvector4Position and heading of the bed prop.
privatebooleantrue keeps the bed out of the automatic assignment.
overridetableOptional. Replaces the animations of this bed, for example anims.getup.

Bed models · data/beds.lua ​

Tells the script where a player lies on each bed prop: a local offset and a heading. Add an entry for every bed model of your map before using it in a hospital.

data/beds.lua
lua
my_map_bed = { lying = { offset = vec3(0.0, 0.0, 0.9), heading = 180.0 } },

Common changes ​

Add a second EMS job ​

In the panel, open EMS jobs and add the job name. In the file it looks like this:

shared/config.lua
lua
jobs = { 'ambulance', 'doctor' },

Make the players wait for the medics ​

In Respawn, enable Check-in with medics and set the minimum number of medics:

shared/config.lua
lua
checkIn = { enabled = true, minMedics = 2, radius = 150.0 },

Use the full CPR with the defibrillator ​

In Treatment, set the CPR animation mode to full:

shared/config.lua
lua
reviveAnimMode = 'full',

Let staff commands follow the framework permission ​

shared/config.lua
lua
revive = { name = 'revive', restricted = false },

With restricted = false the command checks admin.permission instead of an ACE group. commands is read from the file, so restart the resource.

© Cuxial