GetCameraGoggleEffect: Difference between revisions
Jump to navigation
Jump to search
m (Added example explanation. Added code indentation. Removed "Needs_example" category.) |
OpenIDUser55 (talk | contribs) No edit summary |
||
Line 17: | Line 17: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function nightvision() | function nightvision() | ||
if(getCameraGoggleEffect == "normal") then | if (getCameraGoggleEffect() == "normal") then | ||
setCameraGoggleEffect("nightvision") | setCameraGoggleEffect("nightvision") | ||
elseif (getCameraGoggleEffect() == "nightvision") then | |||
setCameraGoggleEffect("normal") | setCameraGoggleEffect("normal") | ||
end | end |
Revision as of 18:38, 28 April 2013
This function returns what goggle effect is currently affecting the camera.
Syntax
string getCameraGoggleEffect ( )
Returns
Returns a string indicating the current camera goggle effect. Their meanings can be seen below.
- normal: No camera goggle effect
- nightvision: Nightvision camera
- thermalvision: Infrared camera
Example
This example adds a command to enable or disable the nightvision effect.
function nightvision() if (getCameraGoggleEffect() == "normal") then setCameraGoggleEffect("nightvision") elseif (getCameraGoggleEffect() == "nightvision") then setCameraGoggleEffect("normal") end end addCommandHandler("nightvision", nightvision)
See Also
- getCamera
- getCameraClip
- getCameraFieldOfView
- getCameraGoggleEffect
- getCameraViewMode
- setCameraClip
- setCameraFieldOfView
- setCameraGoggleEffect
- setCameraViewMode
- Shared
- fadeCamera
- getCameraInterior
- getCameraMatrix
- getCameraTarget
- setCameraInterior
- setCameraMatrix
- setCameraTarget