Disable switching weapon

Hi,
how i can disable switching weapon ?


function onPlayerSwitchWeapon( ply, oldWeapon, newWeapon )
	return false
end
hook.Add( "PlayerSwitchWeapon", "PlayerSwitchWeaponHavanna", onPlayerSwitchWeapon )

That doesn’t work
Thanks.

Read the wiki page: https://wiki.garrysmod.com/page/GM/PlayerSwitchWeapon

You are returning the wrong thing. Also, make your function local.