mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-13 23:28:04 +03:00
Add an argument to swapteams
command (#739)
* Added an argument to `swapteams` command * Updated `README.md` `swapteams` description * Fixed check arguments count * better arg usage * better notations for readme * better desc Co-authored-by: Sergey Shorokhov <sergeyshorokhov@csgo.com>
This commit is contained in:
parent
e83eeaed39
commit
98b387bb68
@ -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:<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. |
|
||||
| swapteams | Swap the teams and restart the game. |
|
||||
| swapteams | Swap the teams and restart the game (1 sec delay to restart by default).<br/> Args: <br/>`0` - swap teams without restart. <br/> `>0.001` - time delay in seconds to restart the round after swap. |
|
||||
| give | Give weapon command.<br/> Args:<br/><weapon_name><br/>Usage:<br/>`give weapon_ak47`<br/>`give weapon_usp`<br/><br/>NOTE: `sv_cheats 1` required. |
|
||||
| impulse 255 | Give all weapons.<br/><br/>NOTE: `sv_cheats 1` required. |
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user