Add new console command: mp_swapteams - Swap the teams and restart the game. (#430)

This commit is contained in:
Shorohov Sergey 2019-10-27 17:13:46 +03:00 committed by Dmitry Novikov
parent a9ba748eef
commit 35277804bf
2 changed files with 14 additions and 0 deletions

View File

@ -22,6 +22,13 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure'
<pre>ReGameDLL_CS also have beta version with latest changes from official version of Counter-Strike.</pre>
* Enter `-beta` option at the command line HLDS.
## Commands
| Command | Description |
| :---------------------------------- | :---------------------------------------------- |
| game version | Will show GameDLL build version, date & URL. |
| endround | Args:<br/>`T` force round end with Terrorists win. <br/>`CT` force round end with Counter-Terrorists win. <br/> or terminate round draw when called without arguments. |
| mp_swapteams | Swap the teams and restart the game. |
## Configuration (cvars)
<details>
<summary>Click to expand</summary>

View File

@ -172,6 +172,12 @@ void GameDLL_EndRound_f()
CSGameRules()->OnRoundEnd_Intercept(WINSTATUS_DRAW, ROUND_END_DRAW, CSGameRules()->GetRoundRestartDelay());
}
void GameDLL_SwapTeams_f()
{
CSGameRules()->SwapAllPlayers();
CVAR_SET_FLOAT("sv_restartround", 1.0);
}
#endif // REGAMEDLL_ADD
void EXT_FUNC GameDLLInit()
@ -298,6 +304,7 @@ void EXT_FUNC GameDLLInit()
ADD_SERVER_COMMAND("game", GameDLL_Version_f);
ADD_SERVER_COMMAND("endround", GameDLL_EndRound_f);
ADD_SERVER_COMMAND("mp_swapteams", GameDLL_SwapTeams_f);
CVAR_REGISTER(&game_version);
CVAR_REGISTER(&maxmoney);