EntityClient

setEntityTrafficlightOverride

SET_ENTITY_TRAFFICLIGHT_OVERRIDE0x57C5DB656185EAC4

The GTA V native SET_ENTITY_TRAFFICLIGHT_OVERRIDE of the ENTITY namespace, as LS:MP client scripts call it: the global function setEntityTrafficlightOverride, in JavaScript and in Lua.

SignatureJavaScript
setEntityTrafficlightOverride(entity: Entity, state: number): void
SignatureLua
setEntityTrafficlightOverride(entity: Entity, state: integer)

Usage

JavaScript
setEntityTrafficlightOverride(entity, state);
Lua
setEntityTrafficlightOverride(entity, state)

Parameters

ParameterTypeJavaScriptLua
entityEntitynumberinteger
stateintnumberinteger

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Example here: https://gtaforums.com/topic/830463-help-with-turning-lights-green-and-causing-peds-to-crash-into-each-other/#entry1068211340

0 = green
1 = red
2 = yellow
3 = reset changes
changing lights may not change the behavior of vehicles

Reference

Namespace
Entity ENTITY
In the game
void SET_ENTITY_TRAFFICLIGHT_OVERRIDE(Entity entity, int state)
Hash
0x57C5DB656185EAC4

Open in the interactive natives reference