From a14df3e10d4b54df4f03a4eebbfe2216afb8efbf Mon Sep 17 00:00:00 2001 From: jenz Date: Thu, 22 Feb 2024 22:52:22 +0100 Subject: [PATCH] checking if health perk from smrpg is active --- ZombieRiot/scripting/unloze_zr.sp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ZombieRiot/scripting/unloze_zr.sp b/ZombieRiot/scripting/unloze_zr.sp index 2bd987d9..7bbbc880 100644 --- a/ZombieRiot/scripting/unloze_zr.sp +++ b/ZombieRiot/scripting/unloze_zr.sp @@ -13,6 +13,9 @@ #include #include +//smrpg not letting health be overwritten by zr classes +#tryinclude + #pragma newdecls required //#pragma dynamic 131072 char g_cDaysTitles[100][512]; @@ -1740,7 +1743,13 @@ public Action Timer_SetSpeed(Handle timer, any userid) } else if (CS_TEAM_CT == GetClientTeam(client)) { - SetEntityHealth(client, StringToInt(g_cHealth[g_iSpeedDelayClient[client]][g_iLength])); + // smrpg + //checking if the health perk is used by the player, this basically makes the hp setting in the config useless most of the time. + //but looks like people just anyways will want CT to always have 100 HP. + if (SMRPG_Health_GetClientMaxHealth(client) == 100) + { + SetEntityHealth(client, StringToInt(g_cHealth[g_iSpeedDelayClient[client]][g_iLength])); + } } } return Plugin_Handled;