Radio enchance cvars (#394)

* Added a new CVar's for Radio messages control.
 "mp_radio_timeout" - Delay between player Radio messages;
 "mp_radio_maxinround" - Maximum Radio messages count for player per round.
This commit is contained in:
Shorohov Sergey 2019-07-30 15:30:34 +03:00 committed by Dmitry Novikov
parent c81d5d24bd
commit b7c710626e
7 changed files with 44 additions and 9 deletions

View File

@ -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.<br/> 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.<br/> 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).<br/>`0` disabled<br/>`>5.0` delay to drop |
| 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 |
## How to install zBot for CS 1.6?

13
dist/game.cfg vendored
View File

@ -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"

View File

@ -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)
{

View File

@ -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)

View File

@ -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

View File

@ -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();

View File

@ -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;