CashManager: damn nemesis

This commit is contained in:
dogan 2020-07-31 16:26:54 +02:00
parent c059a49ec7
commit 168235ae03

View File

@ -232,7 +232,15 @@ public Action EventHook_PlayerDeath(Event hEvent, const char[] sEventName, bool
g_iCash[client] = GetEntProp(client, Prop_Send, "m_iAccount");
if (!IsValidClient(attacker) || !ZR_IsClientHuman(attacker))
char sWeapon[16];
hEvent.GetString("weapon", sWeapon, sizeof(sWeapon));
if(!IsValidClient(attacker))
return Plugin_Continue;
if(ZR_IsClientZombie(attacker) && StrEqual(sWeapon, "knife", true) && !(GetEntProp(attacker, Prop_Send, "m_iAccount") >= g_cvarMaxCash.IntValue)) //nemesis kill
SetEntProp(attacker, Prop_Send, "m_iAccount", GetEntProp(attacker, Prop_Send, "m_iAccount") + g_cvarInfectionGain.IntValue);
else if(ZR_IsClientZombie(attacker)) // regular infection
return Plugin_Continue;
int iPacked = (attacker<<16) | (GetEntProp(attacker, Prop_Send, "m_iAccount")&0xFFFF);