setTrafficLightsLocked | Multi Theft Auto: Wiki Skip to content

setTrafficLightsLocked

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

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

setTrafficLightsLocked ( )

Code Examples

server

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
end
end
-- add command handler for command which toggles lights
addCommandHandler("toggletrafficlights",toggleTrafficLights)

See Also

World Functions