Day of Defeat Plugins Community
This site is an archive — everything is readable and downloadable, nothing can be posted. Admin

DoD AFK Manager (v1.0)

by Firestorm · 2006-07-08 · 27 replies · 20642 views · 891 downloads

Read the thread (28 posts)

From the first post

// DESCRIPTION:
rn// ============
rn//
rn// This is a real simple, but powerful AFK/Spectator Kicker!
rn// It's absolutely independent from the players position on
rn// the map as the counter until he's kicked starts to run down
rn// as soon as he joins the server and is only reset and starts
rn// from the beginning in the following cases:
rn// - player damages/kills another player
rn// - player gets score for taking a flag
rn// - player types in global-/teamchat
rn// - player throws a grenade
rn// - player changes team / switches class
rn// The SpectatorKicker is completely independent from the AFKKicker,
rn// as the action of the AFKKicker stops as soon as a player joins
rn// Spectators and the SpecktatorKicker takes over. Same applies
rn// vice versa, so you can safely only use one (or both for sure) parts
rn// of the plugin.
rn//
rn// * admins with a reserved slot who are afk aren't kicked
rn// * spectating admins aren't kicked
rn// * fakeclients, bots, hltvs aren't kicked either
rn
rn
// USAGE:rn// =====rn//rn// cvars:rn// ------rn//rn// dod_afkmanager_afkkick <1/0> = enable/disable AFK Manager (kicker)rn//rn// dod_afkmanager_afkkicktime

rn
rn
// CHANGELOG:rn// ==========rn//rn// - 13.07.2005 Version 0.5betarn// Initial Releasern//rn// - 17.07.2005 Version 0.6betarn// bugfixes:rn// - fixed errors that resulted from missingrn// checks whether the player was already connectedrn// or still connecting.rn//rn// - 12.08.2005 Version 0.7betarn// tweaks:rn// - added afktimer reset for shooting, switching weaponsrn// and bringing up the scope (snipers)rn// bugfix:rn// - resetting afktimer for capping flags is working nowrn//rn// - 26.06.2007 Version 0.8rn// - removed unneeded codern// - removed unreliable afk-timer reset-functionsrn// - added reset for throwing grenadesrn// - added reset for changing classrn// - updated "team change function" to use dod_client_changeteamrn// forwardrn// - changed to pcvar systemrn// - optimized the codern//rn// - 27.06.2007 Version 0.85rn// - replaced only catching Global-/TeamChat of a playerrn// with catching all of his commands.rn// - commands like "sprone, weapon_* , say, say_team" are coughtrn// nowrn//rn// - 02.07.2007 Version 0.9rn// - added global tracking cvarrn//rn// - 20.07.2007 Version 1.0rn// - replaced "client_death" with hooking thern// "DeathMsg"-Event for better reliabilityrn// - added "German" language definitions to thern// language filern//

Files

dod_afkmanager.sma Plugin Source 8 KB 471 dl Download Compile
dod_afkmanager.txt Config / Docs 694 B 420 dl Download

Archived builds from the server loose

These compiled builds sat loose in the server's script folder rather than attached to a post. They are matched to this release by comparing their decompiled Pawn against the source published above, so treat the attribution as strong but not certain. Versions come from the register_plugin() call recovered from the bytecode.

dod_afkmanager.sma v0.7beta 10 KB Download Compile
dod_afkmanager.txt Docs 463 B Download
dod_afkmanager_115.sma v0.7beta 10 KB Download Compile
dod_afkmanager_163.sma v0.7beta 9 KB Download Compile
dod_afkmanager_241.sma v0.99beta4 12 KB Download Compile
dod_afkmanager_353.txt Docs 463 B Download

The thread

All 28 posts from 12 people on DoD AFK Manager (v1.0), kept as they were written.

F Firestorm
started this thread
Posts: 31
Threads: 30
Joined: Jul 2006
07-08-2006, 10:38 AM #1

