diff --git a/README.md b/README.md index e482d7e0..e45f8aea 100644 --- a/README.md +++ b/README.md @@ -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).
`0` disable delay | | mp_radio_maxinround | 60 | - | - | Maximum Radio messages count for player per round.
`0` disable radio messages | | mp_buy_anywhere | 0 | 0 | 3 | When set, players can buy anywhere, not only in buyzones.
`0` disabled.
`1` both teams
`2` only Terrorists team
`3` only CT team | +| mp_give_player_c4 | 1 | 0 | 1 | Whether this map should spawn a C4 bomb for a player or not.
`0` disabled
`1` enabled | | mp_weapons_allow_map_placed | 1 | 0 | 1 | When set, map weapons (located on the floor by map) will be shown.
`0` hide all map weapons.
`1` enabled
`NOTE`: Effect will work after round restart. | diff --git a/dist/game.cfg b/dist/game.cfg index b096befb..473cff62 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -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 diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index 1a3a1865..16d3615c 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -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); diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h index 29341726..9eab6281 100644 --- a/regamedll/dlls/game.h +++ b/regamedll/dlls/game.h @@ -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; diff --git a/regamedll/dlls/multiplay_gamerules.cpp b/regamedll/dlls/multiplay_gamerules.cpp index 2c96fba4..6a714041 100644 --- a/regamedll/dlls/multiplay_gamerules.cpp +++ b/regamedll/dlls/multiplay_gamerules.cpp @@ -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(); } diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 32ab60f4..25f822ff 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -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(); }