New CVar: mp_give_c4_frags (#776)

Co-authored-by: Sergey Shorokhov <wopox1337@ya.ru>
This commit is contained in:
666JuL 2022-10-08 13:32:30 -04:00 committed by GitHub
parent 98b387bb68
commit 83151aaf0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 2 deletions

View File

@ -104,6 +104,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab
| sv_autobunnyhopping | 0 | 0 | 1 | Players automatically re-jump while holding jump button.<br/>`0` disabled <br/>`1` enabled |
| sv_enablebunnyhopping | 0 | 0 | 1 | Allow player speed to exceed maximum running speed.<br/>`0` disabled <br/>`1` enabled |
| mp_plant_c4_anywhere | 0 | 0 | 1 | When set, players can plant anywhere, not only in bombsites.<br/>`0` disabled <br/>`1` enabled |
| mp_give_c4_frags | 3 | - | - | How many bonuses (frags) will get the player who defused or exploded the bomb. |
</details>
## How to install zBot for CS 1.6?

6
dist/game.cfg vendored
View File

@ -483,3 +483,9 @@ sv_enablebunnyhopping 0
//
// Default value: "0"
mp_plant_c4_anywhere 0
// How many bonuses (frags) will get the player who defused or exploded the bomb.
// 3 - (default behaviour)
//
// Default value: "3"
mp_give_c4_frags 3

View File

@ -162,6 +162,7 @@ cvar_t allchat = { "sv_allchat", "0", 0, 0.0f, nullptr
cvar_t sv_autobunnyhopping = { "sv_autobunnyhopping", "0", 0, 0.0f, nullptr };
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 };
void GameDLL_Version_f()
{
@ -403,6 +404,7 @@ void EXT_FUNC GameDLLInit()
CVAR_REGISTER(&sv_autobunnyhopping);
CVAR_REGISTER(&sv_enablebunnyhopping);
CVAR_REGISTER(&plant_c4_anywhere);
CVAR_REGISTER(&give_c4_frags);
// print version
CONSOLE_ECHO("ReGameDLL version: " APP_VERSION "\n");

View File

@ -188,6 +188,7 @@ extern cvar_t allchat;
extern cvar_t sv_autobunnyhopping;
extern cvar_t sv_enablebunnyhopping;
extern cvar_t plant_c4_anywhere;
extern cvar_t give_c4_frags;
#endif

View File

@ -1084,8 +1084,12 @@ void CGrenade::__API_HOOK(DefuseBombEnd)(CBasePlayer *pPlayer, bool bDefused)
CSGameRules()->m_bBombDefused = true;
CSGameRules()->CheckWinConditions();
// give the defuser credit for defusing the bomb
m_pBombDefuser->pev->frags += 3.0f;
#ifdef REGAMEDLL_ADD
m_pBombDefuser->pev->frags += (int)give_c4_frags.value;
#else
// give the defuser credit for defusing the bomb
m_pBombDefuser->pev->frags += 3.0f;
#endif
MESSAGE_BEGIN(MSG_ALL, gmsgBombPickup);
MESSAGE_END();
@ -1435,7 +1439,11 @@ void CGrenade::C4Think()
CBasePlayer *pBombOwner = CBasePlayer::Instance(pev->owner);
if (pBombOwner)
{
#ifdef REGAMEDLL_ADD
pBombOwner->pev->frags += give_c4_frags.value;
#else
pBombOwner->pev->frags += 3.0f;
#endif
}
MESSAGE_BEGIN(MSG_ALL, gmsgBombPickup);