// DESCRIPTION:rn// ============rn//rn// This is a real simple, but powerful AFK/Spectator Kicker!rn// It's absolutely independent from the players position onrn// the map as the counter until he's kicked starts to run downrn// as soon as he joins the server and is only reset and startsrn// from the beginning in the following cases:rn// - player damages/kills another playerrn// - player gets score for taking a flagrn// - player types in global-/teamchatrn// - player throws a grenadern// - player changes team / switches classrn// The SpectatorKicker is completely independent from the AFKKicker,rn// as the action of the AFKKicker stops as soon as a player joinsrn// Spectators and the SpecktatorKicker takes over. Same appliesrn// vice versa, so you can safely only use one (or both for sure) partsrn// of the plugin.rn//rn// * admins with a reserved slot who are afk aren't kickedrn// * spectating admins aren't kickedrn// * fakeclients, bots, hltvs aren't kicked eitherrnrn

// USAGE:rn// =====rn//rn// cvars:rn// ------rn//rn// dod_afkmanager_afkkick <1/0> = enable/disable AFK Manager (kicker)rn//rn// dod_afkmanager_afkkicktime <time> = sets time in seconds a player can be AFKrn// before he's kicked off the server.rn//rn// dod_afkmanager_speckick <1/0> = enable/disable SpectatorKickerrn//rn// dod_afkmanager_speckicktime <time> = sets time in seconds a player can be arn// spectator before he's kicked off the serverrn//rn// dod_afkmanager_minplayers <amount> = minimum number of players that have to be on thern// server to get rid of afks and spectators
rnrn
// CHANGELOG:rn// ==========rn//rn// - 13.07.2005 Version 0.5betarn// Initial Releasern//rn// - 17.07.2005 Version 0.6betarn// bugfixes:rn// - fixed errors that resulted from missingrn// checks whether the player was already connectedrn// or still connecting.rn//rn// - 12.08.2005 Version 0.7betarn// tweaks:rn// - added afktimer reset for shooting, switching weaponsrn// and bringing up the scope (snipers)rn// bugfix:rn// - resetting afktimer for capping flags is working nowrn//rn// - 26.06.2007 Version 0.8rn// - removed unneeded codern// - removed unreliable afk-timer reset-functionsrn// - added reset for throwing grenadesrn// - added reset for changing classrn// - updated "team change function" to use dod_client_changeteamrn// forwardrn// - changed to pcvar systemrn// - optimized the codern//rn// - 27.06.2007 Version 0.85rn// - replaced only catching Global-/TeamChat of a playerrn// with catching all of his commands.rn// - commands like "sprone, weapon_* , say, say_team" are coughtrn// nowrn//rn// - 02.07.2007 Version 0.9rn// - added global tracking cvarrn//rn// - 20.07.2007 Version 1.0rn// - replaced "client_death" with hooking thern// "DeathMsg"-Event for better reliabilityrn// - added "German" language definitions to thern// language filern//
S snowyfriend
posted here
Posts: 9
Threads: 3
Joined: Oct 2006
10-24-2006, 12:15 AM #2

Any change the amxx mode can be created ???

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
10-24-2006, 11:07 AM #3
Any change the amxx mode can be created ???
nnnnwhat? that doesnt make any sense....

S snowyfriend
posted here
Posts: 9
Threads: 3
Joined: Oct 2006
10-24-2006, 11:21 PM #4

Never mind - i'm new at all this codeing but i've worked it out :p Thanks for the reply anywho

C Church
posted here
Posts: 6
Threads: 0
Joined: Oct 2004
10-25-2006, 02:54 AM #5

Does this plugin even work for anyone. I have it kicking people not even afk and leaving afk's in. I will post my server stats if it really is needed but I think this isnt working for alot of peolpe.

S Scrappy
posted here
Posts: 4
Threads: 0
Joined: May 2007
05-29-2007, 04:25 PM #6

any update on this pluggin please, it's not working on my server, Thanks

FeuerSturm
posted here
Posts: 166
Threads: 15
Joined: Jun 2007
06-26-2007, 02:32 PM #7

Hey guys!rnrni just updated the AFK Manager to Version 0.8!rnrnPlease give it a chance again as i removed all unreliablern"detections" and updated the 100%ly reliable detections.rnrnhere's the change log, please let me know about problemsrnand bugs!rnrn

