\r
// singleplayer campaign\r
set g_campaign 0\r
+set g_campaign_forceteam 0 "Forces the player to a given team in campaign mode, 1 = red, 2 = blue, 3 = yellow, 4 = pink"\r
set g_campaign_changelevel 0 "When disabled, levels won't be automatically change after a match was won or lost (you're taken back to the menu instead)"\r
seta g_campaign_name "voretournament"\r
set g_campaign_skill 0\r
// find out what teams are available\r
CheckAllowedTeams(pl);\r
\r
+ // if we want the player in a certain team for campaign, force him there\r
+ if(cvar("g_campaign"))\r
+ if(clienttype(pl) == CLIENTTYPE_REAL) // only players, not bots\r
+ {\r
+ switch(cvar("g_campaign_forceteam"))\r
+ {\r
+ case 1:\r
+ SetPlayerColors(pl, COLOR_TEAM1 - 1);\r
+ return COLOR_TEAM1;\r
+ case 2:\r
+ SetPlayerColors(pl, COLOR_TEAM2 - 1);\r
+ return COLOR_TEAM2;\r
+ case 3:\r
+ SetPlayerColors(pl, COLOR_TEAM3 - 1);\r
+ return COLOR_TEAM3;\r
+ case 4:\r
+ SetPlayerColors(pl, COLOR_TEAM4 - 1);\r
+ return COLOR_TEAM4;\r
+ default:\r
+ break;\r
+ }\r
+ }\r
+\r
// if we don't care what team he ends up on, put him on whatever team he entered as.\r
// if he's not on a valid team, then let other code put him on the smallest team\r
if(!forcebestteam)\r