From 75867a48ed279cb6c20f8f33cd05558188286ef4 Mon Sep 17 00:00:00 2001 From: JulioBarker <42683036+JulioBarker@users.noreply.github.com> Date: Wed, 12 Oct 2022 13:12:37 -0400 Subject: [PATCH 1/8] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7e289f8d8..0220c1c51 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab | sv_enablebunnyhopping | 0 | 0 | 1 | Allow player speed to exceed maximum running speed.
`0` disabled
`1` enabled | | mp_plant_c4_anywhere | 0 | 0 | 1 | When set, players can plant anywhere, not only in bombsites.
`0` disabled
`1` enabled | | mp_give_c4_frags | 3 | - | - | How many bonuses (frags) will get the player who defused or exploded the bomb. | +| mp_drop_grenade_enable | 0 | 0 | 1 | Allow players to drop grenades from their inventory.
`0` disabled
`1` enabled | ## How to install zBot for CS 1.6? From 6c84116fc8a5677cdc4fea102d1542cd8c13fb49 Mon Sep 17 00:00:00 2001 From: JulioBarker <42683036+JulioBarker@users.noreply.github.com> Date: Wed, 12 Oct 2022 13:14:13 -0400 Subject: [PATCH 2/8] Update game.cfg --- dist/game.cfg | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dist/game.cfg b/dist/game.cfg index eb6f511ff..919f0db60 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -489,3 +489,10 @@ mp_plant_c4_anywhere 0 // // Default value: "3" mp_give_c4_frags 3 + +// Allow players to drop grenades from their inventory +// 0 - disabled (default behaviour) +// 1 - enabled +// +// Default value: "0" +mp_drop_grenade_enable 0 From bbdecca0c952c0b006bec33401444847a5ec6e86 Mon Sep 17 00:00:00 2001 From: JulioBarker <42683036+JulioBarker@users.noreply.github.com> Date: Wed, 12 Oct 2022 13:15:47 -0400 Subject: [PATCH 3/8] Update game.cpp --- regamedll/dlls/game.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index 192e254e0..0aa9efed2 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -163,6 +163,7 @@ cvar_t sv_autobunnyhopping = { "sv_autobunnyhopping", "0", 0, 0.0f cvar_t sv_enablebunnyhopping = { "sv_enablebunnyhopping", "0", 0, 0.0f, nullptr }; cvar_t plant_c4_anywhere = { "mp_plant_c4_anywhere", "0", 0, 0.0f, nullptr }; cvar_t give_c4_frags = { "mp_give_c4_frags", "3", 0, 3.0f, nullptr }; +cvar_t drop_grenade_enable = { "mp_drop_grenade_enable", "0", 0, 0.0f, nullptr }; void GameDLL_Version_f() { @@ -405,6 +406,7 @@ void EXT_FUNC GameDLLInit() CVAR_REGISTER(&sv_enablebunnyhopping); CVAR_REGISTER(&plant_c4_anywhere); CVAR_REGISTER(&give_c4_frags); + CVAR_REGISTER(&drop_grenade_enable); // print version CONSOLE_ECHO("ReGameDLL version: " APP_VERSION "\n"); From 71e60c8da55b09b29e5ff022df93f49e7923631a Mon Sep 17 00:00:00 2001 From: JulioBarker <42683036+JulioBarker@users.noreply.github.com> Date: Wed, 12 Oct 2022 13:16:31 -0400 Subject: [PATCH 4/8] Update game.h --- regamedll/dlls/game.h | 1 + 1 file changed, 1 insertion(+) diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h index 191211e0f..a69c23733 100644 --- a/regamedll/dlls/game.h +++ b/regamedll/dlls/game.h @@ -189,6 +189,7 @@ extern cvar_t sv_autobunnyhopping; extern cvar_t sv_enablebunnyhopping; extern cvar_t plant_c4_anywhere; extern cvar_t give_c4_frags; +extern cvar_t drop_grenade_enable; #endif From dd774f322cfdcf47bf4af394f37e8c189f47d479 Mon Sep 17 00:00:00 2001 From: JulioBarker <42683036+JulioBarker@users.noreply.github.com> Date: Wed, 12 Oct 2022 13:19:04 -0400 Subject: [PATCH 5/8] Update weapons.h --- regamedll/dlls/weapons.h | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/regamedll/dlls/weapons.h b/regamedll/dlls/weapons.h index bd22989e3..fdca09b53 100644 --- a/regamedll/dlls/weapons.h +++ b/regamedll/dlls/weapons.h @@ -951,7 +951,14 @@ class CFlashbang: public CBasePlayerWeapon virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); virtual BOOL CanDeploy(); - virtual BOOL CanDrop() { return FALSE; } + virtual BOOL CanDrop() + { + #ifdef REGAMEDLL_ADD + return TRUE; + #else + return FALSE; + #endif + } virtual BOOL Deploy(); virtual void Holster(int skiplocal); virtual float GetMaxSpeed() { return m_fMaxSpeed; } @@ -1120,7 +1127,14 @@ class CHEGrenade: public CBasePlayerWeapon virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); virtual BOOL CanDeploy(); - virtual BOOL CanDrop() { return FALSE; } + virtual BOOL CanDrop() + { + #ifdef REGAMEDLL_ADD + return TRUE; + #else + return FALSE; + #endif + } virtual BOOL Deploy(); virtual void Holster(int skiplocal); virtual float GetMaxSpeed() { return m_fMaxSpeed; } @@ -1632,7 +1646,14 @@ class CSmokeGrenade: public CBasePlayerWeapon virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); virtual BOOL CanDeploy(); - virtual BOOL CanDrop() { return FALSE; } + virtual BOOL CanDrop() + { + #ifdef REGAMEDLL_ADD + return TRUE; + #else + return FALSE; + #endif + } virtual BOOL Deploy(); virtual void Holster(int skiplocal); virtual float GetMaxSpeed() { return m_fMaxSpeed; } From 116e2a7ad6fa070080e8c059e86b353193a22b3b Mon Sep 17 00:00:00 2001 From: JulioBarker <42683036+JulioBarker@users.noreply.github.com> Date: Wed, 12 Oct 2022 13:20:44 -0400 Subject: [PATCH 6/8] Update player.cpp --- regamedll/dlls/player.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 3b51675bc..bd77b70de 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -7928,7 +7928,11 @@ CBaseEntity *EXT_FUNC CBasePlayer::__API_HOOK(DropPlayerItem)(const char *pszIte #endif if (pWeapon) { - if (!pWeapon->CanDrop()) + if (!pWeapon->CanDrop() +#ifdef REGAMEDLL_ADD + || (!drop_grenade_enable.value && IsGrenadeWeapon(pWeapon->m_iId)) +#endif + ) { ClientPrint(pev, HUD_PRINTCENTER, "#Weapon_Cannot_Be_Dropped"); return nullptr; From 58fae2c2b09c916a823c8ef5b3f1361aa32fb6f7 Mon Sep 17 00:00:00 2001 From: JulioBarker <42683036+JulioBarker@users.noreply.github.com> Date: Wed, 12 Oct 2022 13:41:42 -0400 Subject: [PATCH 7/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0220c1c51..90cc041a1 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab | sv_enablebunnyhopping | 0 | 0 | 1 | Allow player speed to exceed maximum running speed.
`0` disabled
`1` enabled | | mp_plant_c4_anywhere | 0 | 0 | 1 | When set, players can plant anywhere, not only in bombsites.
`0` disabled
`1` enabled | | mp_give_c4_frags | 3 | - | - | How many bonuses (frags) will get the player who defused or exploded the bomb. | -| mp_drop_grenade_enable | 0 | 0 | 1 | Allow players to drop grenades from their inventory.
`0` disabled
`1` enabled | +| mp_drop_grenade_enable | 0 | 0 | 1 | Allow players to drop grenades from their inventory.
`0` disabled
`1` enabled | ## How to install zBot for CS 1.6? From 42a6dd8f56b3c081c05a17f9e3c1fa62140a1a0f Mon Sep 17 00:00:00 2001 From: JulioBarker <42683036+JulioBarker@users.noreply.github.com> Date: Mon, 28 Nov 2022 00:47:56 -0400 Subject: [PATCH 8/8] Update player.cpp --- regamedll/dlls/player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index e41e3fe75..5999fc0ed 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -7930,7 +7930,7 @@ CBaseEntity *EXT_FUNC CBasePlayer::__API_HOOK(DropPlayerItem)(const char *pszIte { if (!pWeapon->CanDrop() #ifdef REGAMEDLL_ADD - || (!drop_grenade_enable.value && IsGrenadeWeapon(pWeapon->m_iId)) + || (!drop_grenade_enable.value && IsGrenadeWeapon(pWeapon->m_iId)) || (IsGrenadeWeapon(pWeapon->m_iId) && m_rgAmmo[pWeapon->PrimaryAmmoIndex()] <= 0) #endif ) {