Weapons not on hands for some reason. Tired

This commit is contained in:
Fesiug 2024-03-07 22:58:30 -05:00
parent 97d2eebf4e
commit 7de193a68e
Signed by: Fesiug
GPG Key ID: 374BFF45E1EEF243
2 changed files with 1 additions and 39 deletions

View File

@ -138,7 +138,7 @@ function SWEP:EquipItem( ent )
ent:EmitSound( "ae/items/pickup.ogg", 70, 100, 1, CHAN_STATIC ) ent:EmitSound( "ae/items/pickup.ogg", 70, 100, 1, CHAN_STATIC )
self:SetActive( ent ) --self:SetActive( ent )
local inv = p:GetInventory() local inv = p:GetInventory()
inv[ent] = true inv[ent] = true
inv:Sync() inv:Sync()

View File

@ -155,11 +155,6 @@ local dads = {
[KEY_0] = 0, [KEY_0] = 0,
} }
local mwheel = {
[MOUSE_WHEEL_DOWN] = 1,
[MOUSE_WHEEL_UP] = -1
}
local function beatup( ply, num ) local function beatup( ply, num )
local inv = ply:GetInventory():GetWeighted() local inv = ply:GetInventory():GetWeighted()
local wep = ply:BennyCheck() local wep = ply:BennyCheck()
@ -174,43 +169,10 @@ local function beatup( ply, num )
end end
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 ) hook.Add( "PlayerButtonDown", "Benny_PlayerButtonDown_Inv", function( ply, button )
local wep = ply:HandlerCheck() local wep = ply:HandlerCheck()
if dads[button] then if dads[button] then
beatup( ply, dads[button] ) beatup( ply, dads[button] )
elseif mwheel[button] then
boba( ply, mwheel[button] )
end end
end) end)