AreTrafficLightsLocked: Difference between revisions
Jump to navigation
Jump to search
(Created page with '__NOTOC__ {{Server client function}} Gets whether the traffic lights are currently locked or not. If the lights are locked, it means they won't change unless you do [[setTrafficL…') |
mNo edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 12: | Line 12: | ||
==Example== | ==Example== | ||
This example | This example toggles traffic lights between 'locked' and 'unlocked'. | ||
<syntaxhighlight lang="lua"> | |||
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 | |||
end | |||
end | |||
-- add command for toggling traffic lights | |||
addCommandHandler("toggletrafficlights",toggleTrafficLights) | |||
</syntaxhighlight> | |||
==See Also== | ==See Also== | ||
{{World_functions}} | {{World_functions}} | ||
[[ru:areTrafficLightsLocked]] | |||
[[ |
Latest revision as of 11:15, 16 August 2012
Gets whether the traffic lights are currently locked or not. If the lights are locked, it means they won't change unless you do setTrafficLightState.
Syntax
bool areTrafficLightsLocked ( )
Returns
Returns true the traffic lights are currently locked, false otherwise.
Example
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 end end -- add command for toggling traffic lights addCommandHandler("toggletrafficlights",toggleTrafficLights)
See Also
- areTrafficLightsLocked
- getAircraftMaxHeight
- getAircraftMaxVelocity
- getCloudsEnabled
- getFarClipDistance
- getFogDistance
- getGameSpeed
- getGravity
- getHeatHaze
- getInteriorSoundsEnabled
- getJetpackMaxHeight
- getMinuteDuration
- getMoonSize
- getOcclusionsEnabled
- getRainLevel
- getSunColor
- getSunSize
- getTime
- getTrafficLightState
- getWeather
- getWindVelocity
- getSkyGradient
- getPlayerBlurLevel
- getZoneName
- isGarageOpen
- removeWorldModel
- resetFarClipDistance
- resetFogDistance
- resetHeatHaze
- resetMoonSize
- resetRainLevel
- resetSkyGradient
- resetSunColor
- resetSunSize
- resetWindVelocity
- restoreAllWorldModels
- restoreWorldModel
- setAircraftMaxHeight
- setAircraftMaxVelocity
- setCloudsEnabled
- setFarClipDistance
- setFogDistance
- setGameSpeed
- setGarageOpen
- setGravity
- setHeatHaze
- setInteriorSoundsEnabled
- setMinuteDuration
- setMoonSize
- setOcclusionsEnabled
- setRainLevel
- setSkyGradient
- setSunColor
- setSunSize
- setTime
- setTrafficLightState
- setTrafficLightsLocked
- setWeather
- setWeatherBlended
- setWindVelocity
- setJetpackMaxHeight
- setPlayerBlurLevel