GetCameraGoggleEffect: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
(6 intermediate revisions by 6 users not shown) | |||
Line 5: | Line 5: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
string getCameraGoggleEffect ( ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||Camera.getGoggleEffect|goggleEffect|setCameraGoggleEffect}} | |||
===Returns=== | ===Returns=== | ||
* [[String]] indicating the current camera goggle effect. Their meanings can be seen below. | |||
{{Camera goggle modes}} | {{Camera goggle modes}} | ||
==Example== | ==Example== | ||
This example adds a command to enable or disable the nightvision effect. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function nightvision() | |||
if (getCameraGoggleEffect() == "normal") then | |||
setCameraGoggleEffect("nightvision") | |||
elseif (getCameraGoggleEffect() == "nightvision") then | |||
setCameraGoggleEffect("normal") | |||
end | |||
end | |||
addCommandHandler("nightvision", nightvision) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Client camera functions}} | {{Client camera functions}} | ||
[[ | |||
[[hu:getCameraGoggleEffect]] | |||
[[RO:getCameraGoggleEffect]] |
Latest revision as of 07:47, 10 October 2020
This function returns what goggle effect is currently affecting the camera.
Syntax
string getCameraGoggleEffect ( )
OOP Syntax Help! I don't understand this!
- Method: Camera.getGoggleEffect(...)
- Variable: .goggleEffect
- Counterpart: setCameraGoggleEffect
Returns
- 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)