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

AwayFrom_Manager [CS AFK Manager]


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Server Management       
mlb
Junior Member
Join Date: May 2011
Location: US
Old 05-31-2011 , 14:18   AwayFrom_Manager [CS AFK Manager]
Reply With Quote #1

I could not find an AFK system similar to this for CS 1.6, so I decided to make it.

What is does
AFM helps you manage your pesky AFKs by allowing you to do a variety of actions on them.

Variables
Code:
afm_enable "1"			// Yeah...
afm_afkcmd "1"			// default: 1 [0|1] Enable saying "/afk" to be moved to spectator
afm_afktime "25"		// default: 25 [0+] Amount of time unmoved after freezetime before being considered AFK
afm_announce "1"		// default: 1 [0|1] Announce punishments to server
afm_checktime "6"		// default: 6 [1+] Amount of time between checks on position.
					// Lowering will increase CPU load but also increase accuracy
afm_punishment "3"			// default: 3 [0-6] Type of punishment
// 0 - No Punishment. Used if someone wanted to only do prefix and/or drop bomb.
// 1 - Poke (Taunt the player with text)
// 2 - Prod (Taunt the player and slap them for 5 dmg)
// 3 - Hurt (Gradually take HP from player while they are afk)
// 4 - Slay player (Does not change k/d ratio)
// 5 - Move player to spectate (Does not change k/d ratio)
// 6 - Kick player from server

afm_minplayers "2"		// default: 2 [0+] Min player # for checking afks
afm_useprefix "0"		// default: 0 [0|1] Enable appending prefix to names of afks
afm_prefix "[afk] "		// default: "[afk]" String appended to name. Note that prefix + name length is at max 31 so some chars might be overflowed
afm_log "0"			// default: 0 [0|1] Enable logging punishments
afm_hptickamount "5"		// default: 5 [1+] If punishment is taking HP (3): Amount of HP to take per tick
afm_hpticktime "5"		// default: 5 [1+] If punishment is taking HP (3): Seconds between taking HP
afm_dropbomb "1"		// default: 1 [0|1] If afkers should drop the bomb
For those who want to just drag and drop, I've attached a zip you can extract and just drag and drop it into your amxmodx folder.

Required Modules:
amxmodx
amxmisc
cstrike
fun

Other Stuff
If anyone has an optimization, please let me know. Also, I'd like to make this work for all HL1 mods, but don't know how to remove the CS specific functions. I'd appreciate any help with that.

I'm thinking about adding stages for the AFK checker. E.g. first time a player is marked as AFK slap them, the second time move them to spectate, the third time kick them. If that's something people would be interested in, it can be added. I'd probably make it as a separate plugin that extends on the first.

And how do I go about getting my mods to list on the amxmod plugins page? Does it just take time to update?

Updates
5/31/11 - v1.1 - Major overhaul of code. Moved to cvar pointers. Changed "afm_sayafk" to "afm_afkcmd". Changed "afm_punish" to "afm_punishment".
Attached Files
File Type: txt afm_lang.txt (1.1 KB, 1240 views)
File Type: zip afk_v1.1.zip (13.6 KB, 976 views)
File Type: sma Get Plugin or Get Source (afm_melbs.sma - 2164 views - 9.7 KB)
File Type: cfg afm.cfg (1.6 KB, 974 views)
__________________

Last edited by mlb; 05-31-2011 at 19:54.
mlb is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 05-31-2011 , 14:24   Re: AwayFrom_Manager [CS AFK Manager]
Reply With Quote #2

Use cvar pointers.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
mlb
Junior Member
Join Date: May 2011
Location: US
Old 05-31-2011 , 16:51   Re: AwayFrom_Manager [CS AFK Manager]
Reply With Quote #3

Quote:
Originally Posted by bibu View Post
Use cvar pointers.
I used them on the variables that get read every tick, but not for those that happen on round start or when an afk is found, as this should be infrequent. Should I not assume that and use cvar pointers regardless?
__________________
mlb is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-31-2011 , 17:00   Re: AwayFrom_Manager [CS AFK Manager]
Reply With Quote #4

