Death·installation

Installation

DS-Death replaces the default death/knockout/revive loop in your ambulance job. Installation is mostly drag-and-drop, with a few small patches to esx_ambulancejob or qb-ambulancejob so the existing revive flow hands off to DS-Death.

Download

Download the script from portal.cfx.re. Make sure you're logged in with the FiveM account you used to purchase the script.

Extract

Unzip the archive and drop the resulting DS-Death folder anywhere inside your server's resources folder.

Dependencies
DS-Death requires mysql-async. ESX and QBCore are both supported and auto-detected at runtime.

Run the SQL

Execute the SQL file matching your framework. It adds a single ds_death column used to persist death state across disconnects.

ESX

Execute INSTALLATION_GUIDE/ESX.sql in your database — adds ds_death TINYINT(1) to the users table.

QBCore

Execute INSTALLATION_GUIDE/QBCore.sql in your database — adds ds_death TINYINT(1) to the players table.

Install the revive item

DS-Death requires an aidkit item to revive knocked players. Add it to whichever inventory you run.

ESX (default inventory)

Execute INSTALLATION_GUIDE/INSTALL_ITEM/ESX/item.sql in your database to register the item.

ESX (ox_inventory)

Open INSTALLATION_GUIDE/INSTALL_ITEM/ESX/OX_INVENTORY_ITEM.md, copy the snippet and paste it into ox_inventory/data/items.lua:

ox_inventory/data/items.lua
['aidkit'] = {
    label = 'Aid Kit',
    weight = 100,
    stack = true,
    consume = 0,
    allowArmed = true
},

QBCore

Open INSTALLATION_GUIDE/INSTALL_ITEM/QBCORE/item.md, copy the snippet and paste it into qb-core/shared/items.lua:

qb-core/shared/items.lua
['aidkit'] = {['name'] = 'aidkit', ['label'] = 'Aid Kit', ['weight'] = 0, ['type'] = 'item', ['image'] = 'aidkit.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Useful to revive knocked people'},
Use a different item
If you already have a medical item you'd rather use, change ItemRevive and ItemLabel in config.lua instead of installing aidkit.

Patch your ambulance job

DS-Death takes over the death/revive flow, so the existing handlers in esx_ambulancejob / qb-ambulancejob need to be removed or rerouted. The literal blocks to delete and replace are bundled inside the resource:

ESX (esx_ambulancejob)

Follow INSTALLATION_GUIDE/ESX.txt — three edits in total:

  • esx_ambulancejob/client/main.lua — remove (or comment out) the esx:onPlayerSpawn handler that resets isDead.
  • esx_ambulancejob/client/main.lua — replace the esx_ambulancejob:revive event handler with a one-liner that hands off to DS-Death:
    esx_ambulancejob/client/main.lua
    RegisterNetEvent('esx_ambulancejob:revive')
    AddEventHandler('esx_ambulancejob:revive', function()
        TriggerEvent('DS-Death:revive')
    end)
  • esx_ambulancejob/client/job.lua — in the revivePlayer function, change if IsPedDeadOrDying(closestPlayerPed, 1) then to if closestPlayerPed then so DS-Death's knocked state counts as revivable.

QBCore (qb-ambulancejob)

Follow INSTALLATION_GUIDE/QBCORE.txt — two edits:

  • qb-ambulancejob/server/main.lua — remove (or comment out) the existing QBCore.Commands.Add("revive", ...) block. DS-Death registers its own.
  • qb-ambulancejob/client/dead.lua — remove the gameEventTriggered handler that runs the laststand / death timer. DS-Death replaces that flow.
Back up before patching
These patches modify framework resources. Keep a copy of the original esx_ambulancejob / qb-ambulancejob folder before editing so you can roll back if something else in your stack depends on the old behaviour.

Grant admin permissions

QBCore

Add the ace permission to your server.cfg so admins can use the revive commands:

server.cfg
add_ace group.admin ds_death allow

ESX

Permissions are handled through the AuthorizedGroup array in config.lua. The default {'admin'} already covers most setups.

Start the resource

Add the script to your server.cfg:

server.cfg
ensure DS-Death
Resource order
Make sure your framework (ESX / QBCore) and the patched ambulance job start before DS-Death in the load order.

Configure

Open config.lua and tune the script to your server. The most useful knobs:

  • KnockoutTime / RespawnTime — how long players stay knocked, and when respawn becomes available.
  • HeadShotDeath — skip the knockout state and kill instantly on a headshot.
  • RespawnPosition / RespawnSamePos / RespawnCost — where players come back, and whether respawning costs cash or bank.
  • CombatLogging — either keep the player dead on rejoin (CheckDeath) or auto-respawn them (RespawnOnJoin).
  • RemoveItemsAfterRPDeath — drop money, weapons, and items on RP death, with a KeepItems whitelist for things like documents.
  • ProgressbarNATIVE, RPROGRESS, or CUSTOM (wire your own into CustomProgress / StopCustomProgress).
  • EMSCall — drop your phone's call trigger inside this function so the in-world EMS call routes to your phone instead of the default notification.
  • EnableLogs — turn on the Discord webhook logs and configure them in webhooks.lua.
Custom hooks
OnKnocked, OnDeath, OnRevive, and OnRespawn in config.lua are empty functions ready for you to plug in your own triggers/exports. CanDie lets you disable the death loop conditionally — useful for minigame zones, airsoft events, or PvP arenas.

Still stuck?

Open a ticket in our Discord and we'll help you out.

Join Discord →
Death · Installation — Documentation