From 4c7d48bb698b70142cfda7bf33454acf3c544d2e Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Tue, 19 Mar 2024 10:56:37 +0300 Subject: [PATCH] fix: Give player weapon in only pistols mode (#101) --- .../ReDeathmatch/ReDM_equip_manager.inc | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_equip_manager.inc b/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_equip_manager.inc index 0da275b..017f4ca 100644 --- a/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_equip_manager.inc +++ b/cstrike/addons/amxmodx/scripting/ReDeathmatch/ReDM_equip_manager.inc @@ -424,17 +424,25 @@ public CBasePlayer_OnSpawnEquip_Post(const player, bool: addDefault, bool: equip if (!IsActive()) return + new hasConfiguredEquip = false for (new EquipType_e: section; section < EquipType_e; section++) { - if (g_playerWeapons[player][section] != EQUIP_NOT_CHOOSEN) { - Player_GiveWeapon(player, section) - + if (g_playerWeapons[player][section] == EQUIP_NOT_CHOOSEN) continue - } - if (redm_open_equip_menu) - Menu_ChooseEquip(player, section) + hasConfiguredEquip = true + Player_GiveWeapon(player, section) + } + if (hasConfiguredEquip) return + + // TODO: smells like a shit. need to rework later + if (!hasConfiguredEquip && redm_open_equip_menu) { + if (!g_inEquipMenu[player]) { + new EquipType_e: section = (g_playerWeapons[player][et_Primary] == EQUIP_NOT_CHOOSEN) ? et_Primary : et_Secondary + + Menu_ChooseEquip(player, section) + } } }