checking if health perk from smrpg is active

This commit is contained in:
jenz 2024-02-22 22:52:22 +01:00
parent c26c9255e1
commit a14df3e10d

View File

@ -13,6 +13,9 @@
#include <clientprefs> #include <clientprefs>
#include <smlib> #include <smlib>
//smrpg not letting health be overwritten by zr classes
#tryinclude <smrpg_health>
#pragma newdecls required #pragma newdecls required
//#pragma dynamic 131072 //#pragma dynamic 131072
char g_cDaysTitles[100][512]; char g_cDaysTitles[100][512];
@ -1740,7 +1743,13 @@ public Action Timer_SetSpeed(Handle timer, any userid)
} }
else if (CS_TEAM_CT == GetClientTeam(client)) 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; return Plugin_Handled;