//rn// - 26.06.2007 Version 0.8rn//   - removed unneeded codern//   - removed unreliable afk-timer reset-functionsrn//   - added reset for throwing grenadesrn//   - added reset for changing classrn//   - updated "team change function" to use dod_client_changeteamrn//     forwardrn//   - changed to pcvar systemrn//   - optimized the codern//
G Grottenolm
posted here
Posts: 21
Threads: 0
Joined: Jan 2005
06-26-2007, 03:05 PM #8
Hey guys!rnrni just updated the AFK Manager to Version 0.8!rn
rnrnWow, you are churning out new versions of your Plugins at a really astonishing rate! I hope your new Girlfriend get's enough attention, still ;)rnrnAnyway, as soon as I verified the new Team Manager and TK Management, I'll definitely give this one a try.

G Grottenolm
posted here
Posts: 21
Threads: 0
Joined: Jan 2005
06-26-2007, 07:16 PM #9

Well, at least with AMXX 1.76a (didn't update to "d" yet) I definitely have wrong kicks, still. A sniper got kicked in the middle of sniping... but he moved, not standing 100% still...nnBut then, in the code I can't see anything that rects to simply moving. So if you don't chat, kill, get killed, score flags - you just walk around, then you are counted as AFK... right?nnAnything I can do to help debug? Maybe provide the 10 Minute HLTV Demo I took and some logfile entries, as well as the config?

FeuerSturm
posted here
Posts: 166
Threads: 15
Joined: Jun 2007
06-27-2007, 01:57 AM #10

there are actually 2 problems:rnrn1st problem:rna position check is unreliable, means if a player is really afk and standingrnin his spawn and he gets TKed or blown up with an enemy grenadernhis position on the map changes as well as it changes when the roundrnis won/lost and he respawns.rnso i can neither check his position nor if he got wounded or killed as that canrnhappen without any interaction of the "afk" player.rnrn2nd problem:rnlooking for a user moving is possible and reliable BUT will use a lot ofrnresources as the timer is reset everytime he presses a movement key,rnso it would be like that for 5 seconds of walking around:rnreset, reset, reset, reset, reset, reset, reset, reset, reset, reset, reset,rnreset, reset, reset, reset, reset, reset, reset, reset, reset, reset, resetrnand so on......rnrnwhat i can add though is a check if he's having anything in his handsrnthat's not his primary gun. so if he changes his weapon to grenade orrnspade/knife the time will be reset.rna check if he switches to his primary gun would be useless as that's calledrnwhen a player spawns as well.rnrnbut i still have two questions:rn- what time are you using to kick afks?rn- is a player really contributing to the game that doesn't really interactrnand just moves around?

G Grottenolm
posted here
Posts: 21
Threads: 0
Joined: Jan 2005
06-27-2007, 03:53 AM #11
there are actually 2 problems:rnbut i still have two questions:rn- what time are you using to kick afks?rn- is a player really contributing to the game that doesn't really interactrnand just moves around?
rnrnCurrently I have 120 Seconds for Players, 320 Seconds for Spectators.rnrnBut actually I selected these values not knowing exactly how this plugin works. I know, RTFM ;) You are absolutely right about the "contributing to gameplay", though, so I guess I will simply increase the time to kick a bit.rnrnOn the other hand, one less resource hungry (at least I would beleive so) way to check for movement could be by setting up a task that is run, say, every minute or so. It saves the position (or better, yet, also the view vector) of each player. The next time it is run, it compares the new position to the old one. If it is different, it saves the new values and resets the FAK counter. If it is the same as before, it does nothing. rnrnOther detections that I could imagine to be save would be reloading, shooting, ducking, going prone etc. - but since I have no idea how resource intensive stuff like that is, I cannot really see if it is possible to use such stuff.rnrnMy problem was/is, that in case I am on some server, I would expect that "moving" shows I am not AFK - so when being on the phone I would move around a bit, expecting not to be kicked. Seemingly other players have the same perception, not knowing what is involved programming-wise.

FeuerSturm
posted here
Posts: 166
Threads: 15
Joined: Jun 2007
06-27-2007, 01:37 PM #12

ok, here's the new version, please see changelog:rnrn

