T3 // Public Safety

coe_ems

Health & EMS

Patient states, revive, treat and medical records on top of coe_businesses

HEADLESS SERVICE (NO UI)
DEPENDS ON coe_corecoe_databasecoe_loggingcoe_businessescoe_dispatch
coe_ems 5 exports · 1 command

Runs without a NUI: nothing is rendered on the client and the resource stays idle until events arrive.

01 // OVERVIEW

Plug-and-play health and EMS on top of coe_businesses: staff, ranks and salaries live in the ems-category business (hospitals). Patient states healthy → injured → unconscious → dead, with bleed-out decided by the server, revive, treatment and medical records by rank permission, and /respawn for the dead.

On FiveM Enhanced

The client only reports what the game shows; dying and reviving are server decisions.

02 // FEATURES

What the module delivers

01

Patient States

Healthy, injured, unconscious and dead.

02

Rank Permissions

ems.revive, ems.treat and ems.records.

03

Medical Records

Treatment history per character.

04

Dispatch Integration

A person down creates an EMS call.

ARCHITECTURAL LAYERS // CLEAN ARCHITECTURE

4-Layer Isolation with 0.00 ms Idle

Every COE Framework script strictly follows the principle of separation of concerns. Interact with the 3D stack below:

L4
Headless Operation (No UI)
Zero DOM · CoE UI Delegation
Headless
L3
Application & Server
Atomic locks · Rate limiting
Auth Server
L2
Platform & HAL
Core.Platform · Mock natives
Gen9 HAL
L1
Domain & ACID Database
Prepared SQL · MariaDB pool
ACID Pool
LAYER 04 // HEADLESS SERVICE

Headless Service (No Dedicated NUI)

Operates strictly within layers L1–L3 (domain, HAL, and server-authoritative application logic). Visual interactions and management flows are delegated to centralized ecosystem apps (coe_ui / coe_tablet), guaranteeing 0.00 ms idle client overhead in FiveM DX12.

Zero CEF graphic overhead: no background web pages or NUI bridges loaded
Typed public contracts (types.lua) consumed directly by external resources and UIs
Strict adherence to the Server-Authoritative model with zero direct DOM manipulation
ADMIN POWERS // OPERATION & MANAGEMENT

What this script delivers to Server Owners

Manage your city without relying on developers. Runtime parameters, auditing, and ACE-protected commands:

🛡️
ACE Permissions
Administrative operations strictly protected by coe.staff and coe.admin principals.
IsPlayerAceAllowed(src, "coe.admin")
📊
Ledger Auditing
Relevant actions write audit records to the database through coe_audit.
exports.coe_audit:Record(severity, category, event, context)
⚡
0.00ms Idle Telemetry
Event-driven thread dispatch that stays dormant until network events fire.
Clean Architecture & HAL
03 // EXPORTS

Public API 5

Typed contracts to call from other resources. Full types live in types.lua and in the docs reference.

exports['coe_ems']:Records(medicSource, patientCharacterId, limit) → any

Returns a patient's (character's) medical record. Requires the caller to hold ems.records in an EMS-category business.

ParameterType
medicSourceany
patientCharacterIdany
limitany
LUA
local result = exports['coe_ems']:Records(medicSource, patientCharacterId, limit)
exports['coe_ems']:Revive(medicSource, targetSource, detail) → any

Export server Revive (server/main.lua).

ParameterType
medicSourceany
targetSourceany
detailany
LUA
local result = exports['coe_ems']:Revive(medicSource, targetSource, detail)
exports['coe_ems']:SetState(source, state) → any

Allows coe_needs, coe_hud, and coe_admin to set the state (for example, damage caused by another system).

ParameterType
sourceany
stateany
LUA
local result = exports['coe_ems']:SetState(source, state)
exports['coe_ems']:State(source) → any

Export server State (server/main.lua).

ParameterType
sourceany
LUA
local result = exports['coe_ems']:State(source)
exports['coe_ems']:Treat(medicSource, targetSource, detail) → any

Export server Treat (server/main.lua).

ParameterType
medicSourceany
targetSourceany
detailany
LUA
local result = exports['coe_ems']:Treat(medicSource, targetSource, detail)
04 // COMMANDS

In-game commands 1

/respawn

Respawns at the hospital after dying (when allowed by EMS).