Cvar pointer is a requirement to be approved and just because it's not called often doesn't mean you can ignore. It's a must considering how it's very slow if you don't use it.
__________________

Last edited by Arkshine; 05-31-2011 at 17:05.
Arkshine is offline
mlb
Junior Member
Join Date: May 2011
Location: US
Old 05-31-2011 , 19:55   Re: AwayFrom_Manager [CS AFK Manager]
Reply With Quote #5

Quote:
Originally Posted by Arkshine View Post
Cvar pointer is a requirement to be approved and just because it's not called often doesn't mean you can ignore. It's a must considering how it's very slow if you don't use it.
Nice to know. Updated.
__________________
mlb is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-01-2011 , 03:41   Re: AwayFrom_Manager [CS AFK Manager]
Reply With Quote #6

Just for your information, it's slow because each time you call get_cvar_* it needs to loop through all cvars checking its name to find the its pointer. Since there are a lot of cvars, you can imagine it's a performance issue. That's why it's better to retrieve the pointer into a var so we can work directly with it.
__________________
Arkshine is offline
kNowo
Senior Member
Join Date: Apr 2011
Location: Malaysia
Old 06-04-2011 , 04:15   Re: AwayFrom_Manager [CS AFK Manager]
Reply With Quote #7

'K' stands for 'keyboard'.
kNowo is offline
frozen byte
Senior Member
Join Date: Aug 2011
Old 08-08-2012 , 13:09   Re: AwayFrom_Manager [CS AFK Manager]
Reply With Quote #8

Hi great plugin.
afm.cfg
putted in config and i have modify the punishment to 5 but still working on 2
it works only by console amx_cvar afm_punishment 5
Quote:
/ ********************** AwayFrom_Manager Settings **********************
/ ** Plugin by: Melbs
/ ** ** http://eatingshoes.com **
afm_enable "1" // Yeah...
afm_afkcmd "1" // default: 1 [0|1] Enable saying "/afk" to be moved to spectator
afm_afktime "45" // default: 25 [0+] Amount of time unmoved after freezetime before being considered AFK
afm_announce "1" // default: 1 [0|1] Announce punishments to server
afm_checktime "6" // default: 6 [1+] Amount of time between checks on position.
// Lowering will increase CPU load but also increase accuracy
afm_punishment "5" // default: 3 [0-6] Type of punishment
// Types of punishment:
// 0 - No Punishment. Used if someone wanted to only do prefix and/or drop bomb.
// 1 - Poke (Taunt the player with text)
// 2 - Prod (Taunt the player and slap them for 5 dmg)
// 3 - Hurt (Gradually take HP from player while they are afk)
// 4 - Slay player (Does not change k/d ratio)
// 5 - Move player to spectate (Does not change k/d ratio)
// 6 - Kick player from server

afm_minplayers "4" // default: 2 [0+] Min player # for checking afks
afm_useprefix "0" // default: 0 [0|1] Enable appending prefix to names of afks
afm_prefix "[afk]" // default: "[afk]" String appended to name. Note that prefix + name length is at max 31 so some chars might be overflowed
afm_log "0" // default: 0 [0|1] Enable logging punishments
afm_hptickamount "5" // default: 5 [1+] If punishment is taking HP (3): Amount of HP to take per tick
afm_hpticktime "5" // default: 5 [1+] If punishment is taking HP (3): Seconds between taking HP
afm_dropbomb "1" // default: 1 [0|1] If afkers should drop the bomb
frozen byte is offline
WhyThis
Senior Member
Join Date: May 2013
Old 05-29-2013 , 13:52   Re: AwayFrom_Manager [CS AFK Manager]
Reply With Quote #9

Waw thanks a lot thars what i am loooking for !!!
Thabks a lot
5 stars i vioted
WhyThis is offline
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 08-26-2014 , 20:57   Re: AwayFrom_Manager [CS AFK Manager]
Reply With Quote #10

Its a really nice idea of a plugin.
But it doesnt work properly, its very buggy, sometimes works outhers times not.
Also he doesnt read lang/config files..

Can somebody fix this plugin?
Syturi0 is offline
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:44.


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