This is a Anti-AFK system for FiveM servers that detects inactive players and presents them with a captcha challenge to prevent automatic kicks. This resource helps maintain server performance by removing idle players while giving legitimate players a chance to prove they're still present.
- Configurable AFK detection thresholds
- Customizable captcha system
- Permission-based exemptions
- Multiple UI styles for captcha panel
- Detailed notification system
- Debug mode for testing
The system can be fully customized through the config.lua file.
Config.AfkWarningThreshold = 10 -- Minutes before showing warning
Config.KickTime = 60 -- Seconds until kick after warningConfig.CaptchaLength = 6 -- Length of captcha text
Config.CaseSensitive = true -- Whether captcha verification is case sensitivePlayers with specific permissions can be exempted from the AFK checks:
Config.ExemptPermissions = {
"group.admin", -- Example permission
"group.mod",
"command.bypassafk" -- Custom ACE permission
}Config.Title = "ANTI-AFK SYSTEM"
Config.Description = "You are about to be kicked for inactivity..."
Config.ButtonText = "Confirm"
Config.ServerName = "Teezy Core Developments"
Config.AllowCancel = false
Config.PanelStyle = "modern" -- Available: default, modern, minimal, futuristic, retro
Config.CaptchaStyle = "default" -- Available: default, neon, minimalist, gradient, 3d, etc.Config.ColorPalette = {
primary = "#F13D3D", -- Red
secondary = "#7B2222", -- Darker red
background = "#0A0A0A", -- Near Black
text = "#FFFFFF" -- White
}The system monitors player activity through:
- Movement detection
- Key presses
- Mouse movements
If a player is inactive for the specified threshold time, the AFK warning is displayed.
When triggered, players are presented with a captcha they must enter correctly to avoid being kicked. The captcha:
- Is randomly generated
- Can be case-sensitive (configurable)
- Has customizable styling
The permissions.lua file handles checking if a player has permission to bypass AFK checks based on ACE permissions defined in the config.
In debug mode, the following commands are available:
/testafk- Triggers the AFK warning UI for testing
- Place the
cfx-tcd-antiAFKfolder in your server's resources directory - Add
ensure cfx-tcd-antiAFKto your server.cfg - Configure settings in config.lua as needed
- Restart your server
Developed by Teezy Core Developments