CashManager: add small print for defending

This commit is contained in:
dogan 2020-08-28 13:41:13 +02:00
parent c1cf184d31
commit 0962192064

View File

@ -38,6 +38,7 @@ bool g_bAwardZombies;
bool g_bMotherZombie[MAXPLAYERS + 1];
int g_iCash[MAXPLAYERS + 1];
int g_iDamageCash[MAXPLAYERS + 1];
int g_iCashReconnect[256];
int g_iSteamID[256];
@ -148,6 +149,8 @@ public Action MessageReconnect(Handle timer, int client)
public void OnClientDisconnect(int client)
{
g_iDamageCash[client] = 0;
if(IsFakeClient(client) || !IsClientInGame(client) || g_cvarCashRoundReset.BoolValue)
return;
@ -271,7 +274,10 @@ public Action EventHook_RoundEnd(Event hEvent, const char[] sEventName, bool bDo
public Action EventHook_RoundStart(Event hEvent, const char[] sEventName, bool bDontBroadcast)
{
for(int i = 1; i <= MaxClients; i++)
{
g_bMotherZombie[i] = false;
g_iDamageCash[i] = 0;
}
for(int i = 0; i < 2048; i++)
g_bDisabled[i] = false;
@ -306,6 +312,13 @@ public Action EventHook_PlayerHurt(Event hEvent, const char[] sEventName, bool b
float fDamage = float(hEvent.GetInt("dmg_health"));
SetEntProp(iAttacker, Prop_Send, "m_iAccount", GetEntProp(iAttacker, Prop_Send, "m_iAccount") + RoundToNearest(fDamage > 0.0 ? fDamage * g_cvarDamageMultiplier.FloatValue : 1.0));
g_iDamageCash[iAttacker] = g_iDamageCash[iAttacker] + RoundToNearest(fDamage > 0.0 ? fDamage * g_cvarDamageMultiplier.FloatValue : 1.0);
if(g_iDamageCash[iAttacker] >= 1000)
{
g_iDamageCash[iAttacker] = 0;
CPrintToChat(iAttacker, "{cyan}[UNLOZE CashManager] {white}You gained {yellow}$1000{white} for damaging the Zombies.");
}
#else
SetEntProp(iAttacker, Prop_Send, "m_iAccount", GetEntProp(iAttacker, Prop_Send, "m_iAccount") + CASHPERHIT);
#endif