From 473abce62ebd374951ccafd2c2e83a0ff8d2c18b Mon Sep 17 00:00:00 2001 From: dogan Date: Sun, 16 Aug 2020 22:43:52 +0200 Subject: [PATCH] BossHP: limit cash gain to sm_maxcash --- BossHP/scripting/BossHP_Ranking.sp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/BossHP/scripting/BossHP_Ranking.sp b/BossHP/scripting/BossHP_Ranking.sp index 349b9b43..b6f2784f 100644 --- a/BossHP/scripting/BossHP_Ranking.sp +++ b/BossHP/scripting/BossHP_Ranking.sp @@ -84,7 +84,10 @@ public void OnBossDamaged(CBoss Boss, CConfig Config, int client, float damage) if (!IsValidClient(client)) return; - SetEntProp(client, Prop_Send, "m_iAccount", GetEntProp(client, Prop_Send, "m_iAccount") + 2); + int iMaxCash = GetConVarInt(FindConVar("sm_maxcash")); + + if(!(GetEntProp(client, Prop_Send, "m_iAccount") >= iMaxCash)) + SetEntProp(client, Prop_Send, "m_iAccount", GetEntProp(client, Prop_Send, "m_iAccount") + 2); bool bBreakable; CConfig _Config = view_as(Config);