diff --git a/README.md b/README.md index ab98f3aa..20557455 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab | :---------------------------------- | :---------------------------------------------- | | game version | Will show GameDLL build version, date & URL. | | endround | Args:
`T` force round end with Terrorists win.
`CT` force round end with Counter-Terrorists win.
or terminate round draw when called without arguments. | -| swapteams | Swap the teams and restart the game. | +| swapteams | Swap the teams and restart the game (1 sec delay to restart by default).
Args:
`0` - swap teams without restart.
`>0.001` - time delay in seconds to restart the round after swap. | | give | Give weapon command.
Args:

Usage:
`give weapon_ak47`
`give weapon_usp`

NOTE: `sv_cheats 1` required. | | impulse 255 | Give all weapons.

NOTE: `sv_cheats 1` required. | diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index 14dc2d11..20d4fdc9 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -198,7 +198,17 @@ void GameDLL_EndRound_f() void GameDLL_SwapTeams_f() { CSGameRules()->SwapAllPlayers(); - CVAR_SET_FLOAT("sv_restartround", 1.0); + + float value = 1.0f; + if(CMD_ARGC() >= 2) + { + value = Q_atof(CMD_ARGV(1)); + } + + if (value > 0.0f) + { + CVAR_SET_FLOAT("sv_restartround", value); + } } #endif // REGAMEDLL_ADD