Ped & Player CPR (Animated) Resource

Ped & Player CPR (Animated) for FiveM

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


๐Ÿ“‹ Table of Contents

  1. ๐ŸŽฏ Overview
  2. ๐Ÿ›’ Purchase Information
  3. ๐Ÿ“บ Video Showcase
  4. โš ๏ธ Important Pre-Installation Notes
  5. ๐Ÿ”ง System Requirements & Compatibility
  6. ๐Ÿ“ฆ Installation Process
  7. โš™๏ธ Configuration Setup
  8. ๐ŸŽฎ How It Works
  9. ๐Ÿ”Œ Export Functions
  10. ๐Ÿ”— Integration & Compatibility
  11. ๐Ÿ› ๏ธ Troubleshooting
  12. ๐Ÿ’ก Best Practices
  13. ๐Ÿ†˜ Support

๐ŸŽฏ Overview

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.

Key Features

  • โœ… 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

๐Ÿ›’ Purchase Information

Get Ped & Player CPR:

Purchase on Nights Software Store


๐Ÿ“บ Video Showcase

Watch the video showcase:

Video Showcase


โš ๏ธ Important Pre-Installation Notes

Critical Installation Order: Always follow this exact sequence to avoid parsing errors in the F8 console:

  1. Download ZIP Package from CFX Portal
  2. Unpack in a folder on your local machine
  3. Set File Transfer Protocol (FTP) type to binary
  4. Drag files from local machine to server resources folder
  5. Add to server.cfg (ensure script)
  6. Boot up the server

Support Policy: Follow this guide step by step. If youโ€™re stuck, ask for support in our Discord and provide the specific step name. Do not skip steps.


๐Ÿ”ง System Requirements & Compatibility

Framework Compatibility

  • โœ… 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 Compatibility

  • โœ… OneSync Legacy: Fully tested and compatible
  • โœ… OneSync Infinity: Fully tested and compatible

Integration Support

  • โœ… 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

Note: Ped & Player CPR is designed to work with any FiveM server configuration and provides realistic medical emergency features.


๐Ÿ“ฆ Installation Process

Step 1: Download Resource

Download this resource via CFX Portal Assets after purchasing.

Step 2: Install Resource

  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)

Step 3: Server Configuration

Add the resource to your server.cfg:

ensure night_ped_cpr

Step 4: Configure Settings

  1. Open /config/config.lua in your preferred editor
  2. Configure all settings to your liking
  3. Test the resource functionality

โš™๏ธ Configuration Setup

Required Tools

Visual Studio Code: We recommend downloading VS Code for editing Lua files.

Configuration Files

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

Configuration Process

  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

Config version: Keep Config.ConfigVersion in config.lua in sync with the version in fxmanifest.lua. Both are checked against the Nights version sheet on resource start.

Medical settings: Configure cooldown, CPR duration, survival percentage, target types (players/NPCs), positioning offsets, and framework events in config/config.lua.


๐ŸŽฎ How It Works

Command

  • 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

CPR Performance

  • 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)

Configuration Options

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)

Permissions

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 failed CPR note

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.


๐Ÿ”Œ Export Functions

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

Integration: Use IsPlayerDownedOnServer before opening custom medic menus. Use RestorePlayerDownedFramework if another script clears a downed playerโ€™s animation while they should remain dead.

Server Events (revive / respawn triggers)

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)

Event naming: Events use the night_ped_cpr_export: prefix. Do not rename Config.EventPrefix unless you update integration triggers accordingly.


๐Ÿ”— Integration & Compatibility

Framework Support

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

Medical System Integration

  • 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

Server Integration

  • 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

Medical roleplay: Failed CPR keeps victims in their existing death state and only fixes animation/tasks โ€” bleedout timers and distress flows are not restarted on ESX.


๐Ÿ› ๏ธ Troubleshooting

Common Issues

Resource Not Starting

  • Ensure the resource is properly added to server.cfg
  • Check that the resource name is night_ped_cpr
  • Verify the resource started without errors in console

CPR Not Working

  • Check F8 console for any error messages
  • Verify configuration settings in config.lua
  • Confirm the target is incapacitated (not just low health)
  • On ESX, ensure ESX.PlayerData.dead / metadata reflects death state
  • Check permission settings if EveryoneHasPermission = false

Animations Not Syncing / Drifting

  • Ensure both players are on the same resource version
  • Do not rename the resource folder (night_ped_cpr)
  • Avoid conflicting animation scripts during CPR
  • Control lock applies as soon as /cpr is accepted โ€” report drift with framework and steps to reproduce

Failed CPR โ€” Victim Stands Up (ESX)

  • Match Config.Integrations.ESX.DeathAnim to your esx_ambulancejob Config.DeathAnim
  • Keep FreezeWhileDowned = true unless your ambulance job handles freeze differently
  • Optional: set RestoreDownedClientEvent for custom death scripts

Permission Denied

  • Enable the permission system you use (Discord API, ACE, ESX, or QBCore block)
  • Add matching entries to Config.Permissions.CPRRolesOrGroups
  • Or set EveryoneHasPermission = true for testing

Debugging Tips

  • 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

๐Ÿ’ก Best Practices

Medical Configuration

  • 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

Performance Optimization

  • 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

User Experience

  • 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

๐Ÿ†˜ Support

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


Back to top

Copyright © 2025 Nights Software

Page last modified: May 19, 2026 at 12:00 PM.

This site uses Just the Docs, a documentation theme for Jekyll.