View Issue Details

IDProjectCategoryView StatusLast Update
0009204New Feature Requests[All Projects] Generalpublic2017-06-18 20:56
ReporterXeniusAssigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Summary0009204: [Request] getTrafficLightState(object) and isTrafficLight(object)
Description

Example:
local obj = getElementByID("object:1")
if isElement(obj) and isTrafficLight(obj) then
outputChatBox("State: ".. getTrafficLightState(obj))
end

TagsNo tags attached.

Activities

lopezloo

2016-04-02 19:11

developer   ~~0024583

Last edited: 2016-04-02 19:14

View 2 revisions

Traffic light state is based on the object rotation. See https://wiki.mtasa.com/wiki/GetTrafficLightState

qaisjp

2016-05-20 19:19

administrator   ~~0024701

lopez, I believe this only applies to default lights.

AlexTMjugador

2016-05-30 22:57

viewer   ~~0024731

Last edited: 2016-05-30 22:58

View 2 revisions

I played in a map with custom traffic lights and they worked as intended, lighting their green, yellow and red lights accordingly based on rotation, like lopezloo said. There was no script involved in that, too. So I think he's right.

I didn't test it properly on the map editor though, but if custom traffic lights "magically" function automatically, it makes sense that they use the same rules as default ones.

Issue History

Date Modified Username Field Change