diff --git a/addons/sourcemod/scripting/entwatch/module_hud.inc b/addons/sourcemod/scripting/entwatch/module_hud.inc index b76c1de..6039d16 100755 --- a/addons/sourcemod/scripting/entwatch/module_hud.inc +++ b/addons/sourcemod/scripting/entwatch/module_hud.inc @@ -521,9 +521,9 @@ void EWM_Hud_Construct_String(int iClient, char[] sResult, int iSizeResult, char case 3: FormatItemWithUses(sBuf_woname[iIndex], ItemTest); case 4: - FormatItemWithUses(sBuf_woname[iIndex], ItemTest); + FormatItemWithUsesAndCoolodown(sBuf_woname[iIndex], ItemTest); case 5: - FormatItemWithUses(sBuf_woname[iIndex], ItemTest); + FormatItemCooldownAfterUses(sBuf_woname[iIndex], ItemTest); case 6, 7: FormatItemWithMathValue(sBuf_woname[iIndex], ItemTest); default: @@ -547,9 +547,9 @@ void EWM_Hud_Construct_String(int iClient, char[] sResult, int iSizeResult, char case 3: FormatItemWithUses(sBuf_woname[iIndex], ItemTest, true); case 4: - FormatItemWithUses(sBuf_woname[iIndex], ItemTest, true); + FormatItemWithUsesAndCoolodown(sBuf_woname[iIndex], ItemTest, true); case 5: - FormatItemWithUses(sBuf_woname[iIndex], ItemTest, true); + FormatItemCooldownAfterUses(sBuf_woname[iIndex], ItemTest, true); case 6, 7: FormatItemWithMathValue(sBuf_woname[iIndex], ItemTest, true); } @@ -619,6 +619,62 @@ void FormatItemWithUses(char[] sBuf_woname, class_ItemList ItemTest, bool bSecon } } +void FormatItemWithUsesAndCoolodown(char[] sBuf_woname, class_ItemList ItemTest, bool bSecond = false) +{ + if (!bSecond) + { + if (ItemTest.Uses < ItemTest.MaxUses) + { + if (ItemTest.CoolDown > 0 && ItemTest.CheckCoolDown() > 0) + FormatEx(sBuf_woname, MAX_SizeStringForItem, "%s[%d]", ItemTest.ShortName, ItemTest.RoundCoolDown()); + else + FormatEx(sBuf_woname, MAX_SizeStringForItem, "%s[%d/%d]", ItemTest.ShortName, ItemTest.Uses, ItemTest.MaxUses); + } + else + FormatEx(sBuf_woname, MAX_SizeStringForItem, "%s[E]", ItemTest.ShortName); + } + else + { + if (ItemTest.Uses2 < ItemTest.MaxUses2) + { + if (ItemTest.CoolDown2 > 0 && ItemTest.CheckCoolDown(true) > 0) + FormatEx(sBuf_woname, MAX_SizeStringForItem, "%s[%d]", sBuf_woname, ItemTest.RoundCoolDown(true)); + else + FormatEx(sBuf_woname, MAX_SizeStringForItem, "%s[%d/%d]", sBuf_woname, ItemTest.Uses2, ItemTest.MaxUses2); + } + else + FormatEx(sBuf_woname, MAX_SizeStringForItem, "%s[E]", sBuf_woname); + } +} + +void FormatItemCooldownAfterUses(char[] sBuf_woname, class_ItemList ItemTest, bool bSecond = false) +{ + if (!bSecond) + { + if (ItemTest.Uses < ItemTest.MaxUses) + { + if (ItemTest.CoolDown > 0 && ItemTest.CheckCoolDown() > 0) + FormatEx(sBuf_woname, MAX_SizeStringForItem, "%s[%d]", ItemTest.ShortName, ItemTest.RoundCoolDown()); + else + FormatEx(sBuf_woname, MAX_SizeStringForItem, "%s[%d/%d]", ItemTest.ShortName, ItemTest.Uses, ItemTest.MaxUses); + } + else + FormatEx(sBuf_woname, MAX_SizeStringForItem, "%s[E]", ItemTest.ShortName); + } + else + { + if (ItemTest.Uses2 < ItemTest.MaxUses2) + { + if (ItemTest.CoolDown2 > 0 && ItemTest.CheckCoolDown(true) > 0) + FormatEx(sBuf_woname, MAX_SizeStringForItem, "%s[%d]", sBuf_woname, ItemTest.RoundCoolDown(true)); + else + FormatEx(sBuf_woname, MAX_SizeStringForItem, "%s[%d/%d]", sBuf_woname, ItemTest.Uses2, ItemTest.MaxUses2); + } + else + FormatEx(sBuf_woname, MAX_SizeStringForItem, "%s[E]", sBuf_woname); + } +} + void FormatItemWithMathValue(char[] sBuf_woname, class_ItemList ItemTest, bool bSecond = false) { if (!bSecond) diff --git a/addons/sourcemod/scripting/entwatch_dz.sp b/addons/sourcemod/scripting/entwatch_dz.sp index 5df5758..3e5b170 100644 --- a/addons/sourcemod/scripting/entwatch_dz.sp +++ b/addons/sourcemod/scripting/entwatch_dz.sp @@ -77,7 +77,7 @@ public Plugin myinfo = name = "EntWatch", author = "DarkerZ[RUS], AgentWesker, notkoen, sTc2201, maxime1907, Cmer, .Rushaway, Dolly", description = "Notify players about entity interactions.", - version = "3.DZ.63", + version = "3.DZ.64", url = "dark-skill.ru" }; @@ -167,7 +167,6 @@ public void OnPluginStart() continue; OnClientPutInServer(i); - OnClientCookiesCached(i); OnClientPostAdminCheck(i); } } @@ -474,6 +473,9 @@ public void OnClientPostAdminCheck(int iClient) { if(!IsValidClient(iClient) || !IsClientConnected(iClient) || IsFakeClient(iClient)) return; + if (AreClientCookiesCached(iClient)) + OnClientCookiesCached(iClient); + #if defined EW_MODULE_OFFLINE_EBAN EWM_OfflineEban_OnClientPostAdminCheck(iClient); #endif