cobalt_ambulancejob
Downed players, revives, treatment and hospitals.
| Export | Side | What it does |
|---|---|---|
GetDeathState | Server | The player's death state. |
RevivePlayer | Server | Revives the player in place and refills hunger, thirst and stress. |
KillPlayer | Server | Kills the player outright, skipping last stand, from alive, knocked out or last stand. |
GetPrescriptions | Server | The character's prescriptions, newest first. |
FillPrescription | Server | Records a pharmacy fill. |
GetSharedReports | Server | Filed reports a doctor has shared with police for this character. |
UseMdt | Server | The ems_tablet item's server export. |
UseTreatment | Client | The treatment items' client export (bandage, splint, burn_dressing, tourniquet, defibrillator). |
GetDeathState
ServerThe 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)| Parameter | Type | Optional | Description |
|---|---|---|---|
source | integer | No |
| Returns | Description |
|---|---|
AmbulanceReviveStateName |
local reviveStateName = exports.cobalt_ambulancejob:GetDeathState(source)RevivePlayer
ServerRevives the player in place and refills hunger, thirst and stress.
exports.cobalt_ambulancejob:RevivePlayer(target)| Parameter | Type | Optional | Description |
|---|---|---|---|
target | integer | No |
| Returns | Description |
|---|---|
boolean | ok |
'not_online'? | err |
local ok, err = exports.cobalt_ambulancejob:RevivePlayer(source)KillPlayer
ServerKills the player outright, skipping last stand, from alive, knocked out or last stand. False when they are already dead.
exports.cobalt_ambulancejob:KillPlayer(target)| Parameter | Type | Optional | Description |
|---|---|---|---|
target | integer | No |
| Returns | Description |
|---|---|
boolean |
local ok = exports.cobalt_ambulancejob:KillPlayer(source)GetPrescriptions
ServerThe character's prescriptions, newest first.
exports.cobalt_ambulancejob:GetPrescriptions(citizenid)| Parameter | Type | Optional | Description |
|---|---|---|---|
citizenid | string | No |
| Returns | Description |
|---|---|
AmbulancePrescription[] |
local prescriptions = exports.cobalt_ambulancejob:GetPrescriptions('ABC12345')FillPrescription
ServerRecords 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)| Parameter | Type | Optional | Description |
|---|---|---|---|
citizenid | string | No | |
id | integer | No | |
pharmacy | string | No |
| Returns | Description |
|---|---|
boolean |
local ok = exports.cobalt_ambulancejob:FillPrescription('ABC12345', 1, 'pillbox')GetSharedReports
ServerFiled reports a doctor has shared with police for this character.
exports.cobalt_ambulancejob:GetSharedReports(citizenid)| Parameter | Type | Optional | Description |
|---|---|---|---|
citizenid | string | No |
| Returns | Description |
|---|---|
AmbulanceReportSummary[] |
local reportSummaries = exports.cobalt_ambulancejob:GetSharedReports('ABC12345')UseMdt
ServerThe 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)| Parameter | Type | Optional | Description |
|---|---|---|---|
event | 'usingItem' | 'usedItem' | No | |
item | table | No | |
inventory | table | No |
exports.cobalt_ambulancejob:UseMdt(
'usingItem',
{ name = 'mdt_tablet' },
{ id = 'ABC12345', source = source }
)UseTreatment
ClientThe 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)| Parameter | Type | Optional | Description |
|---|---|---|---|
event | 'usingItem' | 'usedItem' | No | |
item | table | No |
exports.cobalt_ambulancejob:UseTreatment('usingItem', { name = 'bandage' })