+entity remove_countdown;
+entity remove_player;
+int remove_time;
+
+void Remove_Countdown(entity this)
+{
+ if(remove_time <= 0 || TeamBalance_AreEqual(NULL))
+ {
+ if(remove_time <= 0)
+ {
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_MOVETOSPEC_REMOVE, remove_player.netname);
+ PutObserverInServer(remove_player, true, true);
+ }
+
+ Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_REMOVE);
+
+ delete(this);
+ remove_countdown = NULL;
+ remove_player = NULL;
+ remove_time = 0;
+
+ TeamBalance_RemoveExcessPlayers(NULL); // Check again for excess players in case someone also left while in countdown
+ return;
+ }
+
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_MOVETOSPEC_REMOVE, remove_player.netname, remove_time);
+ --remove_time;
+ this.nextthink = time + 1;
+}
+