diff --git a/README.md b/README.md index 1665ce3d..660ee691 100644 --- a/README.md +++ b/README.md @@ -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.
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_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? * Extract all the files from an [archive](regamedll/extra/zBot/bot_profiles.zip?raw=true) diff --git a/dist/game.cfg b/dist/game.cfg index 5d7de8d5..fa6f194c 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -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" + diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index 07e638d7..225c96d8 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -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); diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h index 2ac62a2c..32cc69a4 100644 --- a/regamedll/dlls/game.h +++ b/regamedll/dlls/game.h @@ -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; diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index c691173f..16d1ab34 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -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)