Garry's Mod Wiki

WEAPON:CalcView

  Vector, Angle, number WEAPON:CalcView( Player ply, Vector pos, Angle ang, number fov )

Description

Allows you to adjust player view while this weapon in use.

This hook is called from the default implementation of GM:CalcView which is here. Therefore, it will not be called if any other hook added to CalcView returns any value, or if the current gamemode overrides the default hook and does not call the SWEP function.

Arguments

1 Player ply
The owner of weapon
2 Vector pos
Current position of players view
3 Angle ang
Current angles of players view
4 number fov
Current FOV of players view

Returns

1 Vector
New position of players view
2 Angle
New angle of players view
3 number
New FOV of players view