SetCameraGoggleEffect: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Added code identitation, removed need example category.)
Line 18: Line 18:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function nightvision()
function nightvision()
if(getCameraGoggleEffect == "normal") then
    if(getCameraGoggleEffect == "normal") then
setCameraGoggleEffect("nightvision")
        setCameraGoggleEffect("nightvision")
else if(getCameraGoggleEffect == "nightvision") then
    else if(getCameraGoggleEffect == "nightvision") then
setCameraGoggleEffect("normal")
        setCameraGoggleEffect("normal")
end
    end
end
end



Revision as of 14:48, 20 February 2011

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)

See Also