[WIP] New CVar mp_buy_anywhere (#381)

* [WIP] Add: new CVar mp_buy_anywhere - When set, players can buy anywhere, not only in buyzones. 0 = default. 1 = both, 2 = Terrorists, 3 = CT.
Closes #386
This commit is contained in:
Shorohov Sergey 2019-07-30 15:26:01 +03:00 committed by Dmitry Novikov
parent 75bdc26df1
commit c81d5d24bd
5 changed files with 37 additions and 2 deletions

View File

@ -61,6 +61,7 @@ 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_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?
* Extract all the files from an [archive](regamedll/extra/zBot/bot_profiles.zip?raw=true)

9
dist/game.cfg vendored
View File

@ -278,3 +278,12 @@ ff_damage_reduction_other "0.35"
// Default value: "0"
mp_afk_bomb_drop_time "0"
// When set, players can buy anywhere, not only in buyzones.
// 0 - disabled
// 1 - both teams
// 2 - only Terrorists team
// 3 - only CT team
//
// Default value: "0"
mp_buy_anywhere "0"

View File

@ -119,6 +119,7 @@ cvar_t legacy_bombtarget_touch = { "mp_legacy_bombtarget_touch", "1", 0, 1.0f, n
cvar_t respawn_immunitytime = { "mp_respawn_immunitytime", "0", FCVAR_SERVER, 0.0f, nullptr };
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 allow_point_servercommand = { "mp_allow_point_servercommand", "0", 0, 0.0f, nullptr };
cvar_t hullbounds_sets = { "mp_hullbounds_sets", "1", 0, 0.0f, nullptr };
@ -306,6 +307,7 @@ void EXT_FUNC GameDLLInit()
CVAR_REGISTER(&respawn_immunitytime);
CVAR_REGISTER(&kill_filled_spawn);
CVAR_REGISTER(&afk_bomb_drop_time);
CVAR_REGISTER(&buy_anywhere);
CVAR_REGISTER(&allow_point_servercommand);
CVAR_REGISTER(&hullbounds_sets);

View File

@ -156,6 +156,7 @@ extern cvar_t legacy_bombtarget_touch;
extern cvar_t respawn_immunitytime;
extern cvar_t kill_filled_spawn;
extern cvar_t afk_bomb_drop_time;
extern cvar_t buy_anywhere;
extern cvar_t allow_point_servercommand;
extern cvar_t hullbounds_sets;
extern cvar_t ff_damage_reduction_bullets;

View File

@ -6310,8 +6310,30 @@ void CBasePlayer::HandleSignals()
if (buytime.value != 0.0f)
#endif
{
if (!CSGameRules()->m_bMapHasBuyZone)
OLD_CheckBuyZone(this);
#ifdef REGAMEDLL_ADD
if (buy_anywhere.value)
{
if (pev->deadflag == DEAD_NO && (m_iTeam == TERRORIST || m_iTeam == CT)
&& !(m_signals.GetSignal() & SIGNAL_BUY)
// Restricted by map rules
&& CSGameRules()->CanPlayerBuy(this)
)
{
// 0 = default. 1 = both teams. 2 = Terrorists. 3 = Counter-Terrorists.
if (buy_anywhere.value == 1
|| (buy_anywhere.value == 2 && m_iTeam == TERRORIST)
|| (buy_anywhere.value == 3 && m_iTeam == CT)
)
{
m_signals.Signal(SIGNAL_BUY);
}
}
}
#endif
{
if (!CSGameRules()->m_bMapHasBuyZone)
OLD_CheckBuyZone(this);
}
}
if (!CSGameRules()->m_bMapHasBombZone)