SetCameraGoggleEffect: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ {{Client function}} This function allows you to set the camera's current goggle effect. This means you can activate nightvision or infrared effects by script ==Syntax=...") |
|||
Line 17: | Line 17: | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function nightvision() | |||
if(getCameraGoggleEffect == "normal") then | |||
setCameraGoggleEffect("nightvision") | |||
else if(getCameraGoggleEffect == "nightvision") then | |||
setCameraGoggleEffect("normal") | |||
end | |||
end | |||
addCommandHandler("nightvision", nightvision) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 15:12, 28 December 2010
This function allows you to set the camera's current goggle effect. This means you can activate nightvision or infrared effects by script
Syntax
bool setCameraGoggleEffect ( string goggleEffect )
Required Arguments
- goggleEffect: The goggle effect you wish to set
- normal: No camera goggle effect
- nightvision: Nightvision camera
- thermalvision: Infrared camera
Returns
Returns true if the effect was set correctly, false otherwise.
Example
function nightvision() if(getCameraGoggleEffect == "normal") then setCameraGoggleEffect("nightvision") else if(getCameraGoggleEffect == "nightvision") then setCameraGoggleEffect("normal") end end addCommandHandler("nightvision", nightvision)