Select same weapon to holster
This commit is contained in:
parent
d77bd5ccb4
commit
49245d0940
|
@ -17,19 +17,28 @@ local dads = {
|
||||||
local function beatup( ply, num )
|
local function beatup( ply, num )
|
||||||
local weighted = ply:INV_Weight()
|
local weighted = ply:INV_Weight()
|
||||||
local inv = ply:INV_Get()
|
local inv = ply:INV_Get()
|
||||||
|
local wep = ply:BennyCheck()
|
||||||
local iflip = table.Flip( inv )
|
local iflip = table.Flip( inv )
|
||||||
|
|
||||||
local invid = 0
|
local invid = 0
|
||||||
for _, item in pairs( weighted ) do
|
for _, item in pairs( weighted ) do
|
||||||
local class = WeaponGet(item.Class)
|
local class = WeaponGet(item.Class)
|
||||||
|
local id = iflip[item]
|
||||||
if class.Features == "firearm" or class.Features == "grenade" then
|
if class.Features == "firearm" or class.Features == "grenade" then
|
||||||
invid = invid + 1
|
invid = invid + 1
|
||||||
if num == invid then
|
if num == invid then
|
||||||
--RunConsoleCommand( "benny_inv_equip", iflip[item], "false", "false" )
|
|
||||||
if ply:KeyDown(IN_ZOOM) then
|
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
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue