Raised This Month: $51 Target: $400
 12% 

Chris's simple anti-afk plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Chrissucks
New Member
Join Date: Mar 2020
Old 03-23-2020 , 23:55   Chris's simple anti-afk plugin
Reply With Quote #1

Hey, after looking at the anti-afk plugins and noticing that most have tons of extra bloat and unneed code when most of their functionality is already built into the game. I have developed this anti-afk plugin.

Code:
Update 3/24/2020 1.0.1
- Changed event to player_footstep to allow for more gametypes

Update 3/23/2020 1.0.0
- Initial release
It works pretty simply, when a player runs the server calls the event "player_foostep"
we store this value in the bool "stepped" then when the buytime ends. Any players who hasn't caused a footstep at least once will be moved to spectator. this plugin does not kick players as there already exists settings to kick spectators after a specific amount of time.

there are no CVars required for this plugin as it only uses in-game functions.

I have included the source code for this plugin if you wish to modify it in anyway.

Enjoy!
Attached Files
File Type: sp Get Plugin or Get Source (chrisafkmanager.sp - 222 views - 1.7 KB)

Last edited by Chrissucks; 03-24-2020 at 14:37.
Chrissucks is offline
YourDignity
Junior Member
Join Date: Sep 2018
Old 03-23-2020 , 23:58   Re: Chris's simple anti-afk plugin
Reply With Quote #2

nice plugin
YourDignity is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 03-24-2020 , 05:40   Re: Chris's simple anti-afk plugin
Reply With Quote #3

Remove spaces from files name.
Also, specify that this plugin will work only in competitive/casual (maps based on bombs or hostages), because you check if the player left the buyzone.
__________________
Ilusion9 is offline
P4UL
AlliedModders Donor
Join Date: Apr 2017
Location: Netherlands
Old 03-24-2020 , 07:03   Re: Chris's simple anti-afk plugin
Reply With Quote #4

Nice idea but I don't think this would work on every map, especially dust 2, where T side players can awp mid from inside the buyzone.
Maybe it is an idea to store the player's spawn location and at the end of the buytime check their location again and compare them?

Last edited by P4UL; 03-24-2020 at 07:05.
P4UL is offline
Chrissucks
New Member
Join Date: Mar 2020
Old 03-24-2020 , 10:18   Re: Chris's simple anti-afk plugin
Reply With Quote #5

Quote:
Originally Posted by P4UL View Post
Nice idea but I don't think this would work on every map, especially dust 2, where T side players can awp mid from inside the buyzone.
Maybe it is an idea to store the player's spawn location and at the end of the buytime check their location again and compare them?
Personally I don't think it would be that big of a problem on dust 2 as buytime is around ~40 seconds leaving plenty of time to check the cross without getting moved. Other plugins exist if you want to use position data to kick / move AFK players. They don't work properly for my server so I developed this one.

edit:
It might be possible to achieve a similar effect by swapping out the event "exit_buyzone" with "player_footstep" this would work in my use case as players that are moving at 1.01 velocity won't trigger footsteps. I will do some testing later and update the plugin if the results are satisfactory.

Last edited by Chrissucks; 03-24-2020 at 10:22.
Chrissucks 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 13:05.


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