setTrafficLightsLocked
Client-side
Server-side
Shared
Manual Review Required
Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.
Toggles whether you want the traffic lights to be locked. If the lights are locked, it means they won't change unless you do setTrafficLightState.
Syntax
bool setTrafficLightsLocked ( bool toggle )Required Arguments
- toggle: A bool indicating whether you want the traffic lights to change automatically, or not
Returns
- bool: value
Returns true if the successful, false otherwise.
Code Examples
shared
This example toggles traffic lights between 'locked' and 'unlocked'.
function toggleTrafficLights() if areTrafficLightsLocked() then -- See if traffic lights are currently locked setTrafficLightsLocked(false) -- unlock traffic lights if they are currently locked else setTrafficLightsLocked(true) -- lock traffic lights if they are not locked endend-- add command handler for command which toggles lightsaddCommandHandler("toggletrafficlights",toggleTrafficLights)See Also
World Functions
- areTrafficLightsLocked
- createSWATRope
- getAircraftMaxHeight
- getAircraftMaxVelocity
- getBirdsEnabled
- getCloudsEnabled
- getColorFilter
- getCoronaReflectionsEnabled
- getFarClipDistance
- getFogDistance
- getGameSpeed
- getGarageBoundingBox
- getGaragePosition
- getGarageSize
- getGravity
- getGroundPosition
- getHeatHaze
- getInteriorFurnitureEnabled
- getInteriorSoundsEnabled
- getJetpackMaxHeight
- getJetpackWeaponEnabled
- getMinuteDuration
- getMoonSize
- getNearClipDistance
- getOcclusionsEnabled
- getPedsLODDistance
- getRainLevel
- getRoofPosition
- getScreenFromWorldPosition
- getSkyGradient
- getSunColor
- getSunSize
- getTime
- getTrafficLightState
- getVehiclesLODDistance
- getWeather
- getWindVelocity
- getWorldFromScreenPosition
- getWorldProperty
- getZoneName
- isAmbientSoundEnabled
- isGarageOpen
- isLineOfSightClear
- isTimeFrozen
- isVolumetricShadowsEnabled
- isWorldSoundEnabled
- isWorldSpecialPropertyEnabled
- processLineAgainstMesh
- processLineOfSight
- removeGameWorld
- removeWorldModel
- resetAmbientSounds
- resetBlurLevel
- resetColorFilter
- resetCoronaReflectionsEnabled
- resetFarClipDistance
- resetFogDistance
- resetHeatHaze
- resetMoonSize
- resetNearClipDistance
- resetPedsLODDistance
- resetRainLevel
- resetSkyGradient
- resetSunColor
- resetSunSize
- resetTimeFrozen
- resetVehiclesLODDistance
- resetVolumetricShadows
- resetWindVelocity
- resetWorldProperties
- resetWorldProperty
- resetWorldSounds
- restoreAllWorldModels
- restoreGameWorld
- restoreWorldModel
- setAircraftMaxHeight
- setAircraftMaxVelocity
- setAmbientSoundEnabled
- setBirdsEnabled
- setCloudsEnabled
- setColorFilter
- setCoronaReflectionsEnabled
- setFarClipDistance
- setFogDistance
- setGameSpeed
- setGarageOpen
- setGrainLevel
- setGrainMultiplier
- setGravity
- setHeatHaze
- setInteriorFurnitureEnabled
- setInteriorSoundsEnabled
- setJetpackMaxHeight
- setJetpackWeaponEnabled
- setMinuteDuration
- setMoonSize
- setNearClipDistance
- setOcclusionsEnabled
- setPedsLODDistance
- setRainLevel
- setSkyGradient
- setSunColor
- setSunSize
- setTime
- setTimeFrozen
- setTrafficLightsLocked
- setTrafficLightState
- setVehiclesLODDistance
- setVolumetricShadowsEnabled
- setWeather
- setWeatherBlended
- setWindVelocity
- setWorldProperty
- setWorldSoundEnabled
- setWorldSpecialPropertyEnabled
- testLineAgainstWater
- testSphereAgainstWorld