DualCheck WIP

This commit is contained in:
Fesiug 2023-11-29 18:00:08 -05:00
parent dce612e146
commit b0a3bdddc7
4 changed files with 20 additions and 10 deletions

View File

@ -1,7 +1,7 @@
function SWEP:PrimaryAttack() function SWEP:PrimaryAttack()
local dual = self:BTable( false ) and self:BTable( true ) local dual = self:C_DualCheck()
if dual then if dual then
self:BFire( true ) self:BFire( true )
else else
@ -11,7 +11,7 @@ function SWEP:PrimaryAttack()
end end
function SWEP:SecondaryAttack() function SWEP:SecondaryAttack()
local dual = self:BTable( false ) and self:BTable( true ) local dual = self:C_DualCheck()
if dual then if dual then
self:BFire( false ) self:BFire( false )
else else

View File

@ -53,6 +53,10 @@ function SWEP:D_SetClip( hand, value )
return (hand == true) and self:SetClip2( value ) or (hand == false) and self:SetClip1( value ) return (hand == true) and self:SetClip2( value ) or (hand == false) and self:SetClip1( value )
end 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 ) 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

@ -170,7 +170,7 @@ hook.Add( "PlayerButtonDown", "Benny_PlayerButtonDown_TempForAim", function( ply
end end
end end
local dual = wep:BTable( false ) and wep:BTable( true ) local dual = wep:C_DualCheck()
if button == KEY_R then if button == KEY_R then
if dual then wep:Reload( true ) else wep:Reload( false ) end if dual then wep:Reload( true ) else wep:Reload( false ) end
end end

View File

@ -182,7 +182,13 @@ end
function GM:ShowSpare1( ply ) function GM:ShowSpare1( ply )
if SERVER then 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
end end
@ -344,24 +350,24 @@ if CLIENT then
local opt1 = Menu:AddOption( "Equip Right", function() local opt1 = Menu:AddOption( "Equip Right", function()
RunConsoleCommand( "benny_inv_equip", button.ID, "false" ) RunConsoleCommand( "benny_inv_equip", button.ID, "false" )
end) 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" ) RunConsoleCommand( "benny_inv_equip", button.ID, "false", "true" )
end) end)
opt3:SetIcon( "icon16/resultset_first.png" ) opt3:SetIcon( "icon16/resultset_next.png" )
Menu:AddSpacer() Menu:AddSpacer()
local opt2 = Menu:AddOption( "Equip Left", function() local opt2 = Menu:AddOption( "Equip Left", function()
RunConsoleCommand( "benny_inv_equip", button.ID, "true" ) RunConsoleCommand( "benny_inv_equip", button.ID, "true" )
end) 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" ) RunConsoleCommand( "benny_inv_equip", button.ID, "true", "true" )
end) end)
opt4:SetIcon( "icon16/resultset_last.png" ) opt4:SetIcon( "icon16/resultset_previous.png" )
Menu:AddSpacer() Menu:AddSpacer()