New CVar mp_give_player_c4 (#428)

* Add new CVar: mp_give_player_c4. - Whether this map should spawn a C4 bomb for a player or not.
This commit is contained in:
Shorohov Sergey 2019-12-17 01:13:33 +03:00 committed by Dmitry Novikov
parent 27b2a8c8c9
commit ded6b32e85
6 changed files with 21 additions and 2 deletions

View File

@ -83,6 +83,7 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure'
| mp_radio_timeout | 1.5 | 0.0 | - | Delay between player Radio messages. (in seconds).<br/>`0` disable delay |
| mp_radio_maxinround | 60 | - | - | Maximum Radio messages count for player per round.<br/>`0` disable radio messages |
| mp_buy_anywhere | 0 | 0 | 3 | When set, players can buy anywhere, not only in buyzones.<br/> `0` disabled.<br/>`1` both teams <br/>`2` only Terrorists team <br/>`3` only CT team |
| mp_give_player_c4 | 1 | 0 | 1 | Whether this map should spawn a C4 bomb for a player or not.<br/> `0` disabled<br/>`1` enabled |
| mp_weapons_allow_map_placed | 1 | 0 | 1 | When set, map weapons (located on the floor by map) will be shown.<br/> `0` hide all map weapons.<br/>`1` enabled<br/>`NOTE`: Effect will work after round restart. |
</details>

7
dist/game.cfg vendored
View File

@ -337,6 +337,13 @@ mp_buy_anywhere 0
// Default value: "0"
mp_unduck_method 0
// Whether this map should spawn a C4 bomb for a player or not.
// 0 - disabled
// 1 - enabled (default behaviour)
//
// Default value: "1"
mp_give_player_c4 1
// When set, map weapons (located on the floor) will be shown.
// NOTE: Effect will work after round restart.
// 0 - hide all map weapons

View File

@ -124,6 +124,7 @@ cvar_t respawn_immunity_effects = { "mp_respawn_immunity_effects", "1", FCVAR_S
cvar_t kill_filled_spawn = { "mp_kill_filled_spawn", "1", 0, 0.0f, nullptr };
cvar_t afk_bomb_drop_time = { "mp_afk_bomb_drop_time", "0", FCVAR_SERVER, 0.0f, nullptr };
cvar_t buy_anywhere = { "mp_buy_anywhere", "0", FCVAR_SERVER, 0.0f, nullptr };
cvar_t give_player_c4 = { "mp_give_player_c4", "1", FCVAR_SERVER, 0.0f, nullptr };
cvar_t weapons_allow_map_placed = { "mp_weapons_allow_map_placed", "1", FCVAR_SERVER, 0.0f, nullptr };
cvar_t allow_point_servercommand = { "mp_allow_point_servercommand", "0", 0, 0.0f, nullptr };
@ -340,6 +341,7 @@ void EXT_FUNC GameDLLInit()
CVAR_REGISTER(&kill_filled_spawn);
CVAR_REGISTER(&afk_bomb_drop_time);
CVAR_REGISTER(&buy_anywhere);
CVAR_REGISTER(&give_player_c4);
CVAR_REGISTER(&allow_point_servercommand);
CVAR_REGISTER(&hullbounds_sets);
CVAR_REGISTER(&unduck_method);

View File

@ -161,6 +161,7 @@ extern cvar_t respawn_immunity_effects;
extern cvar_t kill_filled_spawn;
extern cvar_t afk_bomb_drop_time;
extern cvar_t buy_anywhere;
extern cvar_t give_player_c4;
extern cvar_t weapons_allow_map_placed;
extern cvar_t allow_point_servercommand;
extern cvar_t hullbounds_sets;

View File

@ -2027,7 +2027,11 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(RestartRound)()
#endif
// Give C4 to the terrorists
if (m_bMapHasBombTarget)
if (m_bMapHasBombTarget
#ifdef REGAMEDLL_ADD
&& give_player_c4.value
#endif
)
{
GiveC4();
}

View File

@ -9781,7 +9781,11 @@ bool EXT_FUNC CBasePlayer::__API_HOOK(GetIntoGame)()
Spawn();
CSGameRules()->CheckWinConditions();
if (!CSGameRules()->m_flRestartRoundTime && CSGameRules()->m_bMapHasBombTarget && !CSGameRules()->IsThereABomber() && !CSGameRules()->IsThereABomb())
if (!CSGameRules()->m_flRestartRoundTime && CSGameRules()->m_bMapHasBombTarget && !CSGameRules()->IsThereABomber() && !CSGameRules()->IsThereABomb()
#ifdef REGAMEDLL_ADD
&& give_player_c4.value
#endif
)
{
CSGameRules()->GiveC4();
}