The plugin is an another unscrambler for Left 4 Dead 2 and comes with a teambalancer and team switching rules. It has a menu to enable/disable options and switching/swapping players. In addition it includes a vote-system to swap players.
Installation & Compiling:
Just copy the files from the zip-file to the right folders.
The Plugin is active in versus based games when it is be displayed in the admin menu. Or the console commands give a reply - means the plugin is activated.
The Plugin uses the colors plugin written by exvel, which you can find here. But you have to use the files from package to compile the plugin, i added some functions for my needs.
ConVars:
PHP Code:
//Enables all supported versus game modes (mutation15 or versus survival is included) i.e. "versus;mutation12;" Empty string means all types of versus games are allowed.
l4d2_aus_gamemodes = ""
//Turns On/Off the teambalancing function (1|0 = off). This option fills up the teams with a balancing value of +-1 player when a new player joins a game. Teams connecting via lobby system are being untouched.
l4d2_aus_teambalancing = 1
//Defines the tick count. How often the info of "still loading players" will appear after mapchanges (n * 3 sec). Works when the Unscrambler is running.
l4d2_aus_tick_count = 3
//Shows an information when a new player connects to a server (1|0 = Off)
l4d2_aus_show_announcement = 1
// How many times admins are be bothered of teamchange wishes until the player gets a message in the middle of the screen + awful sound. Some players are trying to change the team some hundred times and are bothering admins. (True Story)
l4d2_aus_changeteamadmininfo = 3
// Defines a timeout in ~minutes after a long loading player will be kicked.
l4d2_aus_timeout = 3;
//Sets a timeout how long in minutes the team of a disconnected player player will be stored/remembered.
l4d2_aus_storage_time = 10
//Which kind of disconnected player will be stored? When a player disconnects by "Disconnect by user" or valve kicks them out with "no steam logon"? Or just by a timeout?
l4d2_aus_storage_filter = "Disconnect by user;no steam logon;timed out;Steam Auth Ticket Has Been Canceled"
//executes a set of commands to server when a new player joins a team.
l4d2_aus_newpl_execmdlist0 = ""
//executes a set of commands to all players on server when a new player joins a team.
l4d2_aus_newpl_execmdlist1 = ""
//executes a set of commands to all admins when a new player joins a team.
l4d2_aus_newpl_execmdlist2 = ""
//executes a set of commands to all survivors when a new player joins a team.
l4d2_aus_newpl_execmdlist3 = ""
//executes a set of commands to all infected when a new player joins a team.
l4d2_aus_newpl_execmdlist4 = ""
//*All commands can be used with the userid in the string. For example: "sm_cmd1 %d;sm_cmd2 param1 %d;"
//Is a convar which can be used by other plugins to determine if the teambalancer is still running or not. The cvar just shows the count of still loading players. 0 = not running.
l4d2_aus_players_loading = 0
// Sets rules when team-switching is allowed.
l4d2_aus_permissions = 14
Sum up these values to enable the switching options. What you set via admin menu is gone after a server restart.
PHP Code:
//Team switching is blocked.
PERM_BLOCK_TEAM_SWITCHING = 1
//Team switching is not allowed when a finale has begun.
PERM_BLOCKED_DURING_FINALES = 2
//Team switching is not allowed when there is a difference of 2 players between both teams. (2:4 or 1:4)
PERM_BLOCKED_TWO_PL_DIFF = 4
//Allows team switching from the winning team to the disadvantaged team when the winning team has 1 more player.
PERM_ALLOW_WINNING_TO_LOSING_TEAM_DIFF_1 = 8
//Polls for player swapping are enabled. Limited to 1 vote per map and per player.
PERM_ALLOW_POLLS = 16
//These kind of polls are just allowed when both teams are full. (PERM_ALLOW_POLLS must be set)
PERM_POLLS_ALLOWED_WHEN_TEAM_IS_FULL_ONLY = 32
/*A poll vote is only allowed at the beginning of a map until the saferoom door is openend or a timeout runs out (see: versus_force_start_time).
Remember that this timeout can be reached when slow loading players join the game and you have to wait. In a versus survival game it is allowed until the survival is started.
The advantange of this option is that the survivor team is not bothered with polls from the infected team when survivors should focus on the game.*/
PERM_POLLS_ARE_ALLOWED_AT_THE_BEGINNING_ONLY = 64
Admin Commands:
sm_aus_swapl: Swaps two players. Usage : "sm_aus_swapl 4 7" or "sm_aus_swapl "Player one" "Player Two"
sm_aus_switchpl: Switches a player to another team. Usage: "sm_aus_switchpl 7 2" or "sm_aus_switchpl 7 "Infected""
Clientids, player names and (better) userids are accepted.
Translations:
Avaiable in english and german.
Changelog:
01/09/2022 - Version 1.2.2
Compatibility with sourcemod version 1.11
Fixed an initialization problem when the plugin is activated via console while the map is already running (Didn't happen via lobby connect).
01/30/2021 - Version 1.2.1
Fixed 2 minor bugs and 2 little improvements.
Spoiler
01/25/2021 - Version 1.2
Offers a kind of reservation for disconnected players now. When a player disconnected or crashed with "no steam logon" etc. can get a "reservation" for n-minutes. (ConVar: l4d2_aus_storage_time / l4d2_aus_storage_filter) When one of these players come back to server, their would be set back to their previous team - if the team is not full in the meantime.
Added the convars l4d2_aus_newpl_execmdlist0 to 5 to the plugin to execute a set of commands when a new player joins the server. Note: 2 of the old convars were renamed! You have to rename these convars or just to delete the old config file (if nothing was changed).
Using the new(er) sourcemod syntax now.
Note: You have to update all files included. Even the translation files.
01/10/2021 - Version 1.1.1
A bunch of little improvements, especially the early / late loading sh*t.
01/04/2021 - Version 1.1
Added the 2 Admin commands sm_aus_swapl and sm_aus_switchpl to swap and switch players by console. Clientids, player names and (better) userids are accepted. Usage : sm_aus_swapl 4 7 or sm_aus_swapl "Player one" "Player Two" or sm_aus_switchpl 7 2 / sm_aus_switchpl 7 "Infected"
Added the Permission PERM_POLLS_ARE_ALLOWED_AT_THE_BEGINNING_ONLY #64 (One more translation is needed! So you have to update the translation files!)
Fixed a bug that the plugin is not active when a versus surival game is started (cough)
Removed an if-clause for admin immunity. That kind of immunity is now filtered automatically. An admin would not see other admins in the menu since an admin can change the team when their want and is able to switch themself by menu.
The player swap as a result of a vote is a little bit safer now.
01/01/2021 - Version 1.0
Additional Plugin:
The little DoorLock script holds the saferoom door locked until all players have been fully loaded. Could be a nightmare for a rusher, but is more fair. Works together with the Another Unscrambler plugin and it must be installed ofc. The plugin is offered in a separate file.
Version 1.0.1 using the newer syntax and doesn't produce an error when a plugin like Saferoom Door Spam Protection is installed anymore.
For some reason, this plugin no longer compiles with sourcemod 1.11, but with lower versions, however when pressing the letter (M) to change the team it no longer works
Please someone who can update and fix the team change of this plugin, I really like it a lot.
THESE ARE THE ERRORS WHEN COMPILING WITH SOURCEMOD 1.11
l4d2_AnotherUnscrambler.sp(71) : error 101: fixed dimensions be after the array name, not on the type
l4d2_AnotherUnscrambler.sp(876) : error 147: new-style declarations are required
Thank you very much @Merc1less, now it compiles perfectly.
Regarding the problem of changing the team with the letter (M), it seems that it only affects the chapter of any campaign that the server has chosen at the start, then it is solved by passing the other chapters. (I use a local server)