//rn// - 27.06.2007 Version 0.85rn//   - replaced only catching Global-/TeamChat of a playerrn//     with catching all of his commands.rn//   - commands like "sprone, weapon_* , say, say_team" are coughtrn//     nowrn//
rnrnnow only players that really don't do anything (besides running around)rnwill be kicked.rnrnPlease be sure to use a kicktime between 3 and 10 minutes for bestrnresults!rnrn@GrottenolmrnrnFor your position checking suggestion please check "1st problem" in myrnlast post! ;) rnif you're not really sure why it's unreliable please send me a PM and i'llrnexplain it in german :D

G Grottenolm
posted here
Posts: 21
Threads: 0
Joined: Jan 2005
06-27-2007, 03:28 PM #13
nnnow only players that really don't do anything (besides running around)nwill be kicked.nnPlease be sure to use a kicktime between 3 and 10 minutes for bestnresults!nn@GrottenolmnnFor your position checking suggestion please check "1st problem" in mynlast post! ;) nif you're not really sure why it's unreliable please send me a PM and i'llnexplain it in german :D
nnI see, it simply is a different approach actually. So I'll set the kick time higher, to be sure to kick either AFKers or totally unproductive guys :)nnI understand the "1st problem"... although I personally didn't weigh it much. This is since I was thinking of fairly low kick times like 2 minutes, where the chance of a round change or map change is fairly low. Also I didn't really have much concern about players' positions changing due to being killed / TKed, since this is quite rare... plus it does not really lead to "false positives" (not AFK players being kicked for AFK), it would "only" lead to cases of AFK players not being kicked after the time set. But as I said, when thinking about low kick times, it doesn't really matter if an AFKer is kicked after 2 or 4 minutes. Even one could take care of this from a coding standpoint... for example with 2 or 3 sets of "last positions". So one could detect if the position has only changed sporadically over the last x minutes...nnBut anyway for the new version, I think the plugin should work perfectly as soon as I use it as it was designed (longer kick times), so I don't see a real need for any further additions. I'll start the test run tonight...nnBut one additional question: I didn't find an exhaustive list on the AMXX website telling what kinds of actions are caught by the client_command. Do you have a link to a list or a description?

FeuerSturm
posted here
Posts: 166
Threads: 15
Joined: Jun 2007
06-27-2007, 03:50 PM #14
But one additional question: I didn't find an exhaustive list on the AMXX website telling what kinds of actions are caught by the client_command. Do you have a link to a list or a description?
rnrnActually i don't have a description, i created a little testplugin thatrndisplays when and what command has been caught.rnrnCommands caught that i actually remember:rnsprone (= user pressed "Prone" key)rnsay (= user talks in global chat)rnsay_team (= user talks in team chat)rnjointeam (= user selected/changed team)rncls_******* (= user selected class "********")rnweapon_****** (= user selected weapon "******")rnrnthere are still some other that i'll post if i can remember them! :DrnrnEDIT:rnlastinv (= user presses key to switch to last used weapon)rnchangeclass (= user opens "Change Class" menu)rnchangeteam (= user opens "team selection" menu)rndrop (= user presses "Drop weapon" key)rndropammo (=user presses "Drop MG Ammo" key)rndropobject (= user drops an object (like sattchelcharge etc..))rnvoice_menu* (= user opens the voice menus)rnvoice_***** (= player uses voice announcements)rnmenuselect (= player pressed a key in a menu)rnamx_********* (= admin commands will be caught as well)rnrni think there's still a few more, you can try with a simple function:rn
public client_command(id)rn{rn	new command[32]rn	read_argv(0,command,31)rn	client_print(id, print_chat,"COMMAND: '%s' caught!!!!!", command)rn	log_amx("Command: '%s' has been caught!",command)rn	return PLUGIN_CONTINUErn}
rnthen you just have to run through the map and press all kind of keys :D

=|[76AD]|= TatsuSaisei
posted here
Posts: 794
Threads: 54
Joined: May 2005
06-27-2007, 04:24 PM #15
n
public client_command(id)n{n    new command[32]n    read_argv(0,command,31)n    client_print(id, print_chat,"COMMAND: '%s' caught!!!!!", command)n    log_amx("Command: '%s' has been caught!")n    return PLUGIN_CONTINUEn}
nthen you just have to run through the map and press all kind of keys :D
n nThanx !! After reading his post I got curious myself and started searching the amxmodx forum and come up bust.. then decided I was going to make a simple logger, but you did the work for me !!!n nThanx

