CashManager: small fix

This commit is contained in:
dogan 2020-08-28 13:12:53 +02:00
parent 6ad1e603c0
commit 8ab0e6776c

View File

@ -318,6 +318,9 @@ public Action EventHook_PlayerDeath(Event hEvent, const char[] sEventName, bool
int client = GetClientOfUserId(hEvent.GetInt("userid"));
int attacker = GetClientOfUserId(hEvent.GetInt("attacker"));
if(!IsValidClient(attacker))
return Plugin_Continue;
if(!g_cvarCashRoundReset.BoolValue)
{
g_iCash[client] = GetEntProp(client, Prop_Send, "m_iAccount");
@ -325,9 +328,6 @@ public Action EventHook_PlayerDeath(Event hEvent, const char[] sEventName, bool
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);