aboutsummaryrefslogtreecommitdiff
path: root/entities/weapons/hands.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2018-11-02 13:21:25 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2018-11-02 13:21:25 -0400
commit81832da4f9a59fc271ce8982b948ec6688f43983 (patch)
tree1e5ca535da860c8312d98012729dc820e8a30d6f /entities/weapons/hands.lua
parenta793150e96506a3043d792e29627b633499aa6a3 (diff)
downloadartery-81832da4f9a59fc271ce8982b948ec6688f43983.tar.gz
artery-81832da4f9a59fc271ce8982b948ec6688f43983.tar.bz2
artery-81832da4f9a59fc271ce8982b948ec6688f43983.zip
Moved code to prevent weapon switching
Moved code that prevents weaponswitching into hand.lua
Diffstat (limited to 'entities/weapons/hands.lua')
-rw-r--r--entities/weapons/hands.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/entities/weapons/hands.lua b/entities/weapons/hands.lua
index 7b5c042..9c7059e 100644
--- a/entities/weapons/hands.lua
+++ b/entities/weapons/hands.lua
@@ -155,6 +155,17 @@ function SWEP:SecondaryAttack()
end --Make sure we have a weapon
end
+--Prevent switching away from the hands weapon
+hook.Add("PlayerSwitchWeapon","prevent_switch",function(ply,oldwep,newwep)
+ return false
+end)
+
+if CLIENT then
+ hook.Add( "HUDShouldDraw", "HideWeaponSelHUD", function( name )
+ if name == "CHudWeaponSelection" then return false end
+ end )
+end
+
hook.Add("PlayerSpawn","give_hands",function(ply)
ply:Give("hands")
end)