FeuerSturm
posted here
Posts: 166
Threads: 15
Joined: Jun 2007
06-27-2007, 04:29 PM #16
|= TatsuSaisei;6536']Thanx !! After reading his post I got curious myself and started searching the amxmodx forum and come up bust.. then decided I was going to make a simple logger, but you did the work for me !!!rn rnThanx
rnrnYou're welcome, but please take into account that it's only loggingrnthe command and not the arguments! (only logs "jointeam" NOT "jointeam 1"rnfor example).rnbut you can change the code to log the arguments as well as needed.rnjust use "read_args ( output[], len )" instead of read_argv and yournave the full commandline including all arguments.

FeuerSturm
posted here
Posts: 166
Threads: 15
Joined: Jun 2007
07-02-2007, 05:11 PM #17
//rn// - 02.07.2007 Version 0.9rn//   - added global tracking cvarrn//
rnrnAs always, please report bugs with the new version immediately!rnrnEnjoy!

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
07-02-2007, 05:21 PM #18
//n// - 02.07.2007 Version 0.9n//   - added global tracking cvarn//
As always, please report bugs with the new version immediately!nnEnjoy!
nnwhat bugs could there be from just adding a public cvar :P

FeuerSturm
posted here
Posts: 166
Threads: 15
Joined: Jun 2007
07-02-2007, 05:23 PM #19
what bugs could there be from just adding a public cvar :P
rnrnactually none, but as i'm updating all plugins and not only addingrnthe tracking cvar i use that sentence as "standard" ;) :cool:

FeuerSturm
posted here
Posts: 166
Threads: 15
Joined: Jun 2007
07-20-2007, 01:14 PM #20
//rn// - 20.07.2007 Version 1.0rn//   - replaced "client_death" with hooking thern//     "DeathMsg"-Event for better reliabilityrn//   - added "German" language definitions to thern//     language filern//
rnrnlately i noticed that people that are AFK for longer than i set the timerrnstill remain on the server and i think i finally found the problem and fixedrnit. it's the "client_death" forward that i was using that is buggyrn(well know by the devs and hopefully fixed in AMXX 1.80),rnso i replaced it with the "old" method of hooking the "DeathMsg" whichrnis absolutely reliable.rnrnIf you still encounter AFKs remaining on your server, please let me know!rnrnP.S.:rnGerman, English, French language is already within the dictionary,rni'd be glad to get some more languages!

B Bandit
posted here
Posts: 1
Threads: 0
Joined: Oct 2007
10-23-2007, 12:32 PM #21

Why did you use soo long cvars?

Ba5ic
posted here
Posts: 181
Threads: 26
Joined: Nov 2005
11-26-2007, 05:11 PM #22

Hello GuysrnrnAny assistance would be greatly appreciated, i've set the afk manager using the following cvars:rnrn// DoD_AFK Manager cvars:rn// rndod_afkmanager_afkkick 1 = enable/disable AFK Manager (kicker)rndod_afkmanager_afkkicktime 360 = sets time in seconds a player can be AFKrn // before he's kicked off the server.rndod_afkmanager_speckick 1 = enable/disable SpectatorKickerrndod_afkmanager_speckicktime 360 = sets time in seconds a player can be arn // spectator before he's kicked off the serverrndod_afkmanager_minplayers 2 = minimum number of players that have to be on thern // server to get rid of afks and spectatorsrnrnrnFirstly i removed my admin rites to test it's working. I then tried the spec kick and after 360 seconds it indeed booted me off. Now my problem i joined axis and just waited in spawn without moving and nothing happened, this is set to 360 seconds as well. I also tried it as allies but same problem.rnrnrnAny idea's please??!!.rnrnThanks in advance.

Ba5ic
posted here
Posts: 181
Threads: 26
Joined: Nov 2005
11-30-2007, 04:21 AM #23

Any idea's guys?rnrnTIA

