This plugin has been designed to handle AFK players. It checks each player every 10 seconds to see if they are still in the same place, and if so, will kick them after a specified amount of time.
This has been tested on TF2 and CSS.
- Initial Release
- Fixed a bug where it wasn't clearing out the AFK times.
- Adjusted the code to check the clients eye position to verify AFK so that Snipers / Campers don't get kicked for not moving.
- Added a new cVar, sm_minplayerskick, to specify the minimum amount of players to have before kicking.
- Renamed sm_minplayers to sm_minplayersmove, to specify the minimum amount of players to have before moving them to spec.
- Suggestion: delete the old afk_manager.cfg so that it can generate a new one with the updated fields.
- Corrected the bad cVar bug that was spamming the log files.
- Corrected the version info for when the plugin is loaded.
- Corrected the issue with the AFK Manager not kicking players from spec.
- Corrected issue with players not on a team or class in TF2 not getting kicked.
- Corrected issue with picking a team not resetting the AFK timer.
- Corrected issue with it not kicking players from spec correctly.
- Rewrote the handlers that checked the players view. It was not updating on the fly, so if the player ever moved from spawn, they would not be counted as AFK.
- Corrected a bug in the code that prevented players from getting kicked.
- Corrected a bug in the code that made the plugin ignore players and not bots. (Yes, I had a ! in the wrong place
- NOTE: Unload Sourcemod when you reload this, or reboot your server. I removed some of the event hooks and we need to make sure they're cleared.
- Added a check in to deal with dead players.
- Fixed the glitch that prevented spectating players from getting kicked.
- Added in PrintToChat messages to notify the in-game players when someone was moved/kicked.
- Moved the Log and Kick messages above KickClient( ) to get rid of errors.
- Added in debug messages which can be enabled by setting _DEBUG to 1.
- Moved the check for MinPlayers, which shouldn't make any difference.
- Added a timer to delay the start of AFK checking so players have time to join the game.
- Corrected issues with the plugin kicking admins.
- Corrected issues with the plugin not paying attention to the MinPlayerCount restrictions.
- Corrected an issue where players joined a team from spec and got moved back because the AFK Timer wasn't reset.
- Fixed a bug where dead players would get moved to spec if they were floating in one place and didn't move for the afk timelimit.
- Added support for Synergy.
- Corrected a bug in the 'same place' eye check.
- Corrected an issue with TF2 Arena moving players into 'Waiting to Play' instead of 'Spectate'.
- Corrected a bug where if a player moved in the last few seconds before a kick it would not register their movement and kick them anyway.
- fixed hook event issue with CSS
- sm_afkenable - Enable or Disable the AFK manager
- sm_minplayersmove - Minimum number of players needed before AFK players are moved to spec.
- sm_minplayerskick - Minimum number of players needed before AFK players are kicked from spec.
- sm_adminsimmune - Are admins immune to being kicked for AFK? (Note: They'll still get moved to spec)
- sm_movespec - Move AFK players to spec before kicking them.
- sm_timetomove - Amount of time to wait before moving an AFK player.
- sm_timetokick - Amount of time to wait before kicking an AFK player.
Please let me know if you experience any issues or problems. The cfg file should be in cfg\sourcemod\afk_manager.cfg.