diff --git a/README.md b/README.md
index 660ee691..072b2f58 100644
--- a/README.md
+++ b/README.md
@@ -61,6 +61,8 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure'
| ff_damage_reduction_grenade_self | 1.0 | 0.0 | 1.0 | How much to damage a player does to himself with his own grenade.
Range is from `0` - `1` (with 1 being damage equal to what is done to an enemy) |
| ff_damage_reduction_other | 0.35 | 0.0 | 1.0 | How much to reduce damage done to teammates by things other than bullets and grenades.
Range is from `0` - `1` (with 1 being damage equal to what is done to an enemy) |
| mp_afk_bomb_drop_time | 0 | 5.0 | - | Player that have never moved sience they last move will drop the bomb after this amount of time. (in seconds).
`0` disabled
`>5.0` delay to drop |
+| 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 |
## How to install zBot for CS 1.6?
diff --git a/dist/game.cfg b/dist/game.cfg
index fa6f194c..39dd2865 100644
--- a/dist/game.cfg
+++ b/dist/game.cfg
@@ -278,6 +278,18 @@ ff_damage_reduction_other "0.35"
// Default value: "0"
mp_afk_bomb_drop_time "0"
+// Delay between player Radio messages. (in seconds).
+// 0 - disable delay
+//
+// Default value: "1.5"
+mp_radio_timeout "1.5"
+
+// Maximum Radio messages count for player per round.
+// 0 - disable radio messages
+//
+// Default value: "60"
+mp_radio_maxinround "60"
+
// When set, players can buy anywhere, not only in buyzones.
// 0 - disabled
// 1 - both teams
@@ -287,3 +299,4 @@ mp_afk_bomb_drop_time "0"
// Default value: "0"
mp_buy_anywhere "0"
+
diff --git a/regamedll/dlls/client.cpp b/regamedll/dlls/client.cpp
index fd9fbc0f..f42d1656 100644
--- a/regamedll/dlls/client.cpp
+++ b/regamedll/dlls/client.cpp
@@ -2093,7 +2093,7 @@ void Radio1(CBasePlayer *pPlayer, int slot)
return;
pPlayer->m_iRadioMessages--;
- pPlayer->m_flRadioTime = gpGlobals->time + 1.5f;
+ pPlayer->m_flRadioTime = gpGlobals->time + CGameRules::GetRadioTimeout();
switch (slot)
{
@@ -2132,7 +2132,7 @@ void Radio2(CBasePlayer *pPlayer, int slot)
return;
pPlayer->m_iRadioMessages--;
- pPlayer->m_flRadioTime = gpGlobals->time + 1.5f;
+ pPlayer->m_flRadioTime = gpGlobals->time + CGameRules::GetRadioTimeout();
switch (slot)
{
@@ -2171,7 +2171,7 @@ void Radio3(CBasePlayer *pPlayer, int slot)
return;
pPlayer->m_iRadioMessages--;
- pPlayer->m_flRadioTime = gpGlobals->time + 1.5f;
+ pPlayer->m_flRadioTime = gpGlobals->time + CGameRules::GetRadioTimeout();
switch (slot)
{
diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp
index 225c96d8..8cb989a2 100644
--- a/regamedll/dlls/game.cpp
+++ b/regamedll/dlls/game.cpp
@@ -132,6 +132,9 @@ cvar_t ff_damage_reduction_grenade = { "ff_damage_reduction_grenade",
cvar_t ff_damage_reduction_grenade_self = { "ff_damage_reduction_grenade_self", "1", FCVAR_SERVER, 0.0f, nullptr };
cvar_t ff_damage_reduction_other = { "ff_damage_reduction_other", "0.25", FCVAR_SERVER, 0.0f, nullptr };
+cvar_t radio_timeout = { "mp_radio_timeout", "1.5", FCVAR_SERVER, 1.5f, nullptr };
+cvar_t radio_maxinround = { "mp_radio_maxinround", "60", FCVAR_SERVER, 60.0f, nullptr };
+
void GameDLL_Version_f()
{
if (Q_stricmp(CMD_ARGV(1), "version") != 0)
diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h
index 32cc69a4..137a5dce 100644
--- a/regamedll/dlls/game.h
+++ b/regamedll/dlls/game.h
@@ -163,6 +163,8 @@ extern cvar_t ff_damage_reduction_bullets;
extern cvar_t ff_damage_reduction_grenade;
extern cvar_t ff_damage_reduction_grenade_self;
extern cvar_t ff_damage_reduction_other;
+extern cvar_t radio_timeout;
+extern cvar_t radio_maxinround;
#endif
diff --git a/regamedll/dlls/gamerules.h b/regamedll/dlls/gamerules.h
index dfa45d96..aa3ee75b 100644
--- a/regamedll/dlls/gamerules.h
+++ b/regamedll/dlls/gamerules.h
@@ -39,12 +39,13 @@ const int MAX_MONEY_THRESHOLD = 999999; // allowable money limit in the game t
const int MAX_MOTD_CHUNK = 60;
const int MAX_MOTD_LENGTH = 1536; // (MAX_MOTD_CHUNK * 4)
-const float ITEM_RESPAWN_TIME = 30;
-const float WEAPON_RESPAWN_TIME = 20;
-const float AMMO_RESPAWN_TIME = 20;
-const float ROUND_RESPAWN_TIME = 20;
-const float ROUND_BEGIN_DELAY = 5; // delay before beginning new round
-const float ITEM_KILL_DELAY = 300;
+const float ITEM_RESPAWN_TIME = 30.0f;
+const float WEAPON_RESPAWN_TIME = 20.0f;
+const float AMMO_RESPAWN_TIME = 20.0f;
+const float ROUND_RESPAWN_TIME = 20.0f;
+const float ROUND_BEGIN_DELAY = 5.0f; // delay before beginning new round
+const float ITEM_KILL_DELAY = 300.0f;
+const float RADIO_TIMEOUT = 1.5f;
const int MAX_INTERMISSION_TIME = 120; // longest the intermission can last, in seconds
@@ -325,6 +326,7 @@ public:
inline bool IsGameOver() const { return m_bGameOver; }
inline void SetGameOver() { m_bGameOver = true; }
static float GetItemKillDelay();
+ static float GetRadioTimeout();
public:
BOOL m_bFreezePeriod; // TRUE at beginning of round, set to FALSE when the period expires
@@ -886,6 +888,15 @@ inline float CGameRules::GetItemKillDelay()
#endif
}
+inline float CGameRules::GetRadioTimeout()
+{
+#ifdef REGAMEDLL_ADD
+ return radio_timeout.value;
+#else
+ return RADIO_TIMEOUT;
+#endif
+}
+
bool IsBotSpeaking();
void SV_Continue_f();
void SV_Tutor_Toggle_f();
diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp
index 16d1ab34..1a55758d 100644
--- a/regamedll/dlls/player.cpp
+++ b/regamedll/dlls/player.cpp
@@ -5202,7 +5202,11 @@ void EXT_FUNC CBasePlayer::__API_HOOK(Spawn)()
m_flLastTalk = 0;
m_flIdleCheckTime = 0;
m_flRadioTime = 0;
+#ifdef REGAMEDLL_ADD
+ m_iRadioMessages = int(radio_maxinround.value);
+#else
m_iRadioMessages = 60;
+#endif
m_bHasC4 = false;
m_bKilledByBomb = false;
m_bKilledByGrenade = false;