SWEP.TranslateFOV
From GMod Wiki
Revision as of 00:51, 24 October 2009 by Crazy Quebecer (Talk | contribs)
Event Hook | |
Hook Name | TranslateFOV |
Syntax | SWEP:TranslateFOV( Integer Fov ) |
Description | Takes the field of view defined in SWEP.ViewModelFOV and returns a new value. |
Returns | Integer Fov |
Lua State | |
BBCode | [b][url=wiki.garrysmod.com/?title=SWEP.TranslateFOV]SWEP.TranslateFOV [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Translate the FOV if we are zoomed in. |
---|---|
Used on | |
Code | function SWEP:TranslateFOV(oldfov) if self.ZoomedIn then return oldfov - 30 end end |
Output | N/A |
Additional Notes
- When calling this hook you MUST return a number value.
- Do not confuse this for a think function, this should strictly be used for drawing.
- Careful what you put here, it's run every frame, a lot of code may cause lag.
- This is only run when the swep is active, it will not run when the swep is holstered.