Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cfg/cs2fixes/cs2fixes.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ zr_infect_shake 1 // Whether to shake a player's view on infect
zr_infect_shake_amp 15.0 // Amplitude of shaking effect
zr_infect_shake_frequency 2.0 // Frequency of shaking effect
zr_infect_shake_duration 5.0 // Duration of shaking effect
zr_damagecash_enable 1 // Enable cash damage on zombie or not

// Leader settings
cs2f_leader_enable 0 // Whether to enable Leader features
Expand Down
8 changes: 8 additions & 0 deletions src/zombiereborn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ CConVar<bool> g_cvarInfectShake("zr_infect_shake", FCVAR_NONE, "Whether to shake
CConVar<float> g_cvarInfectShakeAmplitude("zr_infect_shake_amp", FCVAR_NONE, "Amplitude of shaking effect", 15.0f, true, 0.0f, true, 16.0f);
CConVar<float> g_cvarInfectShakeFrequency("zr_infect_shake_frequency", FCVAR_NONE, "Frequency of shaking effect", 2.0f, true, 0.0f, false, 0.0f);
CConVar<float> g_cvarInfectShakeDuration("zr_infect_shake_duration", FCVAR_NONE, "Duration of shaking effect", 5.0f, true, 0.0f, false, 0.0f);
CConVar<bool> g_cvarEnableDamageCash("zr_damagecash_enable", FCVAR_NONE, "Enable cash damage on zombie or not", false);

// meant only for offline config validation and can easily cause issues when used on live server
#ifdef _DEBUG
Expand Down Expand Up @@ -1635,6 +1636,13 @@ void ZR_OnPlayerTakeDamage(CCSPlayerPawn* pVictimPawn, const CTakeDamageInfo* pI
{
auto flClassKnockback = 1.0f;

if(g_cvarEnableDamageCash.Get())
{
const auto pKillerController = pKillerPawn->GetOriginalController();
int money = pKillerController->m_pInGameMoneyServices->m_iAccount;
pKillerController->m_pInGameMoneyServices->m_iAccount = money + damage;
}

if (pVictimController->GetZEPlayer())
{
std::shared_ptr<ZRClass> activeClass = pVictimController->GetZEPlayer()->GetActiveZRClass();
Expand Down