A FiveM script that detects and tracks players who disconnect during gameplay, creating a visible corpse at their last known position with detailed information.
- Real-time Disconnect Detection - Automatically detects when players disconnect from the server
- Corpse Creation - Creates a realistic corpse at the player's last position with their exact appearance
- Player Information Display - Shows Steam name, Discord ID, character name, and playtime
- Ascension Animation - Corpse ascends to the sky with particle effects when interacted with
- Optimized Performance - Low resource usage with efficient code
- Memory Management - Automatic cleanup prevents memory leaks
- 3D Information Cards - Dynamic UI that follows the corpse in 3D space
- Download the latest release
- Extract
dw-combatlogto yourresources/[qb]/folder - Add
ensure dw-combatlogto yourserver.cfg - Restart your server or use
refreshandensure dw-combatlog
resources/[qb]/dw-combatlog/
โโโ fxmanifest.lua
โโโ client/
โ โโโ client.lua
โโโ server/
โ โโโ server.lua
โโโ html/
โโโ index.html
โโโ style.css
โโโ script.js
When a player disconnects, their corpse will appear at their last location. Other players can:
- Approach the corpse
- Press
Eto view information - Watch the corpse ascend to the sky with visual effects
Use the test command to verify functionality:
/testcombatlog
This creates a test corpse at your current position.
Edit client/client.lua at line 132:
endTime = GetGameTimer() + 10000, -- Time in milliseconds (10000 = 10 seconds)Examples:
- 30 seconds:
30000 - 1 minute:
60000 - 2 minutes:
120000
Edit client/client.lua at line 7:
Wait(5000) -- Update every 5 seconds (5000ms)Lower values = more accurate but slightly higher resource usage
Edit client/client.lua at line 416:
if distance < 20.0 then -- Display UI within 20 meters- Sync System - Client sends player data (position, model, appearance) to server every 5 seconds
- Data Storage - Server stores the latest player data
- Disconnect Detection - Server detects when a player disconnects
- Broadcast - Server sends the stored data to all clients
- Corpse Creation - Each client creates a corpse at the disconnect location
- Interaction - Players can view information by targeting the corpse
- Ascension - After interaction, corpse ascends with particle effects
- Cleanup - Automatic removal after the configured duration
- Client: ~0.01ms/frame
- Server: ~0.001ms/event
- Memory: Minimal with automatic cleanup
- Optimization: Uses Wait(100) instead of Wait(0) for ~90% CPU reduction
Check Console for:
[COMBAT LOG] Player disconnected: [Name] (Playtime: Xs)
[COMBAT LOG] Creating marker for: [Name]...
[COMBAT LOG] Ped created successfully for [Name]
Solutions:
- Ensure
qb-coreis running - Ensure
qb-targetis installed and working - Check F8 console for errors
- Verify the resource is started:
ensure dw-combatlog
Check:
- Press F8 and look for JavaScript errors
- Ensure the NUI is loading: Resources โ dw-combatlog
- Try
/testcombatlogto verify functionality
Verify:
-- server.cfg order matters:
ensure qb-core
ensure qb-target
ensure dw-combatlogWhen viewing a disconnect corpse:
- Steam Name - Player's Steam display name
- Discord ID - Player's Discord identifier (if available)
- Character Name - In-game character name
- Time Played - Total session playtime before disconnect
- Exact replica of player's character
- Includes all clothing components
- Preserves facial features and customization
- Ragdoll physics on creation
- Particle effects during ascension
- Smooth rotation and spiral motion
- Gradual fade-out
- Professional UI with Discord-style badges
- Efficient update system (every 5 seconds)
- Distance-based UI rendering
- Automatic resource cleanup
- No memory leaks
- XSS protection with HTML escaping
- Server-side validation
- No client-side exploits
- Secure data transmission
This project is released under the MIT License.
Created by DW Scripts
If you encounter issues:
- Check the troubleshooting section above
- Review console logs for error messages
- Ensure all dependencies are properly installed
- Verify the folder structure is correct
- Optimized client-side performance (90% CPU reduction)
- Added comprehensive null checks
- Implemented automatic memory cleanup
- Added timeout handlers to prevent freezing
- Fixed emoji encoding in UI
- Added XSS protection
- Improved debug logging
- Enhanced error handling
- Initial release
- Basic disconnect detection
- Corpse creation system
- Information display UI
Potential future features:
- Configurable combat detection
- Screenshot capture on disconnect
- Database logging
- Discord webhook notifications
- Admin notification system
Enjoy the script! If you have suggestions or feedback, feel free to reach out.