
Ped & Player CPR (Animated) for FiveM
A guide to install Ped & Player CPR (Animated) for FiveM
๐ Table of Contents
- ๐ฏ Overview
- ๐ Purchase Information
- ๐บ Video Showcase
- โ ๏ธ Important Pre-Installation Notes
- ๐ง System Requirements & Compatibility
- ๐ฆ Installation Process
- โ๏ธ Configuration Setup
- ๐ฎ How It Works
- ๐ Export Functions
- ๐ Integration & Compatibility
- ๐ ๏ธ Troubleshooting
- ๐ก Best Practices
- ๐ 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:
โ ๏ธ Important Pre-Installation Notes
Critical Installation Order: Always follow this exact sequence to avoid parsing errors in the F8 console:
- Download ZIP Package from CFX Portal
- Unpack in a folder on your local machine
- Set File Transfer Protocol (FTP) type to binary
- Drag files from local machine to server resources folder
- Add to server.cfg (ensure script)
- 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:reviveintegration; failed CPR restores downed death animation - โ
QBCore โ
hospital:client:Revive/hospital:client:RespawnAtHospital - โ
Qbox โ
qbx_medicalrevive 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_systemexports - โ 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
- Extract the ZIP package to your local machine
- Transfer files using binary FTP mode to your serverโs resources folder
- 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
- Open
/config/config.luain your preferred editor - Configure all settings to your liking
- 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
- Open VS Code and navigate to the config files
- Read thoroughly - each line has explanatory comments
- Configure settings - customize cooldowns, duration, and survival rates
- Test frequently - use F8 console for error checking
Config version: Keep
Config.ConfigVersioninconfig.luain sync with theversioninfxmanifest.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 viaConfig.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.PercentageOfSurvivalwhen 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/cprEnable_Night_DiscordApi_Permissionsโ Requiresnight_discordapiEnable_Ace_Permissionsโ Match principals inCPRRolesOrGroupsEnable_ESX_Permissionsโ Job and/or group checksEnable_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
IsPlayerDownedOnServerbefore opening custom medic menus. UseRestorePlayerDownedFrameworkif 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 renameConfig.EventPrefixunless 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 = truefor 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
/cpris accepted โ report drift with framework and steps to reproduce
Failed CPR โ Victim Stands Up (ESX)
- Match
Config.Integrations.ESX.DeathAnimto youresx_ambulancejobConfig.DeathAnim- Keep
FreezeWhileDowned = trueunless your ambulance job handles freeze differently- Optional: set
RestoreDownedClientEventfor 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 = truefor 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: