Skip to Content
Cobalt

cobalt_ambulancejob

Downed players, revives, treatment and hospitals.

ExportSideWhat it does
GetDeathStateServerThe player's death state.
RevivePlayerServerRevives the player in place and refills hunger, thirst and stress.
KillPlayerServerKills the player outright, skipping last stand, from alive, knocked out or last stand.
GetPrescriptionsServerThe character's prescriptions, newest first.
FillPrescriptionServerRecords a pharmacy fill.
GetSharedReportsServerFiled reports a doctor has shared with police for this character.
UseMdtServerThe ems_tablet item's server export.
UseTreatmentClientThe treatment items' client export (bandage, splint, burn_dressing, tourniquet, defibrillator).

GetDeathState

Server

The player's death state. down is last stand that can still be revived on scene; a player past bleed-out reads dead. Compare it for a yes/no, such as ~= 'alive' for anyone incapacitated.

exports.cobalt_ambulancejob:GetDeathState(source)
ParameterTypeOptionalDescription
sourceintegerNo
ReturnsDescription
AmbulanceReviveStateName
Example
local reviveStateName = exports.cobalt_ambulancejob:GetDeathState(source)

RevivePlayer

Server

Revives the player in place and refills hunger, thirst and stress.

exports.cobalt_ambulancejob:RevivePlayer(target)
ParameterTypeOptionalDescription
targetintegerNo
ReturnsDescription
booleanok
'not_online'?err
Example
local ok, err = exports.cobalt_ambulancejob:RevivePlayer(source)

KillPlayer

Server

Kills the player outright, skipping last stand, from alive, knocked out or last stand. False when they are already dead.

exports.cobalt_ambulancejob:KillPlayer(target)
ParameterTypeOptionalDescription
targetintegerNo
ReturnsDescription
boolean
Example
local ok = exports.cobalt_ambulancejob:KillPlayer(source)

GetPrescriptions

Server

The character's prescriptions, newest first.

exports.cobalt_ambulancejob:GetPrescriptions(citizenid)
ParameterTypeOptionalDescription
citizenidstringNo
ReturnsDescription
AmbulancePrescription[]
Example
local prescriptions = exports.cobalt_ambulancejob:GetPrescriptions('ABC12345')

FillPrescription

Server

Records a pharmacy fill. Every fill after the first uses a refill, so a prescription fills refills + 1 times. False when the prescription is cancelled, expired or out of refills.

exports.cobalt_ambulancejob:FillPrescription(citizenid, id, pharmacy)
ParameterTypeOptionalDescription
citizenidstringNo
idintegerNo
pharmacystringNo
ReturnsDescription
boolean
Example
local ok = exports.cobalt_ambulancejob:FillPrescription('ABC12345', 1, 'pillbox')

GetSharedReports

Server

Filed reports a doctor has shared with police for this character.

exports.cobalt_ambulancejob:GetSharedReports(citizenid)
ParameterTypeOptionalDescription
citizenidstringNo
ReturnsDescription
AmbulanceReportSummary[]
Example
local reportSummaries = exports.cobalt_ambulancejob:GetSharedReports('ABC12345')

UseMdt

Server

The ems_tablet item's server export. On usedItem it opens the EMS MDT, or cobalt_police's for police officers who aren't medics.

exports.cobalt_ambulancejob:UseMdt(event, item, inventory)
ParameterTypeOptionalDescription
event'usingItem' | 'usedItem'No
itemtableNo
inventorytableNo
Example
exports.cobalt_ambulancejob:UseMdt(
    'usingItem',
    { name = 'mdt_tablet' },
    { id = 'ABC12345', source = source }
)

UseTreatment

Client

The treatment items' client export (bandage, splint, burn_dressing, tourniquet, defibrillator). On usedItem it treats the closest patient, or the player, from a body-part menu; the defibrillator revives the closest patient.

exports.cobalt_ambulancejob:UseTreatment(event, item)
ParameterTypeOptionalDescription
event'usingItem' | 'usedItem'No
itemtableNo
Example
exports.cobalt_ambulancejob:UseTreatment('usingItem', { name = 'bandage' })

On this page