added that zombies HP is displayed

This commit is contained in:
jenz 2024-02-22 20:21:25 +01:00
parent 155c8198a4
commit c26c9255e1

View File

@ -60,6 +60,8 @@ int g_iSoundIndexes;
int g_iWeaponIndex; int g_iWeaponIndex;
int g_iBotStuckCounts; int g_iBotStuckCounts;
int g_iLoadClassesIndex; int g_iLoadClassesIndex;
int g_iHumanCount;
int g_iZombieCount;
float g_fKnockBackIndex[g_dIndexes + 1]; float g_fKnockBackIndex[g_dIndexes + 1];
float g_fJumpHeightIndex[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) public void Event_roundStart(Handle event, const char[] name, bool dontBroadcast)
{ {
g_iHumanCount = 999;
g_iZombieCount = 999;
g_bRoundInProgress = false; g_bRoundInProgress = false;
g_bSwitchingIndex = true; g_bSwitchingIndex = true;
CreateTimer(g_fSwitchingTimer, Timer_switchingModel, INVALID_HANDLE); CreateTimer(g_fSwitchingTimer, Timer_switchingModel, INVALID_HANDLE);
@ -1848,6 +1852,8 @@ public Action UpdateWaveCount(int client)
} }
g_iZMCount--; g_iZMCount--;
PrintHintTextToAll("Day %i: %s\nRemaining Zombies: %i\nHumans: %i\nZombies: %i", g_iWave, g_cDaysTitles[g_iWave - 1], g_iZMCount, humanCount, zombieCount); 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) if (g_iZMCount == 0 && g_bRoundInProgress)
{ {
@ -1898,6 +1904,19 @@ public Action OnTakeDamage(int client, int &attacker, int &inflictor, float &dam
return Plugin_Handled; return Plugin_Handled;
else if (damagetype & DMG_FALL && g_bFallDamage[client]) else if (damagetype & DMG_FALL && g_bFallDamage[client])
return Plugin_Handled; 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 if (IsValidClient(attacker) && g_fDamageMultiplier[attacker] != 1.0) //damage multiplier
{ {
//value lower than 1.0 will reduce the actual damage. //value lower than 1.0 will reduce the actual damage.