From c26c9255e1490a3241a55f0e49acf103ea0a00f1 Mon Sep 17 00:00:00 2001 From: jenz Date: Thu, 22 Feb 2024 20:21:25 +0100 Subject: [PATCH] added that zombies HP is displayed --- ZombieRiot/scripting/unloze_zr.sp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ZombieRiot/scripting/unloze_zr.sp b/ZombieRiot/scripting/unloze_zr.sp index 983031d2..2bd987d9 100644 --- a/ZombieRiot/scripting/unloze_zr.sp +++ b/ZombieRiot/scripting/unloze_zr.sp @@ -60,6 +60,8 @@ int g_iSoundIndexes; int g_iWeaponIndex; int g_iBotStuckCounts; int g_iLoadClassesIndex; +int g_iHumanCount; +int g_iZombieCount; float g_fKnockBackIndex[g_dIndexes + 1]; float g_fJumpHeightIndex[g_dIndexes + 1]; @@ -1085,6 +1087,8 @@ public void OnClientDisconnect(int client) //---------------------------------------------------------------------------------------------------- public void Event_roundStart(Handle event, const char[] name, bool dontBroadcast) { + g_iHumanCount = 999; + g_iZombieCount = 999; g_bRoundInProgress = false; g_bSwitchingIndex = true; CreateTimer(g_fSwitchingTimer, Timer_switchingModel, INVALID_HANDLE); @@ -1848,6 +1852,8 @@ public Action UpdateWaveCount(int client) } g_iZMCount--; PrintHintTextToAll("Day %i: %s\nRemaining Zombies: %i\nHumans: %i\nZombies: %i", g_iWave, g_cDaysTitles[g_iWave - 1], g_iZMCount, humanCount, zombieCount); + g_iHumanCount = humanCount; + g_iZombieCount = zombieCount; } if (g_iZMCount == 0 && g_bRoundInProgress) { @@ -1898,6 +1904,19 @@ public Action OnTakeDamage(int client, int &attacker, int &inflictor, float &dam return Plugin_Handled; else if (damagetype & DMG_FALL && g_bFallDamage[client]) return Plugin_Handled; + if (IsValidClient(attacker) && !IsFakeClient(attacker)) + { + if (g_iHumanCount != 999) //very lazy fix so its not looking stupid at round start when no zombie died yet. + { + PrintHintText(attacker, "Zombie HP: %i\nDay %i: %s\nRemaining Zombies: %i\nHumans: %i\nZombies: %i", + GetClientHealth(client) , g_iWave, g_cDaysTitles[g_iWave - 1], g_iZMCount, g_iHumanCount, g_iZombieCount); + } + else + { + PrintHintText(attacker, "Zombie HP: %i\nDay %i: %s\nRemaining Zombies: %i", + GetClientHealth(client) , g_iWave, g_cDaysTitles[g_iWave - 1], g_iZMCount); + } + } if (IsValidClient(attacker) && g_fDamageMultiplier[attacker] != 1.0) //damage multiplier { //value lower than 1.0 will reduce the actual damage.