Weapons not on hands for some reason. Tired
This commit is contained in:
parent
97d2eebf4e
commit
7de193a68e
|
@ -138,7 +138,7 @@ function SWEP:EquipItem( ent )
|
|||
|
||||
ent:EmitSound( "ae/items/pickup.ogg", 70, 100, 1, CHAN_STATIC )
|
||||
|
||||
self:SetActive( ent )
|
||||
--self:SetActive( ent )
|
||||
local inv = p:GetInventory()
|
||||
inv[ent] = true
|
||||
inv:Sync()
|
||||
|
|
|
@ -155,11 +155,6 @@ local dads = {
|
|||
[KEY_0] = 0,
|
||||
}
|
||||
|
||||
local mwheel = {
|
||||
[MOUSE_WHEEL_DOWN] = 1,
|
||||
[MOUSE_WHEEL_UP] = -1
|
||||
}
|
||||
|
||||
local function beatup( ply, num )
|
||||
local inv = ply:GetInventory():GetWeighted()
|
||||
local wep = ply:BennyCheck()
|
||||
|
@ -174,43 +169,10 @@ local function beatup( ply, num )
|
|||
end
|
||||
end
|
||||
|
||||
local function boba( ply, mwheel )
|
||||
if mwheel != 0 then
|
||||
print("Test", math.Round( CurTime()%60, 4 ), mwheel )
|
||||
local inv = ply:GetInventory():GetWeighted()
|
||||
local wep = ply:BennyCheck()
|
||||
|
||||
local inf = table.Flip( inv )
|
||||
local currpos = inf[wep:GetActiveR()]
|
||||
if !currpos then
|
||||
if mwheel > 0 then
|
||||
currpos = 0
|
||||
else
|
||||
currpos = #inv+1
|
||||
end
|
||||
end
|
||||
|
||||
local want = currpos+mwheel
|
||||
|
||||
if want > #inv then
|
||||
want = want - #inv
|
||||
elseif want <= 0 then
|
||||
want = want + #inv
|
||||
end
|
||||
|
||||
local ent = inv[want]
|
||||
if ent then
|
||||
wep:SetActive(ent)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
hook.Add( "PlayerButtonDown", "Benny_PlayerButtonDown_Inv", function( ply, button )
|
||||
local wep = ply:HandlerCheck()
|
||||
|
||||
if dads[button] then
|
||||
beatup( ply, dads[button] )
|
||||
elseif mwheel[button] then
|
||||
boba( ply, mwheel[button] )
|
||||
end
|
||||
end)
|
||||
|
|
Loading…
Reference in New Issue