setCameraGoggleEffect | Multi Theft Auto: Wiki Skip to content

setCameraGoggleEffect

Client-side
Server-side
Shared

Pair: getCameraGoggleEffect

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function allows you to set the camera's current goggle effect. This means you can activate nightvision or infrared effects by script

OOP Syntax Help! I don't understand this!

  • Method: Camera.setGoggleEffect(...)
  • Variable: .goggleEffect

Syntax

bool setCameraGoggleEffect ( string goggleEffect, [ bool noiseEnabled = true ] )
Required Arguments
  • goggleEffect: the goggle effect you wish to set
Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use.

  • noiseEnabled (default: true): MISSING_PARAM_DESC

Returns

  • bool: value

true if the effect was set correctly. false otherwise.

Code Examples

shared
function nightvision()
local effect = (getCameraGoggleEffect() == "normal") and "nightvision" or "normal"
setCameraGoggleEffect(effect)
end
addCommandHandler("nightvision", nightvision)