Ba5ic
posted here
Posts: 181
Threads: 26
Joined: Nov 2005
01-01-2008, 07:58 AM #24
Hello GuysrnrnAny assistance would be greatly appreciated, i've set the afk manager using the following cvars:rnrn// DoD_AFK Manager cvars:rn// rndod_afkmanager_afkkick 1 = enable/disable AFK Manager (kicker)rndod_afkmanager_afkkicktime 360 = sets time in seconds a player can be AFKrn // before he's kicked off the server.rndod_afkmanager_speckick 1 = enable/disable SpectatorKickerrndod_afkmanager_speckicktime 360 = sets time in seconds a player can be arn // spectator before he's kicked off the serverrndod_afkmanager_minplayers 2 = minimum number of players that have to be on thern // server to get rid of afks and spectatorsrnrnrnFirstly i removed my admin rites to test it's working. I then tried the spec kick and after 360 seconds it indeed booted me off. Now my problem i joined axis and just waited in spawn without moving and nothing happened, this is set to 360 seconds as well. I also tried it as allies but same problem.rnrnrnAny idea's please??!!.rnrnThanks in advance.
rnrnI guess this plugin is defunk'd now - the spectator kick option is working fine but the AFK kick option does not work. I use the spec option and have had to install a diff afk kicker, annoying but there you go.rnrnI was looking at Brads Play or be kicked Plugin http://forums.alliedmods.net/showthread.php?p=126963rnrnIt says it's for CS only but could this be mod'ed to DoD - If it can, i'll make a formal request in the relevant section here.rnrnIt's just frustratin, i would like an all in one spec/afk kicker :)rnrnPS. i have PM'ed Brad about its compatibility with DoD.

Ba5ic
posted here
Posts: 181
Threads: 26
Joined: Nov 2005
02-19-2008, 03:00 PM #25
Hello GuysrnrnAny assistance would be greatly appreciated, i've set the afk manager using the following cvars:rnrn// DoD_AFK Manager cvars:rn// rndod_afkmanager_afkkick 1 = enable/disable AFK Manager (kicker)rndod_afkmanager_afkkicktime 360 = sets time in seconds a player can be AFKrn // before he's kicked off the server.rndod_afkmanager_speckick 1 = enable/disable SpectatorKickerrndod_afkmanager_speckicktime 360 = sets time in seconds a player can be arn // spectator before he's kicked off the serverrndod_afkmanager_minplayers 2 = minimum number of players that have to be on thern // server to get rid of afks and spectatorsrnrnrnFirstly i removed my admin rites to test it's working. I then tried the spec kick and after 360 seconds it indeed booted me off. Now my problem i joined axis and just waited in spawn without moving and nothing happened, this is set to 360 seconds as well. I also tried it as allies but same problem.rnrnrnAny idea's please??!!.rnrnThanks in advance.
rnrnCan anyone help me out here please, as stated above the spec option works but not the afk kicker, has anyone any idea's as to why it does not kick AFK'ers?.rnrnI really like how the plugin and how it works albeit the spec part.rnrnFailing this, could one of the coder's look kindly on me and possibly write me a new spec/afk management plugin.rnrnThanks In Advance.

WARDOG
posted here
Posts: 141
Threads: 14
Joined: Jan 2006
03-10-2008, 01:50 PM #26

I still use his:rnrn // - 12.08.2005 Version 0.7betarn// tweaks:rn// - added afktimer reset for shooting, switching weaponsrn// and bringing up the scope (snipers)rn// bugfix:rn// - resetting afktimer for capping flags is working nowrn//rnrnIt still works fine 98% of the time. Rare instance of not kicking, or kicking person moving, but for the most part works fine for us.rnrndod_afkmanager_afkkick 1rnrndod_afkmanager_afkkicktime 300rnrndod_afkmanager_speckick 1rnrndod_afkmanager_speckicktime 300rnrndod_afkmanager_minplayers 1rnrn300 = 5 min.rnrnMaybe try setting your spec time equal to the in game time.

Ba5ic
posted here
Posts: 181
Threads: 26
Joined: Nov 2005
10-26-2008, 09:26 AM #27

This has suddenly started working for me since i updated to 1.81v !?.

S shortround
posted here
Posts: 4
Threads: 0
Joined: Dec 2010
01-05-2012, 12:20 PM #28

Can you add ability to allow players who are afk to just be put in spectator ?

DoD Plugins Archive · Repository · Old Forum Threads · Maps · Admin · built 14 Sep 2026 00:34 UTC