Browse docs

Treatment

Reference for Treatment in ambulancejob.

All client exports

Treatment

OpenTreatment(serverId?)

Starts the normal diagnosis and treatment workflow from your own client-side radial or interaction menu. Available to eligible medics and authorized Public Treatment responders.

-- Treat the nearest eligible patient within the configured interaction distance.
local started, reason = exports["sky_ambulancejob"]:OpenTreatment()
-- Treat a specific patient using their server ID.
local started, reason = exports["sky_ambulancejob"]:OpenTreatment(serverId)
ArgumentTypeDescription
serverIdnumber?Optional patient server ID. Omit it to select the nearest eligible patient. Pass a server ID, not a local player index or ped handle.

The targeted player must be nearby and streamed on the calling client. For your own injuries, use OpenSelfDiagnose().

Return valueTypeDescription
startedbooleanWhether the workflow was accepted. Preparation, cancellation or subsequent server validation can still prevent the diagnosis UI from opening.
reasonstring | table | nilImmediate rejection reason when started is false. Examples include no_patient, busy, missing_gear, not_authorized, public_conscious_blocked and too_far. A revival block returns a table with reason = "revive_blocked" and patient/revival context.

Call the export from a client event/menu callback or a CreateThread, because it waits for server callbacks. Add dependency "sky_ambulancejob" to your resource's fxmanifest.lua. Close your radial menu before calling the export so that the menu's focus cleanup does not interfere with diagnosis.

The export keeps the normal server-side access, required-item, patient-state and distance checks. For non-medics, enable Public Treatment and configure its conscious-patient policy. Disabling Keyboard interaction enabled hides the public E prompt and disables its key while both export forms remain available. See Public Treatment and radial menus for the settings.