Introduction
This plugin kicks people who waste a player slot by sitting on the team selection screen to idle. I've encountered players doing this many times, and it is incredibly annoying.
ConVars
sm_unassignedkicker_version - Standard version ConVar, nothing to see here.
sm_unassignedkicker_timer - How long (in seconds) should the timer be, before it checks the connected player's team? (Default = 600.0 seconds, equal to 10 minutes)
sm_unassignedkicker_message - What do you want the kick reason to say? (Default = "If you return, please join a team")
Oh, and just a side-note about the message ConVar: You do not need to add a period to your kick message. The game automatically adds one. For example, if you set your kick message to "Please join a team.", it'll show up as "Please join a team.." to people who get kicked.
Installation
Download unassignedplayerkicker.smx
Place the file in sourcemod/plugins folder.
Set up the timer and message ConVars in your server.cfg file
Load the plugin up ingame via RCON (rcon sm plugins load unassignedplayerkicker.smx)
???
Profit!
Change Log
Spoiler
Version 3.0 - October 20th, 2015
Removed Updater dependency as I no longer use it.
Version 2.0 -April 9th, 2014
Added in Updater support for auto-updating!
Added in checks to prevent SourceTV and Replay "clients" don't get kicked.
Added in an "IsClientInGame" check before the "!IsValidTeam" check, just to make sure the client is in game. It seems I apparently added this check in back in February of last year (see below), but for some reason that check has disappeared....so it's been re-added.
Also added an "!IsClientConnected" check to prevent any errors from popping up when a client disconnects before the timer expires.
Compressed the hell out of the code and removed all the commented-out notes I left.
Version 1.3 - September 2nd, 2013
Added in anti-admin kicking. No convar for it, but it checks if you have the "b" flag, and won't kick you if you do.
Version 1.2 - March 5th, 2013
Implemented the fixes suggested by Dr. McKay, to make sure that the plugin doesn't accidentally kick the wrong player.
Version 1.1 - February 21st, 2013
Fixed the "[SM] Native "GetClientTeam" reported: Client # is not in game" error by adding an !IsClientInGame check, and having it return Plugin_Handled;
Version 1.0 - February 20th, 2013
Initial release
Last edited by 404UserNotFound; 10-20-2015 at 01:36.
Reason: Updating!