Onex
Onex
Home
Products
Documentation
Changelog
Login with FiveM
  • 👋 Welcome
  • Claim Purchase
  • Translations
    • Weaponmeta
    • Voice Interaction
      Integrations
      Installation
      Configuration
      General
      Currency
      Addons
      Features
      Api
Artifacts Tracker
  1. Onex Scripts
  2. Scripts_guides / Hospital
Ctrl K

HOSPITAL#

The hospital addon enables players to speak to a hospital receptionist NPC to request treatment. The addon charges a configurable fee with optional job-based discounts and a voice confirmation step before charging.

Config file: shared/hospital/default.lua

HospitalConfig.enabled#

TypeDefault
booleantrue

Enable or disable the hospital addon entirely.

HospitalConfig.debug#

TypeDefault
booleanConfig.AddonDebug

Enable debug logging for the hospital addon. Follows the global AddonDebug setting by default.

HospitalConfig.spawnPeds#

TypeDefault
string[]{"qb-ambulancejob", "qb-medical", "esx-ambulancejob", "standalone"}

Integrations for which the addon spawns its own hospital receptionist peds. All listed integrations require the addon to create the NPCs.

HospitalConfig.spawnPeds = { 'qb-ambulancejob', 'qb-medical', 'esx-ambulancejob', 'standalone' }

HospitalConfig.pedDefaults#

Default ped model and scenario used when the addon spawns a receptionist.

HospitalConfig.pedDefaults = { model = 's_f_y_scrubs_01', scenario = 'WORLD_HUMAN_CLIPBOARD', }

HospitalConfig.npcModel#

TypeDefault
string"s_f_y_scrubs_01"

The ped model used for the hospital receptionist NPC.

HospitalConfig.proximity#

FieldTypeDefaultDescription
widthnumber3.5Box zone width around reception desk (meters)
lengthnumber4.0Box zone length around reception desk (meters)
updateIntervalnumber500How often to check proximity (ms)
HospitalConfig.proximity = { width = 3.5, length = 4.0, updateInterval = 500, }

HospitalConfig.zoneGeometry#

FieldTypeDefaultDescription
heightnumber3.0Height of the box zone in meters
HospitalConfig.zoneGeometry = { height = 3.0 }

HospitalConfig.npcDetection#

FieldTypeDefaultDescription
searchRadiusnumber8.0Primary NPC search radius (meters)
fallbackSearchRadiusnumber12.0Fallback radius if primary finds nothing
waitForSpawnnumber500Max ms to retry NPC detection after zone entry
greetingDelaynumber0Delay (ms) before NPC delivers automatic greeting
HospitalConfig.npcDetection = { searchRadius = 8.0, fallbackSearchRadius = 12.0, waitForSpawn = 500, greetingDelay = 0, }

HospitalConfig.fee#

FieldTypeDefaultDescription
basenumber1500Base treatment cost. Set to 0 for free treatment (skips confirmation)
moneyTypestring"cash"Payment account — "cash" or "bank"
jobDiscountstable—Per-job discount multipliers (see below)

Job discounts are keyed by job name and define the fraction of the base fee that is waived.

HospitalConfig.fee = { base = 1500, moneyType = 'cash', jobDiscounts = { police = 0.3, -- 30% off for police ambulance = 0.0, -- Free for EMS fire = 0.15, -- 15% off for fire department }, }

Setting base = 0 makes treatment free for everyone and skips the confirmation step entirely.

HospitalConfig.confirmation#

Voice confirmation step before charging the player.

FieldTypeDefaultDescription
enabledbooleantrueRequire player to confirm before charging
timeoutnumber12000Ms before unconfirmed request is auto-cancelled
HospitalConfig.confirmation = { enabled = true, timeout = 12000, }

HospitalConfig.progressBar#

Progress bar shown during the revive sequence on the standalone / no-ambulancejob path.

FieldTypeDefaultDescription
durationnumber6000Duration of the progress bar in ms
HospitalConfig.progressBar = { duration = 6000, }

HospitalConfig.matching#

Per-intent similarity thresholds. Lower values allow less exact matches.

HospitalConfig.matching = { revive = 0.65, health = 0.70, price = 0.68, confirm = 0.60, cancel = 0.60, }

HospitalConfig.feedback#

HospitalConfig.feedback.enabled#

TypeDefault
booleantrue

Master toggle for NPC TTS speech responses.

HospitalConfig.feedback.responseToggles#

Individual toggles for each response category.

HospitalConfig.feedback.responseToggles = { greeting = true, -- greet player on entry farewell = true, -- farewell on exit revive = true, -- revive/treatment responses health = true, -- health inquiry responses price = true, -- price inquiry responses confirmation = true, -- "please confirm" prompts errors = true, -- insufficient funds, etc. }

HospitalConfig.feedbackTiming#

FieldDefaultDescription
responseCooldown1000 msMinimum time between NPC responses
duplicatePrevention5000 msSuppress duplicate responses within this window
HospitalConfig.feedbackTiming = { responseCooldown = 1000, duplicatePrevention = 5000, }

Last updated 3 months ago

Quick Links

All DocumentationOur Products