From 8de58fad561e5f4ad3732f1d53a3dfa53734ce5f Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Tue, 23 Apr 2024 21:22:56 +0300 Subject: [PATCH 1/2] fix: Save player last weapon used even suicide --- cstrike/addons/amxmodx/scripting/ReDeathmatch.sma | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cstrike/addons/amxmodx/scripting/ReDeathmatch.sma b/cstrike/addons/amxmodx/scripting/ReDeathmatch.sma index 13b5cf2..7e2f448 100644 --- a/cstrike/addons/amxmodx/scripting/ReDeathmatch.sma +++ b/cstrike/addons/amxmodx/scripting/ReDeathmatch.sma @@ -147,11 +147,11 @@ public CSGameRules_PlayerKilled_Post(const victim, const killer, const inflictor if (!SV_IsPlayerIndex(killer)) return + EquipManager_PlayerKilled(victim) if (killer == victim) return Features_PlayerKilled(victim, killer) - EquipManager_PlayerKilled(victim) } public CvarChange_redm_active(const cvar, const oldValue[], const value[]) { From decdf166e40078027e6866e470ef9342fd0edb83 Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Tue, 23 Apr 2024 21:23:45 +0300 Subject: [PATCH 2/2] fix: reset last weapon on weapons giving --- .../amxmodx/scripting/ReDeathmatch/ReDM_equip_manager.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_equip_manager.inc b/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_equip_manager.inc index 50b01f2..1930423 100644 --- a/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_equip_manager.inc +++ b/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_equip_manager.inc @@ -546,7 +546,11 @@ static bool: Player_GiveWeapon(const player, const EquipType_e: section) { charsmax(weaponName) ) - rg_give_item(player, weaponName, .type = GT_REPLACE) + new item = rg_give_item(player, weaponName, .type = GT_REPLACE) + + // Reset last item + set_member(player, m_pLastItem, item) + return true }