AttackDown

This commit is contained in:
Fesiug 2023-11-29 18:09:31 -05:00
parent a8645e1511
commit bc55cdbd30
3 changed files with 9 additions and 2 deletions

View File

@ -57,6 +57,11 @@ function SWEP:C_DualCheck()
return self:BTable( true )--self:BTable( false ) and self:BTable( true ) and self:BClass( false ).Features == "firearm" and self:BClass( true ).Features == "firearm" return self:BTable( true )--self:BTable( false ) and self:BTable( true ) and self:BClass( false ).Features == "firearm" and self:BClass( true ).Features == "firearm"
end end
function SWEP:C_AttackDown( hand )
if self:C_DualCheck() then hand = !hand end
return (hand == true) and self:GetOwner():KeyDown( IN_ATTACK2 ) or (hand == false) and self:GetOwner():KeyDown( IN_ATTACK )
end
function SWEP:BDeploy( hand, id ) function SWEP:BDeploy( hand, id )
assert( isbool(hand), "You forgot the hand." ) assert( isbool(hand), "You forgot the hand." )
assert( isstring(id), "You forgot the ID." ) assert( isstring(id), "You forgot the ID." )

View File

@ -195,8 +195,10 @@ function SWEP:Think()
self:SetAim( math.Approach( self:GetAim(), self:GetUserAim() and 1 or 0, FrameTime()/0.2 ) ) self:SetAim( math.Approach( self:GetAim(), self:GetUserAim() and 1 or 0, FrameTime()/0.2 ) )
if !p:KeyDown( IN_ATTACK ) then if !self:C_AttackDown( false ) then
self:SetWep1_Burst( 0 ) self:SetWep1_Burst( 0 )
end
if !self:C_AttackDown( true ) then
self:SetWep2_Burst( 0 ) self:SetWep2_Burst( 0 )
end end

View File

@ -452,7 +452,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
local identicallist = p:INV_Find( wep:BTable( hand ).Class ) local identicallist = p:INV_Find( wep:BTable( hand ).Class )
identicallist = table.Flip( identicallist ) identicallist = table.Flip( identicallist )
local numba = identicallist[ wep:D_GetID( hand ) ] local numba = identicallist[ wep:D_GetID( hand ) ]
draw.SimpleText( "(" .. tostring(numba) .. ") - " .. wep:D_GetID( hand ), "Benny_10", p_x+p_w-pb2, p_y+ss(7), scheme["bg"], TEXT_ALIGN_RIGHT, TEXT_ALIGN_TOP ) draw.SimpleText( "#" .. tostring(numba) .. ", " .. wep:D_GetID( hand ), "Benny_10", p_x+p_w-pb2, p_y+ss(7), scheme["bg"], TEXT_ALIGN_RIGHT, TEXT_ALIGN_TOP )
if wep_class.Firemodes then -- Firemode if wep_class.Firemodes then -- Firemode
surface.SetDrawColor( scheme["fg"] ) surface.SetDrawColor( scheme["fg"] )