Raised This Month: $32 Target: $400
 8% 

PhAFK Manager


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   General Purpose       
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 11-03-2013 , 11:02   PhAFK Manager
Reply With Quote #1

PhAFK Manager

Primarily:
There is a huge amount of plugins AFK Managers. Unfortunately, many of them, out of date, buggy (server-side scripting ill-suited for AFK Manager), etc.
I hope that someone will choose this plugin as AFK Manager .

Description:
Plugin check players activity every 5 seconds (default constant), by time for Spectators (and Unassigned), by positions and view angles (hello to ATAC plugin with buried punishment) for alive players. And ... kick (or transfer to Spectators) AFK players.
Plugin also check cunning players who while in team, change team and stay in appearance select menu.
Bomb (C4) can be dropped from AFK player or transferred to teammate who not being AFK.
Round restart not reset AFK-state of players.
There is also immunity. By default, players with ADMIN_RCON access have immunity for kick from server by plugin. Players with ADMIN_IMMUNITY access have immunity for kick from server while in Spectators only.

CVARS (effect after restart):
  • afk_kick_time "90" — Time (in seconds) client can be AFK before will be kicked. "0" — disable kicking.
  • afk_spec_time "0" — Time (in seconds) client can be AFK before will be transferred to Spectators. This works only if server have "allow_spectators" "1" setting. "0" — disable this feature.
  • afk_bomb_time "15" — Time (in seconds) client can have bomb (C4) being AFK.
  • afk_bomb "2" — AFK bomb (C4) action: 0 — do nothing with bomb, 1 — drop bomb from AFK player, 2 — transfer bomb from AFK player to teammate who not being AFK.
  • afk_immunity_spec "1" — Enable/Disable immunity (ADMIN_IMMUNITY) for spectators.
  • afk_immunity "1" — Enable/Disable immunity (ADMIN_RCON) for kick.
  • afk_global_message "1" — Enable/Disable global message about last players-AFK's versus alive players:
  • afk_min_players "0" — Minimum players number for plugin works.

Thanks to:
Some tricks from AFK Manager by Leon McVeran.

Changelog:
  • 1.0 — Release.
  • 1.1 — Added afk_spec_time cvar. afk_kick_time cvar can be "0".
  • 1.2 — Added afk_min_players cvar. Small fix with some if/esle condition.
  • 1.3 — Small fix (zeroing AFK state for Player, when he join in Team (skin selected).
  • — Correct include of "fakemeta_util".
  • 1.4 — Correct unloading plugin in Intermission (End of Map) moment.
Attached Files
File Type: txt phafk.txt (524 Bytes, 514 views)
File Type: sma Get Plugin or Get Source (PhAFK.sma - 1240 views - 10.1 KB)

Last edited by Phant; 02-23-2014 at 10:14.
Phant is offline
Send a message via ICQ to Phant
Old 11-03-2013, 11:06
LordOfNothing
This message has been deleted by ConnorMcLeod. Reason: you continue
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 11-03-2013 , 17:34   Re: PhAFK Manager
Reply With Quote #2

Better use the cvars: mp_autokick and mp_autokick_timeout
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 11-03-2013 , 22:19   Re: PhAFK Manager
Reply With Quote #3

Quote:
Originally Posted by LordOfNothing View Post
I add "Primarily" paragraph in top of thread specially for guys like you.

Quote:
Originally Posted by ^SmileY View Post
Better use the cvars: mp_autokick and mp_autokick_timeout
Maybe AFK detection algorithms better, but not action (simple kick without additional functionality, and even chat messages).
Anyway, I can't test it, don't have "mp_autokick_timeout" (server not up to date).

Update:
Fix of last message condition. Working correct now. SMA file reuploaded.

Last edited by Phant; 11-04-2013 at 04:02.
Phant is offline
Send a message via ICQ to Phant
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 11-04-2013 , 07:08   Re: PhAFK Manager
Reply With Quote #4

Whell, an server upadated is required.
and any plugin is never better than original hlds features.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 11-10-2013 , 18:18   Re: PhAFK Manager
Reply With Quote #5

1.1:
  • Added afk_spec_time cvar.
  • afk_spec_kick cvar can be "0".
Plugin now can transfer AFK players to Spectators, also can do only this, without kicking.

Last edited by Phant; 11-10-2013 at 18:21.
Phant is offline
Send a message via ICQ to Phant
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 11-14-2013 , 10:11   Re: PhAFK Manager
Reply With Quote #6

Can you add :

If server is full (exmaple 20/20) and if some player is afk in SPEC while connecting new player server must transfer (kick) player in spec with connecting player.
Debesėlis is offline
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 11-14-2013 , 22:28   Re: PhAFK Manager
Reply With Quote #7

Quote:
Originally Posted by Debesėlis View Post
Can you add :

If server is full (exmaple 20/20) and if some player is afk in SPEC while connecting new player server must transfer (kick) player in spec with connecting player.
If server is full, then how new player can connect?

UPD:
1.2 — Added afk_min_players cvar. Small fix with some if/esle condition.

Last edited by Phant; 11-15-2013 at 06:59.
Phant is offline
Send a message via ICQ to Phant
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 11-15-2013 , 10:51   Re: PhAFK Manager
Reply With Quote #8

Quote:
Originally Posted by Phant View Post
If server is full, then how new player can connect?

UPD:
1.2 — Added afk_min_players cvar. Small fix with some if/esle condition.
Kick afk player which is in SPEC? and let new player to join.


BUG : player (minde) is in SPEC and server print "minde was transferred to the spectators for being AFK."...

Last edited by Debesėlis; 11-20-2013 at 05:37.
Debesėlis is offline
zaludan
Member
Join Date: Aug 2012
Old 12-06-2013 , 08:35   Re: PhAFK Manager
Reply With Quote #9

Does it "add up afk/spec sessions" or every afk/spec event resets time count?

What I mean - if afk_kick_time "60", a player stays afk for 45 secs one round, starts playing, and later within same map, he is afk again - will he be kicked after "new" 60 secs, or after "remaining" 15?

Same for spec - if afk_spec_time "600", a player stays in spec for 7 mins, plays few rounds, gets back in spec, will he be kicked after "new" 10 mins, or after "remaining" 3?

I'd need time to be reseted everytime a player gets afk/spec, so if you can provide eplanation how it works, or if it can be set up...
zaludan is offline
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 12-06-2013 , 21:16   Re: PhAFK Manager
Reply With Quote #10

Quote:
Originally Posted by Debesėlis View Post
Kick afk player which is in SPEC? and let new player to join.


BUG : player (minde) is in SPEC and server print "minde was transferred to the spectators for being AFK."...
Before transfer to Spectators, plugin check player team (team != CS_TEAM_SPECTATOR) for prevent this.

In your case, player probably was is in UNASSIGNED team (not SPEACTATORS).

zaludan, player will be kicked after "new" 60 secs.
Every 5 seconds (FREQ_AFK_CHECK), plugin check every player, for example, if player alive and stay in same place (as in pervious check), then player got +1 tick (g_afk_ticks[id]++).
If player have > N ticks (dependent by cvars), then he got action (be kicked/transferred/etc).
Else if player start playing, then plugin see it and set player tick to 0 (zero).
Phant is offline
Send a message via ICQ to Phant
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:14.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode