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

Auto Full Server Spectator Kick and AFK Management


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
AoGBooya
Junior Member
Join Date: Jan 2016
Old 07-10-2016 , 00:47   Auto Full Server Spectator Kick and AFK Management
Reply With Quote #1

/* AMX Mod X
*
* Full Server Spec Kicker and AFK/Bomb management moded by [AoG] booya @ aogamers.org version 2.0
*
* This script manages full server auto spectator kick, afk transfers to spec, bomb transfers from afk to non-afk users and users camping out in spec mode.
*
* This script will kick spectators when the server is full and will be triggered after the server player slot max threshold has been reached.
* If enabled it will also be triggered to kick spectators who reach the max time limit.
*
* Review the settings below
*
* The script will give a warning to the user in spectator mode and after a certain time period will kick the user. An option was made for those recording demos in spec mode.
* This option is if a user is recording a demo, they would have type the command "/mydemo" while in spectate mode to extend their time period before being kicked.
*
* A WARNING message will be sent to the user explaining the same.
*
* By default the extended time period after typing "/mydemo" command while in spectator mode is envoked for 2 minutes. After 2 minutes another warning
* message will be sent to the spectator and they can again extend their spectator time.
*
* Commands and CVars:
* -----------------------------
*
* Client Command:
*
* "say /mydemo" - This allows users who type "/mydemo" in chat to extend their period of time to 2 minutes if they are recording a demo.
*
* Console Commands (You will need ADMIN_CFG flag to change)
*
* amx_fullspeckick - Toggles full server spectator auto-kick!
* amx_afkcheck - Toggles afk and bomb mangement check!
* amx_speckick - Toggles spectator auto-kick!
*
* CVar Settings:
*
* sv_fullspeckick - (Default: 1) and 0 = off (Turns on/off full server spectator script.)
* sv_afk_check - (Default: 1) and 0 = off (Turns on/off afk/bomb check.)
* sv_speckick - (Default: 0) and 1 = on (Turns on/off spectator kicking.)
* afk_transfer_time - (Default: 35) (This setting is the afk max allowed time. Cannot go lower than 25.)
* afk_kick_time - (Default: 70) (This setting is the spectator max allowed time in seconds. Cannot go lower than 25.)
* afk_kick_min - (Default: 12) (This setting is the minimal amount of people playing on the server required for auto spec kick to activate.)
*
*------------------------------
*
* Things to know:
*
* 1. Immunity, kick, slay or ban flags, one of those flags are required for admins to avoid being kicked if immunity is defined on below. Usually those flags are "cdae"!
*
* Defining IMMUNE_SPEC_ACCESS below to 0 sets immunity for admins off and 1 is on.
*
* ADMIN_IMMUNITY flag "a"
* ADMIN_KICK flag "c"
* ADMIN_BAN flag "d"
* ADMIN_SLAY flag "e"
*
* 2. Be sure to understand the setting FINALOVERRIDE and FINALWARNING as some maps even if you have a max of 32 player slots,
* the map itself may only allow 20 users/spawn points to actually play on a team and force the rest to play in spectate mode.
* More information on those settings are listed below by "#define FINALOVERRIDE and FINALWARNING" but ideally FINALOVERRIDE gives the
* user more time in spectator mode to join a team before being kicked. I have programmed a method to count spawn points on a map in which is the reason
* FINALOVERRIDE setting was created. It's basically used to prevent kick flooding on a map that forces users to stay in spectate mode by giving them
* more time to chose a team before being kicked.
*
* 3. HLTV spectators are kicked immediately and the first ones to go on a full server!
* 4. Those who just join the server and are unassigned are giving an immunity time period before the warning message is sent to them to join into a team game play.
* By default users have IMMUNE_TIME_AFTER_CONNECT 45 seconds to join a team then an additional FINALWARNING/FINALOVERRIDE time.
*
*/
Attached Files
File Type: amxx fullserver_speckick.amxx (12.2 KB, 285 views)
File Type: sma Get Plugin or Get Source (fullserver_speckick.sma - 1116 views - 31.2 KB)

Last edited by AoGBooya; 12-14-2016 at 15:50. Reason: Need to re-upload attachment
AoGBooya is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 07-10-2016 , 01:10   Re: Auto Full Server Spectator Kick and AFK Management
Reply With Quote #2

What did you do, copy this from another plugin?
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-10-2016 , 13:57   Re: Auto Full Server Spectator Kick and AFK Management
Reply With Quote #3

There is a more complete AFK manager here: https://forums.alliedmods.net/showthread.php?t=256449
__________________
HamletEagle is offline
AoGBooya
Junior Member
Join Date: Jan 2016
Old 07-14-2016 , 14:17   Re: Auto Full Server Spectator Kick and AFK Management
Reply With Quote #4

Wickedd, I took bits and pieces of code from other scripts as an idea, so what right? I modified a lot to suit what I was doing so the majority of the code is mine. You can do a quick review of it if you want.

Hamlet interesting, I did not find that one when I needed it so I made my own. Oh well, the code is stable so I posted it to you guys for review. Anyways thanks!

Last edited by AoGBooya; 07-14-2016 at 15:00.
AoGBooya is offline
Old 07-14-2016, 14:28
AoGBooya
This message has been deleted by AoGBooya. Reason: Invalid
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-18-2016 , 04:52   Re: Auto Full Server Spectator Kick and AFK Management
Reply With Quote #5

There are other plugins which do the job equally or better. Example:
https://forums.alliedmods.net/showthread.php?t=256449
https://forums.alliedmods.net/showthread.php?p=402870
https://forums.alliedmods.net/showthread.php?p=126963

Also your code needs to be fixed. Open a topic in scripting help forum if you want to get help with that.
__________________
HamletEagle is offline
AoGBooya
Junior Member
Join Date: Jan 2016
Old 12-14-2016 , 15:47   Re: Auto Full Server Spectator Kick and AFK Management
Reply With Quote #6

Ok since there are so many other pieces of code out there, this is only competition. I've updated this code, please keep in mind the /mydemo option.
AoGBooya 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 04:27.


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