Skip to content

Player & Ped CPR

A guide to install Ped & Player CPR (Animated) for FiveM

Perform animated CPR on downed players and injured NPCs. This resource provides ERS-style synced CPR animations, framework revive integration, eligibility checks, and configurable permissions — with optional Coma & Down System support.

  • Synced player CPR — ERS-style staged animations (missheistfbi3b_ig8_2) with server-authoritative sync
  • Framework integration — Auto-detect or manual ESX, QBCore, Qbox, and standalone revive handling
  • Failed CPR restore — Victims return to their downed death animation without restarting bleedout timers (ESX Legacy compatible)
  • Eligibility checks — CPR only on incapacitated players/NPCs (health, death state, framework metadata)
  • Framework permissions — Night Discord API (multi-guild), ACE, ESX job/group, QBCore/Qbox job/permission
  • NPC & player targets — Configurable: both, NPC only, or player only
  • Control lock — Movement disabled instantly when CPR starts to prevent animation drift
  • Version checker — Resource and config version check on startup (Nights version sheet)
  • Coma & Down System integration — Optional integration with medical systems
  • Server exports — Downed checks, permission checks, and manual downed restore for other resources
  • Standalone — Built-in revive/respawn when no framework is detected
  • ESX — esx_ambulancejob:revive integration; failed CPR restores downed death animation
  • QBCore — hospital:client:Revive / hospital:client:RespawnAtHospital
  • Qbox — qbx_medical revive export with configurable respawn callback

Set Config.Integrations.Framework to "auto" (default), "esx", "qbcore", "qbox", or "standalone".

  • OneSync Legacy: Fully tested and compatible
  • OneSync Infinity: Fully tested and compatible
  • Coma & Down System — Optional revive/respawn via night_coma_down_system exports
  • night_discordapi — Multi-guild Discord role permissions (same model as ERS)
  • ACE permissions — Principal-based CPR access via Config.Permissions.CPRRolesOrGroups

Download this resource via CFX Portal Assets after purchasing.

  1. Extract the ZIP package to your local machine
  2. Transfer files using binary FTP mode to your server’s resources folder
  3. Ensure the folder is named night_ped_cpr (do not rename)

Add the resource to your server.cfg:

ensure night_ped_cpr
  1. Open /config/config.lua in your preferred editor
  2. Configure all settings to your liking
  3. Test the resource functionality
File Purpose
night_ped_cpr/config/config.lua Main settings, permissions, framework integration, animations
night_ped_cpr/client/c_functions.lua Revive, respawn, and downed-state restore handlers
night_ped_cpr/server/s_functions.lua Permissions, downed checks, and server exports
  1. Open VS Code and navigate to the config files
  2. Read thoroughly - each line has explanatory comments
  3. Configure settings - customize cooldowns, duration, and survival rates
  4. Test frequently - use F8 console for error checking
  • Default command: /cpr (configurable via Config.Commands.CPR)
  • Stand within 2 metres of a downed player or eligible NPC
  • Player CPR requires the victim to be incapacitated; the server confirms eligibility before sync starts
  • Player CPR — Staged sync: setup → loop → outro, relayed through the server to both clients
  • NPC CPR — Local session on the performer client with the same animation set
  • Survival roll — Server rolls against Config.Settings.PercentageOfSurvival when CPR completes
  • Successful CPR — Framework revive (or Coma & Down / standalone revive)
  • Failed CPR — Victim stays in death mode; downed death animation is restored in place (no hospital teleport on ESX)
Setting Description
AllowCPROnPedOrPlayer 1 = both, 2 = NPC only, 3 = player only
DurationOfCPR Loop stage length in seconds
OutroAnimationDuration Finish animation length in seconds
PercentageOfSurvival Chance of successful revival (0–100)
CPRCooldown Cooldown messaging while a session is active
Positioning Victim/paramedic offsets (matched to ERS CPR defaults)

Configure Config.Permissions the same way as ERS:

  • EveryoneHasPermission = true — Anyone can use /cpr
  • Enable_Night_DiscordApi_Permissions — Requires night_discordapi
  • Enable_Ace_Permissions — Match principals in CPRRolesOrGroups
  • Enable_ESX_Permissions — Job and/or group checks
  • Enable_QBCore_Permissions — Job and/or permission checks (also used for Qbox via qb-core bridge)

