# MD Wounds — Realistic Wounds, Treatment & EMS System for ESX
MD Wounds replaces “press E to revive” with an actual emergency-medicine loop: injuries are detected per hit, mapped to body zones, bleed and worsen over time, and have to be diagnosed and treated with the right item — each treatment is its own minigame. It ships with a full death/dispatch/revive system, so it works as a complete replacement for esx_ambulancejob’s death and revive handling.
Wound data lives server-side and is persisted in MySQL: wounds survive relogs and server restarts — only treatment, an admin heal or the automatic hospital respawn clears them.
## Preview
## Features
### Wound simulation
- **Two-stage damage detection:** `CEventNetworkEntityDamage` for weapon hits (~90 classified weapon hashes in 10 categories) plus a 500ms fallback loop for falls, vehicle crashes and fire — wounds register even on instantly fatal hits, including the fatal-headshot edge case where GTA clears the bone data on death
- **Wound model:** 7 wound types (gunshot, stab, laceration, blunt trauma, burn, internal bleeding, organ damage) across 7 body zones (head, chest, abdomen, both arms, both legs), 4 severity levels derived from actual damage dealt
- **Cause tracking:** gunshot wounds record the gun class (pistol / SMG / rifle / sniper / shotgun / LMG); melee, explosive and fire causes get specific labels, and vehicle run-overs record the actual vehicle model
- **Bleeding:** ticks (default every 60s) scaled per type, severity and zone (head ×2.5, chest ×2.0); untreated bleeding wounds escalate one severity step per tick
- **Infection mechanic:** untreated wounds start rolling type-specific infection chances after 10 minutes (from 60% for burns down to 10% for blunt trauma); antiseptic prevents it
- **Hidden internal injuries:** gunshots can cause internal bleeding, heavy blunt trauma can cause organ damage — invisible to normal inspection until diagnosed via CT scan
- **Protective gear matters:** body armor blocks chest/abdomen wounds while it holds (armor damage counted at a tunable 0.4 multiplier), helmets redirect 65% of headshots to the chest
- **Pain system 0–10 with real gameplay effects:** limping with untreated leg wounds, motion blur at pain 4+, weapon tremor/camera shake with arm wounds, shock vignette at low HP with a critical wound
- **Visible consequences:** blood decals on the ped per zone, blood-pool trails other players can follow (broadcast within 80m)
- **Wound aggregation:** repeated identical hits merge into one wound with a counter and escalating severity instead of spamming the list
### Treatment & minigames
- **11 medical items, each with its own React minigame:** suture kit, gauze (bullet extraction), tourniquet, burn dressing, splint, bandage, antiseptic, painkiller, morphine, IV drip, defibrillator
- **Difficulty scales with severity** — between a light and a critical wound, bullet extraction shrinks the path corridor from 38px to 12px and tightens both the miss limit and the timer
- **Risk/reward:** failing a minigame worsens the wound one severity step and costs the patient 15 HP
- **Treatment rules with teeth:** tourniquets only work on limbs, the defibrillator is doctor-only, treating other players through the doctor UI requires a configured doctor job (`Config.DoctorJobs`), and organ damage is only treatable near a hospital CT station
- **Smart item targeting:** items auto-target the most severe compatible untreated wound and are validated *before* they leave the inventory — nothing gets wasted or duped
- **Inspect gate:** a doctor must have actually examined the patient before items can be used on them
### Death, revive & EMS tools
- **Full downed/death system** (statebag-driven, keeps ox_inventory’s “dead” lock consistent): controls blocked, custom death screen with canvas-rendered ECG flatline, pause-menu respawn blocked
- **Bleed-out timer:** 10-minute countdown once a critical untreated wound has dragged you to low health, with a HUD timer that turns urgent under 2 minutes; stabilizing the wound stops it — the restart exploit is closed with a shortened post-restart window
- **Fallback hospital respawn:** automatic hospital respawn after 15 minutes (configurable) if no medic shows up — this is the one path that clears remaining wounds for a fresh start
- **Defibrillator workflow:** ghost-preview prop placement, ox_lib skill check, deploy animation, CPR + defib minigame; revived patients keep all their wounds and still need treatment; the defib is a reusable tool with a proper refund/consume lifecycle
- **F9 emergency call** from downed players with auto-resolved street/zone, 60s cooldown, auto-cancel on revive or disconnect
- **F10 medic dispatch panel:** claim / unclaim / route / close calls like a small control center; alert cards auto-dismiss after 15s; the server validates the doctor job on every action
- **CT scan stations** (map blips, 3D markers): region-based scans (head / thorax / full body, 8–14s) with tablet prop and progress bar; reveals internal injuries and feeds a live vitals monitor (HR, blood pressure, SpO2, temperature) in the doctor UI
- **Body inspection (G):** doctors get an instant side-panel readout of the nearest patient’s wounds, sorted by severity, without opening the full UI
- **Admin-friendly:** ACE-gated `/revive` (`command.revive`); txAdmin’s “Heal Player” and ESX `/heal` are intercepted so admin heals properly clear the death state and wounds
### UI
- **React + Vite NUI** in a dark, iOS-style design language; prebuilt UI ships with the resource
- **Interactive SVG body diagram** colored by worst severity per zone, with bleeding/infected/treated badges and an “unknown injury” state before examination
- **Patient view (F6)** with pain/bleeding/infection stat strip; **doctor view (F7)** with a live-updating wound list while you treat
- **Overlay layer:** death timer HUD, shock vignette, dispatch alert cards, downed HUD, scan progress, death screen
- **Localization:** English/German covering both Lua and the UI, selected via `Config.Locale` (one-line switch; ox_inventory item names are re-labelled automatically to match)
### Tech & security
- **Server-side wound state:** the wound list is stored and mutated server-side and synced authoritatively to clients
- **Input validation:** whitelisted type/zone/severity values, sanitized cause strings, sanity-checked blood-decal coordinates
- **Abuse prevention:** proximity checks (3–5m), job checks, and rate limits/cooldowns on damage events, item use and worsen ticks; inventory is verified via ox_inventory before consumption, with protection against double-callbacks
- **Performance:** batched DB writes every 30s with immediate flush on disconnect/resource stop, cached player positions for blood broadcasts, throttled and diffed NUI updates, adaptive waits in all loops
- **Persistence:** wounds stored as JSON per identifier in MySQL (oxmysql); the `md_wunden` table is auto-created on first start
## Requirements & dependencies
| Resource | Notes |
|—|—|
| [es_extended](GitHub - esx-framework/esx_core: Official Repo For core resources for esx-legacy · GitHub) | ESX Legacy. **You must set `Config.DisableHealthRegeneration = true`** in `es_extended/shared/config/adjustments.lua`, otherwise natural regen cancels out the wound system |
| [oxmysql](GitHub - CommunityOx/oxmysql: MySQL resource for FXServer. · GitHub) | Persistence; table auto-created |
| [ox_inventory](GitHub - CommunityOx/ox_inventory: Slot-based inventory with metadata. · GitHub) | 2.47.0+; the 11 medical items must be added to `data/items.lua` (then `refresh ox_inventory`). Stop the default esx_inventory |
| [ox_lib](GitHub - CommunityOx/ox_lib: A FiveM resource and script library for Lua and JS. · GitHub) | Notifications, progress bars, skill checks |
| [tiddys-emsprops (Medical Prop Pack)]([Add-on Props] Medical Prop Pack) | Provides the `lifepak15` defibrillator prop. **Required for the defibrillator/revive workflow:** without it the prop model cannot load and deployment aborts with an on-screen error (the item is refunded and nothing breaks server-side, but medics cannot defib-revive) |
This script **replaces** the esx_ambulancejob death/revive loop (death screen, respawn timer, dispatch, defib revive). If esx_ambulancejob is still running, MD Wounds fires `esx_ambulancejob:revive` after a defib revive for compatibility, but you should not run a second full medical/death system alongside it.
Node.js is only needed if you want to rebuild the UI yourself (`npm install && npm run build` in `ui/`) — a prebuilt `ui/dist` is included.
## Installation (short version)
1. Drop the resource into your resources folder and `ensure md_wunden` after the dependencies
2. Set `Config.DisableHealthRegeneration = true` in es_extended
3. Add the 11 items to `ox_inventory/data/items.lua` and run `refresh ox_inventory`
4. Adjust `shared/config.lua` (jobs, keybinds, hospital/CT locations, balance values)
5. Start the server — the database table is created automatically
A full step-by-step install guide with troubleshooting is included in the package.
## Config highlights
Everything lives in a single commented `shared/config.lua` — wound types, bleed rates, pain levels, infection risks, item rules, severity multipliers and zone multipliers are all tunable. A small excerpt:
```lua
Config.Locale = ‘en’ – ‘en’ or ‘de’
Config.DoctorJobs = { ‘ambulance’, ‘doctor’, ‘medic’, ‘doc’ }
Config.BleedInterval = 60 – seconds between bleed ticks
Config.InfectionTime = 10 – minutes until untreated wounds risk infection
Config.HelmetHeadshotChance = 0.35 – 35% of headshots still count with a helmet on
Config.ArmorDamageMultiplier = 0.4
Config.CTLocations = {
{ x = 1489.27, y = 3198.36, z = 40.40, heading = 345.8, label = 'Sandy Shores Medical' },
-- add more hospitals by appending entries
}
Config.Death = {
fallbackRespawnTime = 900, -- 15 min until automatic hospital respawn
emergencyCallCooldown = 60,
hospitalSpawn = { x = 337.0, y = -1397.0, z = 32.5, heading = 0.0 },
}
```
Keybinds (F6 own wounds, F7 doctor UI, F8 CT scan, G inspect, F9 emergency call, F10 dispatch) are registered via `RegisterKeyMapping`, so every player can rebind them in GTA settings.
## Performance
Measured live in-game (resmon):
- **0.00ms** CPU time idle and with active wounds / the medical UI open
- **~0.02ms** peak during an active treatment minigame
- **~0.9 MiB** memory footprint
- No per-tick NUI traffic, no per-event DB writes, no per-player coordinate polling for blood broadcasts
## FAQ
**Is the code accessible / is it escrowed?**
The resource is delivered through the official Cfx Asset Escrow system. `shared/config.lua` and the locale files stay unencrypted, so all balancing, jobs, locations and translations are fully editable. There is no third-party obfuscation, no IP-lock, no license-key check and no remote code loading.
**Which frameworks are supported?**
ESX Legacy only for now. There is no QBCore/Qbox version. ox_inventory is required (default esx_inventory is not supported).
**Does it conflict with wasabi_ambulance, qalle_brentw, ars_ambulancejob, etc.?**
Yes, by design — MD Wounds brings its own complete death, dispatch and revive system, so run it *instead of* other medical/death scripts, not alongside them. txAdmin’s heal button and ESX `/heal` are integrated and clear wounds correctly.
**Do wounds reset on relog or restart?**
No. Wounds are stored per identifier in MySQL, batch-saved every 30s and force-saved on disconnect and resource stop. They survive relogs and server restarts — only treatment, an admin heal or the automatic fallback hospital respawn clears them. Defib revives keep all wounds.
**Can I add more hospitals/CT stations?**
Yes — `Config.CTLocations` is a plain list; one station (Sandy Shores Medical) is preconfigured. Note that organ damage is only treatable near a configured CT location, so add stations for the hospitals you use.
**What languages are supported?**
English and German locales for both Lua and the UI, switchable via `Config.Locale`. Full transparency: wound-cause labels (the weapon/fall/vehicle cause strings) and a handful of UI strings are currently German-only — item names and all menus are fully localized.
**Wounds register but players don’t lose HP / nothing seems to happen?**
Almost always health regeneration: `Config.DisableHealthRegeneration = true` in es_extended is mandatory. The install guide has a troubleshooting section.
**Is it standalone enough to keep my own dispatch script?**
The F9/F10 dispatch is built in and only targets `Config.DoctorJobs`. You can ignore it and keep using your own dispatch — claims/alerts are self-contained.
## Download
**Purchase:** https://dollar-development-shop.tebex.io/category/3342205
A full step-by-step installation guide with a troubleshooting section is included in the package. Support is handled right here in this topic.
| | |
|—|—|
| Code is accessible | No (escrowed — config and locales are unencrypted and editable) |
| Subscription-based | No |
| Lines (approximately) | 13,500 (≈5,000 Lua + ≈8,500 React/JS UI source) |
| Requirements & dependencies | es_extended (ESX Legacy), ox_lib, ox_inventory 2.47.0+, oxmysql, tiddys-emsprops (defib prop — required for the defib revive workflow) |
| Support | Yes |








