GetCameraGoggleEffect: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
Line 15: Line 15:
==Example==
==Example==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
-- TODO
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 returns what goggle effect is currently affecting the camera.

Syntax

int 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

function nightvision()
if(getCameraGoggleEffect == "normal") then
setCameraGoggleEffect("nightvision")
else if(getCameraGoggleEffect == "nightvision") then
setCameraGoggleEffect("normal")
end
end

addCommandHandler("nightvision", nightvision)

See Also