Remove annoying prints, camera thing idk

This commit is contained in:
Fesiug 2023-11-18 03:52:40 -05:00
parent 71458c29f2
commit 20e2281e34
3 changed files with 24 additions and 5 deletions

View File

@ -48,9 +48,7 @@ end, "arg 1: player ent index, arg 2: classname")
concommand.Add("benny_inv_equip", function( ply, cmd, args ) concommand.Add("benny_inv_equip", function( ply, cmd, args )
local wep = ply:BennyCheck() local wep = ply:BennyCheck()
if wep then if wep then
print(args[2])
local hand = args[2]!=nil and tobool(args[2]) or wep:GetTempHandedness() local hand = args[2]!=nil and tobool(args[2]) or wep:GetTempHandedness()
print(hand)
local id = args[1] local id = args[1]
local swap_or_replace = tobool(args[3]) local swap_or_replace = tobool(args[3])

View File

@ -21,7 +21,14 @@ hook.Add( "PlayerNoClip", "Benny_PlayerNoClip", function( ply, desiredNoClipStat
end) end)
hook.Add( "InputMouseApply", "Benny_InputMouseApply", function( cmd, x, y, ang ) hook.Add( "InputMouseApply", "Benny_InputMouseApply", function( cmd, x, y, ang )
if LocalPlayer():BennyCheck() and !LocalPlayer():NoclippingAndNotVaulting() and GetConVar("benny_cam_override"):GetString() == "" then local p = LocalPlayer()
local w = p:BennyCheck()
local cdis = false
if w and w:BClass( false ) and w:BClass( false ).Custom_DisableSpecialMovement and w:BClass( false ).Custom_DisableSpecialMovement( w ) then cdis = true end
if w and w:BClass( true ) and w:BClass( true ).Custom_DisableSpecialMovement and w:BClass( true ).Custom_DisableSpecialMovement( w ) then cdis = true end
if GetConVar("benny_cam_override"):GetString() != "" then cdis = true end
if p:NoclippingAndNotVaulting() then cdis = true end
if w and !cdis then
TPSOverride:Add( Angle( y*0.022, -x*0.022, 0 ) ) TPSOverride:Add( Angle( y*0.022, -x*0.022, 0 ) )
return true return true
end end
@ -75,8 +82,13 @@ hook.Add( "CreateMove", "Benny_CreateMove", function( cmd )
end end
local p = LocalPlayer() local p = LocalPlayer()
local w = p:GetActiveWeapon() local w = p:BennyCheck()
if p:BennyCheck() and !LocalPlayer():NoclippingAndNotVaulting() and GetConVar("benny_cam_override"):GetString() == "" then -- FPS cam local cdis = false
if w:BClass( false ) and w:BClass( false ).Custom_DisableSpecialMovement and w:BClass( false ).Custom_DisableSpecialMovement( w ) then cdis = true end
if w:BClass( true ) and w:BClass( true ).Custom_DisableSpecialMovement and w:BClass( true ).Custom_DisableSpecialMovement( w ) then cdis = true end
if GetConVar("benny_cam_override"):GetString() != "" then cdis = true end
if LocalPlayer():NoclippingAndNotVaulting() then cdis = true end
if w and !cdis then -- FPS cam
local aimed = w:GetUserAim() local aimed = w:GetUserAim()
local opos, ang = p:CamSpot( TPSOverride ) local opos, ang = p:CamSpot( TPSOverride )

View File

@ -273,9 +273,18 @@ do -- Toolgun
return true return true
end, end,
Custom_DisableSpecialMovement = function( self, data )
-- Return true to skip weapon logic
if self:GetUserAim() then
return true
end
end,
Custom_CalcView = function( self, data ) Custom_CalcView = function( self, data )
if self:GetUserAim() and GetConVar("benny_cam_override"):GetString() == "" then if self:GetUserAim() and GetConVar("benny_cam_override"):GetString() == "" then
data.drawviewer = false data.drawviewer = false
data.origin = self:GetOwner():EyePos()
data.angles = self:GetOwner():EyeAngles()
return true -- Return true to halt return true -- Return true to halt
end end