Docs
All settings:
Call EMS:
Waiting for medics:
Fitting your server:
View product page
X3D Respawn
Free death screen: Call EMS button, wait for medics when they are online, respawn points, self-revive, a death summary and death kept across relogs.
Buy / Get freeConfig builderInstallation
- Put the
x3d_respawnfolder inresources/. Do not rename the folder. - Run
install.sqlto add theusers.is_deadcolumn (safe to re-run). If your players table is not calledusers, change it in that file and inConfig.UsersTable. - Add to
server.cfg:
ensure oxmysql
ensure es_extended # if you run ESX (not needed in standalone mode)
ensure x3d_respawn
Run one death screen only: if you use esx_ambulancejob, turn its death screen off and have your medic scripts call the x3d_respawn events listed under "For medic scripts" below.
Requirements
| Resource | Required | Used for |
|---|---|---|
oxmysql |
yes | the death flag |
es_extended |
no | ESX Legacy (without it use standalone mode through Config.Framework; the death flag across relogs is ESX only) |
All settings: shared/config.lua
General
| Setting | Default | Meaning |
|---|---|---|
Config.Locale |
'th' |
'th' or 'en' |
Config.UsersTable |
'users' |
ESX players table |
Config.MinDeathDelayMs |
1200 |
Delay before the death screen appears |
Config.UseRedFilter |
true |
Red screen filter while dead |
Call EMS: Config.CallEMS
| Setting | Default | Meaning |
|---|---|---|
enabled |
true |
Shows the Call EMS button |
jobs |
{ 'ambulance' } |
Jobs that get notified when someone calls |
cooldownSeconds |
60 |
How often a player can call |
message |
{ th = ..., en = 'Unconscious, needs a medic' } |
What medics read |
What happens (built in, no other script needed):
- Every online player whose job is in
jobs(defaultambulance) gets an "Emergency call" notification with your message and a flashing map blip at the patient's position (it clears itself after 60 seconds). - The location is read from the character on the server, so it cannot be faked.
- Using another dispatch system? Edit
addons/dispatch/client.luaandaddons/dispatch/server.lua.
Waiting for medics: Config.MedicGate
| Setting | Default | Meaning |
|---|---|---|
enabled |
true |
Turns the medic check on |
jobs |
{ 'ambulance' } |
Jobs counted as medics |
onDutyOnly |
false |
Count only medics on duty (job.onDuty) |
minMedics |
1 |
This many medics online means players wait |
waitWithMedics |
600 |
With medics: seconds before respawning unlocks · 0 = never, wait to be revived |
waitWithoutMedics |
30 |
Without medics: seconds before respawning unlocks |
includeSelfRevive |
false |
Whether item self-revive waits too |
The screen shows e.g. "2 medics online · respawn in 6:52" and recounts medics every 10 seconds. If every medic logs off while you wait, waitWithoutMedics applies at once.
Example: serious RP, where players must be revived while medics are online:
Config.MedicGate = { enabled = true, jobs = { 'ambulance' }, minMedics = 1, waitWithMedics = 0, waitWithoutMedics = 60 }
Respawn points and self-revive
| Setting | Default | Meaning |
|---|---|---|
Config.TownRespawn |
true |
Respawn at a town |
Config.NodeRespawn |
false |
Respawn at a nearby point |
Config.TownOptionsToShow / NodeOptionsToShow |
1 |
How many to list (nearest first) |
Config.Nodes |
3 towns + 4 points | Respawn points: type = 'town' or 'node'; towers are the actual spawn spots (the one nearest the body is used) |
Config.SelfRevive |
off | Item self-revive: item, count, label, labelTh |
Config.Blip |
on | Map blips for the respawn points |
Death flag and admins
| Setting | Default | Meaning |
|---|---|---|
Config.PersistDeath.enabled |
true |
Dying and logging off keeps you dead on return. Admins free a stuck player with /revive |
Config.AdminReviveCommand |
/revive [id] |
Revive a player (blank = yourself) |
Config.AdminHealCommand |
/heal [id] |
Heal a player |
Config.DeadSync |
on | X bounces the body (stuck in a wall) every 10 s, and caps body velocity |
Fitting your server: addons/
| File | Functions | Default |
|---|---|---|
addons/dispatch/client.lua |
Dispatch.Available(), Dispatch.CallEMS(message) |
built-in medic alert + map blip (edit to plug in another dispatch) |
addons/hud/client.lua |
Hud.Show(visible), BlipName(node) |
game radar + event x3d_respawn:hud |
addons/notify/client.lua |
Notify(message, kind) |
esx_notify → ox_lib → ESX |
addons/anticheat/server.lua |
OnRespawnTeleport(src) |
empty (no-op), hook your own anti-cheat here |
addons/locale/shared.lua |
T(th, en) |
follows Config.Locale |
For medic scripts
-- server
TriggerClientEvent('x3d_respawn:cmdRevive', target) -- revive
exports['x3d_respawn']:ClearDeathFlag(target) -- clear the death flag
TriggerClientEvent('x3d_respawn:cmdHeal', target) -- heal
-- client
exports['x3d_respawn']:IsPlayerDead() --> boolean
AddEventHandler('x3d_respawn:cl_onDeathStart', function() end)
AddEventHandler('x3d_respawn:cl_revived', function(how) end) -- 'cmd', 'self', 'external' or a point id
Troubleshooting
| Symptom | Cause / fix |
|---|---|
| No Call EMS button | Config.CallEMS.enabled = false, or Dispatch.Available() in addons/dispatch/client.lua returns false |
| Nobody receives the call | No online player has a job listed in Config.CallEMS.jobs |
| Two death screens | Another death screen is still running (e.g. esx_ambulancejob's) |
| A player is stuck dead on join | Config.PersistDeath is on; use /revive <id> |
| Respawn is locked | Medics are online per Config.MedicGate; wait for the time shown |