DualCheck WIP
This commit is contained in:
parent
dce612e146
commit
b0a3bdddc7
|
@ -1,7 +1,7 @@
|
|||
|
||||
|
||||
function SWEP:PrimaryAttack()
|
||||
local dual = self:BTable( false ) and self:BTable( true )
|
||||
local dual = self:C_DualCheck()
|
||||
if dual then
|
||||
self:BFire( true )
|
||||
else
|
||||
|
@ -11,7 +11,7 @@ function SWEP:PrimaryAttack()
|
|||
end
|
||||
|
||||
function SWEP:SecondaryAttack()
|
||||
local dual = self:BTable( false ) and self:BTable( true )
|
||||
local dual = self:C_DualCheck()
|
||||
if dual then
|
||||
self:BFire( false )
|
||||
else
|
||||
|
|
|
@ -53,6 +53,10 @@ function SWEP:D_SetClip( hand, value )
|
|||
return (hand == true) and self:SetClip2( value ) or (hand == false) and self:SetClip1( value )
|
||||
end
|
||||
|
||||
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:BDeploy( hand, id )
|
||||
assert( isbool(hand), "You forgot the hand." )
|
||||
assert( isstring(id), "You forgot the ID." )
|
||||
|
|
|
@ -170,7 +170,7 @@ hook.Add( "PlayerButtonDown", "Benny_PlayerButtonDown_TempForAim", function( ply
|
|||
end
|
||||
end
|
||||
|
||||
local dual = wep:BTable( false ) and wep:BTable( true )
|
||||
local dual = wep:C_DualCheck()
|
||||
if button == KEY_R then
|
||||
if dual then wep:Reload( true ) else wep:Reload( false ) end
|
||||
end
|
||||
|
|
|
@ -182,7 +182,13 @@ end
|
|||
|
||||
function GM:ShowSpare1( ply )
|
||||
if SERVER then
|
||||
ply:ConCommand( "benny_inv_holster" )
|
||||
ply:ConCommand( "benny_gui_settings" )
|
||||
end
|
||||
end
|
||||
|
||||
function GM:ShowSpare2( ply )
|
||||
if SERVER then
|
||||
ply:ConCommand( "benny_gui_spscore" )
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -344,24 +350,24 @@ if CLIENT then
|
|||
local opt1 = Menu:AddOption( "Equip Right", function()
|
||||
RunConsoleCommand( "benny_inv_equip", button.ID, "false" )
|
||||
end)
|
||||
opt1:SetIcon( "icon16/resultset_next.png" )
|
||||
opt1:SetIcon( "icon16/resultset_last.png" )
|
||||
|
||||
local opt3 = Menu:AddOption( "Swap Right", function()
|
||||
local opt3 = Menu:AddOption( "Equip Right, Move Left", function()
|
||||
RunConsoleCommand( "benny_inv_equip", button.ID, "false", "true" )
|
||||
end)
|
||||
opt3:SetIcon( "icon16/resultset_first.png" )
|
||||
opt3:SetIcon( "icon16/resultset_next.png" )
|
||||
|
||||
Menu:AddSpacer()
|
||||
|
||||
local opt2 = Menu:AddOption( "Equip Left", function()
|
||||
RunConsoleCommand( "benny_inv_equip", button.ID, "true" )
|
||||
end)
|
||||
opt2:SetIcon( "icon16/resultset_previous.png" )
|
||||
opt2:SetIcon( "icon16/resultset_first.png" )
|
||||
|
||||
local opt4 = Menu:AddOption( "Swap Left", function()
|
||||
local opt4 = Menu:AddOption( "Equip Left, Move Right", function()
|
||||
RunConsoleCommand( "benny_inv_equip", button.ID, "true", "true" )
|
||||
end)
|
||||
opt4:SetIcon( "icon16/resultset_last.png" )
|
||||
opt4:SetIcon( "icon16/resultset_previous.png" )
|
||||
|
||||
Menu:AddSpacer()
|
||||
|
||||
|
|
Loading…
Reference in New Issue