AttackDown
This commit is contained in:
parent
a8645e1511
commit
bc55cdbd30
|
@ -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"
|
||||
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 )
|
||||
assert( isbool(hand), "You forgot the hand." )
|
||||
assert( isstring(id), "You forgot the ID." )
|
||||
|
|
|
@ -195,8 +195,10 @@ function SWEP:Think()
|
|||
|
||||
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 )
|
||||
end
|
||||
if !self:C_AttackDown( true ) then
|
||||
self:SetWep2_Burst( 0 )
|
||||
end
|
||||
|
||||
|
|
|
@ -452,7 +452,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
|
|||
local identicallist = p:INV_Find( wep:BTable( hand ).Class )
|
||||
identicallist = table.Flip( identicallist )
|
||||
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
|
||||
surface.SetDrawColor( scheme["fg"] )
|
||||
|
|
Loading…
Reference in New Issue