From 49245d0940fefc8cae53822943dba8e15b58c685 Mon Sep 17 00:00:00 2001 From: Fesiug Date: Fri, 8 Dec 2023 19:30:22 -0500 Subject: [PATCH] Select same weapon to holster --- .../benny/gamemode/modules/player/sh_hud.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/gamemodes/benny/gamemode/modules/player/sh_hud.lua b/gamemodes/benny/gamemode/modules/player/sh_hud.lua index 69f8e21..8d80774 100644 --- a/gamemodes/benny/gamemode/modules/player/sh_hud.lua +++ b/gamemodes/benny/gamemode/modules/player/sh_hud.lua @@ -17,19 +17,28 @@ local dads = { local function beatup( ply, num ) local weighted = ply:INV_Weight() local inv = ply:INV_Get() + local wep = ply:BennyCheck() local iflip = table.Flip( inv ) local invid = 0 for _, item in pairs( weighted ) do local class = WeaponGet(item.Class) + local id = iflip[item] if class.Features == "firearm" or class.Features == "grenade" then invid = invid + 1 if num == invid then - --RunConsoleCommand( "benny_inv_equip", iflip[item], "false", "false" ) if ply:KeyDown(IN_ZOOM) then - return ply:SetReqID2(iflip[item]) + if id == wep:D_GetID( true ) then + return ply:SetReqID2("") + else + return ply:SetReqID2(id) + end else - return ply:SetReqID1(iflip[item]) + if id == wep:D_GetID( false ) then + return ply:SetReqID1("") + else + return ply:SetReqID1(id) + end end end end