See ACE Permissions and Discord API for setup guides.

ESX Legacy does not expose an instant hospital respawn client event. After failed CPR, the resource restores the victim’s downed animation using Config.Integrations.ESX.DeathAnim (default: misslamar1dead_body / dead_idle). Match these values to your esx_ambulancejob Config.DeathAnim if you use custom death animations.

Optional hook: set Config.Integrations.ESX.RestoreDownedClientEvent to re-enter a custom ambulance death script after failed CPR.

Server-Side Exports (night_ped_cpr/server/s_functions.lua)

Section titled “Server-Side Exports (night_ped_cpr/server/s_functions.lua)”

Use these exports from other server-side scripts:

-- Returns true if the player is downed/dead (state bags + ESX/QBCore metadata fallback)
local isDowned = exports['night_ped_cpr']:IsPlayerDownedOnServer(targetSource)
-- Returns true if the player is allowed to perform CPR (same rules as /cpr)
local canCpr = exports['night_ped_cpr']:HasCprPermission(source)
-- Manually restore a victim's downed/death animation and framework metadata
-- (same path used automatically after failed player CPR)
exports['night_ped_cpr']:RestorePlayerDownedFramework(targetSource)
Export Returns Description
IsPlayerDownedOnServer(playerSrc) boolean Checks player state bags and ESX/QBCore death metadata
HasCprPermission(source) boolean Server-authoritative CPR permission check
RestorePlayerDownedFramework(targetSrc) — Restores downed animation after interrupted/failed CPR; updates ESX/QBCore metadata

Trigger these from server-side scripts to force framework revive or hospital respawn outside of a CPR session:

-- Framework-aware revive (ESX / QBCore / Qbox / Coma & Down / standalone)
TriggerEvent('night_ped_cpr_export:revive', targetSource)
-- Framework-aware hospital respawn
TriggerEvent('night_ped_cpr_export:respawn', targetSource)
Framework Revive Failed CPR
ESX Config.Integrations.ESX.ReviveClientEvent Restores downed death animation in place
QBCore Config.Integrations.QBCore.ReviveClientEvent Restores downed state via client restore
Qbox qbx_medical:Revive export or configured client event Restores downed state via client restore
Standalone Built-in client revive handler Built-in downed animation restore
Coma & Down night_coma_down_system exports Client :restoreDownedState when enabled
  • Coma & Down System — Set Config.Integrations.Enable_Coma_and_Down_System = true for revive/respawn via Coma & Down System
  • ERS — Uses the same CPR animation set and positioning offsets as ERS ped CPR
  • Discord API — Role-based CPR permissions via night_discordapi
  • Universal Compatibility — Works with OneSync Legacy and Infinity
  • Performance Optimized — No idle resmon; control lock only runs during active CPR
  • Version checker — Compares resource and config version against the Nights Google Sheet on start
  • Check F8 Console - Look for any error messages
  • Test CPR on Different Targets - Try both players and NPCs
  • Verify Configuration - Check all config settings are correct
  • Check Integration - Ensure Coma & Down System is properly configured if using
  • Cooldown Settings - Set appropriate cooldowns for server balance
  • Survival Rates - Configure realistic survival percentages
  • Target Selection - Choose appropriate targets for your server
  • Duration Settings - Set realistic CPR performance times
  • Animation Optimization - Ensure animations run smoothly
  • Target Limits - Configure appropriate target restrictions
  • Cooldown Management - Balance gameplay with realistic mechanics
  • Regular Testing - Test CPR functionality regularly
  • Clear Instructions - Provide users with CPR usage guidelines
  • Medical Training - Offer guidance on proper CPR procedures
  • Roleplay Enhancement - Encourage realistic medical roleplay
  • Emergency Procedures - Integrate with other medical systems

Read through the instructions again if you have not managed to install the resource. Can’t get it to work still? Create a ticket through our dedicated support system in Discord:

Nights Software Discord