Garry's Mod

Garry's Mod

Not enough ratings
Anti-AFK 4.0
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Server content
Addon Tags: Roleplay, Realism
File Size
Posted
1.953 KB
Feb 16, 2018 @ 2:34pm
1 Change Note ( view )

Subscribe to download
Anti-AFK 4.0

Description
Anti-AFK Version 4.0

Description:
This script monitors a players movements and actions on a server to attempt to determine if they are AFK. If they are found to be AFK it will tag them as such (client-side graphical).
Optionally (enabled by default) you can have the script kick players who have been afk for a certain number of minutes.

Installation Instructions:
Subscribe to the addon on the Steam Workshop. Once you've started your server, you can modify the default settings through your server console. See ConVars below.
http://steamcommunity.com/sharedfiles/filedetails/?id=1303583411

Console Variables:
aafk_enabled - ( Default: 1 ) - Is AAFK enabled? (0 - No, 1 - Yes)
aafk_flagminutes - ( Default: 5 ) - How long (in minutes) the player needs to be away before being flagged as AFK
aafk_kickminutes - ( Default: 10 ) - How long (in minutes) the player needs to be away before being kicked (if kicking is enabled).
aafk_ignoreadmins - ( Default: 0 ) - Should AAFK ignore admins? (0 - No, 1 - Yes)
aafk_kickenabled - ( Default: 1 ) - Should AAFK kick players who have remained AFK? (0 - No, 1 - Yes)
aafk_kickonlywhenfull - ( Default: 0 ) - If kicking is enabled, should AAFK only kick players when the server is full? (0 - No, 1 - Yes)
aafk_displayafkinchat - ( Default: 1 ) - Should it be announced to chat when a player goes AFK or returns from AFK? (0 - No, 1 - Yes)

Further Configuration:
If you are running ULX, you can give players or groups the ability to be ignored by the system. This also requires for aafk_ignoreadmins to be set to 1.

ulx groupallow [group] aafk_immunity
ulx userallow [user] aafk_immunity


Questions or Comments? Please comment!
10 Comments
Psychotrickser Dec 16, 2022 @ 6:34am 
Works perfectly fine. Thank you so much!
stevensky Apr 21, 2021 @ 11:49pm 
great work
I wonder if you can add a hook to when people get AFK they die. Like for an optional command since mostly of the people don't use that...
[GG] Flo Feb 20, 2020 @ 5:13am 
Hello,
can you add a concommand check?

example:
https://pastebin.com/bQVwB3dZ
Riker Sep 15, 2019 @ 4:29pm 
Wicked! Thanks :)
Mr.P  [author] Sep 15, 2019 @ 12:34pm 
I don't know. That would be something they would have to enable on their end since they're giving the XP. If they are checking for the AFK flag then it should work.
Riker Sep 15, 2019 @ 4:18am 
does this work with vrondakis's Levelling system? I'm looking for something to stop giving players XP when they go AFK? This addon is marked as "compatible" so I was wondering if it worked for what I'm looking for??
Mr.P  [author] Jul 18, 2019 @ 5:30pm 
you can put those in server console. They should save between sessions, but if they don't, you can add them to your garrysmod/cfg/server.cfg file and they'll load every time the server starts.
Mr.P  [author] Apr 25, 2019 @ 5:35pm 
Not tested in TTT, but it should, unless TTT overrides things that would break the detection.
4GClaroARG Apr 21, 2019 @ 6:06pm 
work in ttt?