mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-28 06:28:04 +03:00
Group defuser give code in one function (#871)
This commit is contained in:
parent
a9ec63df1b
commit
2f50f5ab9d
@ -1440,28 +1440,13 @@ void EXT_FUNC __API_HOOK(BuyItem)(CBasePlayer *pPlayer, int iSlot)
|
||||
if (pPlayer->m_iAccount >= DEFUSEKIT_PRICE)
|
||||
{
|
||||
bEnoughMoney = true;
|
||||
pPlayer->m_bHasDefuser = true;
|
||||
|
||||
MESSAGE_BEGIN(MSG_ONE, gmsgStatusIcon, nullptr, pPlayer->pev);
|
||||
WRITE_BYTE(STATUSICON_SHOW);
|
||||
WRITE_STRING("defuser");
|
||||
WRITE_BYTE(0);
|
||||
WRITE_BYTE(160);
|
||||
WRITE_BYTE(0);
|
||||
MESSAGE_END();
|
||||
|
||||
pPlayer->pev->body = 1;
|
||||
pPlayer->GiveDefuser();
|
||||
pPlayer->AddAccount(-DEFUSEKIT_PRICE, RT_PLAYER_BOUGHT_SOMETHING);
|
||||
|
||||
#ifdef REGAMEDLL_FIXES
|
||||
EMIT_SOUND(ENT(pPlayer->pev), CHAN_VOICE, "items/kevlar.wav", VOL_NORM, ATTN_NORM);
|
||||
#else
|
||||
EMIT_SOUND(ENT(pPlayer->pev), CHAN_ITEM, "items/kevlar.wav", VOL_NORM, ATTN_NORM);
|
||||
#endif
|
||||
pPlayer->SendItemStatus();
|
||||
|
||||
#ifdef BUILD_LATEST
|
||||
pPlayer->SetScoreboardAttributes();
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
@ -1479,7 +1464,6 @@ void EXT_FUNC __API_HOOK(BuyItem)(CBasePlayer *pPlayer, int iSlot)
|
||||
if (pPlayer->m_iAccount >= SHIELDGUN_PRICE)
|
||||
{
|
||||
bEnoughMoney = true;
|
||||
|
||||
pPlayer->DropPrimary();
|
||||
pPlayer->GiveShield();
|
||||
pPlayer->AddAccount(-SHIELDGUN_PRICE, RT_PLAYER_BOUGHT_SOMETHING);
|
||||
|
@ -481,22 +481,9 @@ BOOL CItemThighPack::MyTouch(CBasePlayer *pPlayer)
|
||||
return FALSE;
|
||||
#endif
|
||||
|
||||
pPlayer->m_bHasDefuser = true;
|
||||
pPlayer->pev->body = 1;
|
||||
|
||||
pPlayer->GiveDefuser();
|
||||
ClientPrint(pPlayer->pev, HUD_PRINTCENTER, "#Got_defuser");
|
||||
|
||||
MESSAGE_BEGIN(MSG_ONE, gmsgStatusIcon, nullptr, pPlayer->pev);
|
||||
WRITE_BYTE(STATUSICON_SHOW);
|
||||
WRITE_STRING("defuser");
|
||||
WRITE_BYTE(0);
|
||||
WRITE_BYTE(160);
|
||||
WRITE_BYTE(0);
|
||||
MESSAGE_END();
|
||||
|
||||
pPlayer->SendItemStatus();
|
||||
pPlayer->SetScoreboardAttributes();
|
||||
|
||||
EMIT_SOUND(pPlayer->edict(), CHAN_VOICE, "items/kevlar.wav", VOL_NORM, ATTN_NORM);
|
||||
|
||||
if (TheTutor)
|
||||
|
@ -10137,6 +10137,26 @@ void CBasePlayer::RemoveBomb()
|
||||
}
|
||||
}
|
||||
|
||||
void CBasePlayer::GiveDefuser()
|
||||
{
|
||||
m_bHasDefuser = true;
|
||||
pev->body = 1;
|
||||
|
||||
MESSAGE_BEGIN(MSG_ONE, gmsgStatusIcon, nullptr, pev);
|
||||
WRITE_BYTE(STATUSICON_SHOW);
|
||||
WRITE_STRING("defuser");
|
||||
WRITE_BYTE(0);
|
||||
WRITE_BYTE(160);
|
||||
WRITE_BYTE(0);
|
||||
MESSAGE_END();
|
||||
|
||||
SendItemStatus();
|
||||
|
||||
#if defined(REGAMEDLL_FIXES) || defined(BUILD_LATEST)
|
||||
SetScoreboardAttributes();
|
||||
#endif
|
||||
}
|
||||
|
||||
void CBasePlayer::RemoveDefuser()
|
||||
{
|
||||
m_bHasDefuser = false;
|
||||
|
@ -631,6 +631,7 @@ public:
|
||||
void DropPrimary();
|
||||
void OnSpawnEquip(bool addDefault = true, bool equipGame = true);
|
||||
void RemoveBomb();
|
||||
void GiveDefuser();
|
||||
void RemoveDefuser();
|
||||
void HideTimer();
|
||||
bool MakeBomber();
|
||||
|
Loading…
x
Reference in New Issue
Block a user