Script v1_7_1_0
- AI
- Animals
- Collections
- Contracts
- Debug
- Economy
- Elements
- EnvironmentalScore
- Errors
- Events
- GUI
- Handtools
- Hud
- I3d
- Input
- Jobs
- Maps
- Materials
- Misc
- Objects
- Parameters
- Placeables
- Placement
- Player
- Shop
- Sounds
- Specialization
- Specializations
- StateMachine
- Statistics
- Tasks
- Triggers
- Utils
- Vehicles
Engine v1_7_1_0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- general
- General
- I3D
- Input
- Lighting
- Math
- Network
- Node
- NoteNode
- Overlays
- Particle System
- Physics
- Rendering
- getMaterialCustomShaderFilename
- getMaterialCustomShaderVariation
- getMaterialDiffuseMapFilename
- getMaterialDiffuseMapHasAlpha
- getMaterialEmissiveMapFilename
- getMaterialEmissiveMapHasAlpha
- getMaterialGlossMapFilename
- getMaterialHasRefractionMap
- getMaterialIsAlphaBlended
- getMaterialIsAlphaTested
- getMaterialNormalMapFilename
- getMaterialNormalMapFormat
- getMaterialReflectionMapScaling
- setMaterialCustomMapFromFile
- setMaterialCustomShaderVariation
- setMaterialDiffuseMapFromFile
- setMaterialGlossMapFromFile
- setMaterialNormalMapFromFile
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- VoiceChat
- XML
Foundation Reference
VehicleSetTurnLightEvent
DescriptionEvent for turn light stateParent
EventFunctions
emptyNew
DescriptionCreate instance of Event classDefinition
emptyNew()Return Values
table | self | instance of class event |
13 | function VehicleSetTurnLightEvent.emptyNew() |
14 | local self = Event.new(VehicleSetTurnLightEvent_mt) |
15 | return self |
16 | end |
new
DescriptionCreate new instance of eventDefinition
new(table object, integer state)Arguments
table | object | object |
integer | state | state |
22 | function VehicleSetTurnLightEvent.new(object, state) |
23 | local self = VehicleSetTurnLightEvent.emptyNew() |
24 | self.object = object |
25 | self.state = state |
26 | assert(state >= 0 and state <= Lights.TURNLIGHT_HAZARD) |
27 | return self |
28 | end |
readStream
DescriptionCalled on client side on joinDefinition
readStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
34 | function VehicleSetTurnLightEvent:readStream(streamId, connection) |
35 | self.object = NetworkUtil.readNodeObject(streamId) |
36 | self.state = streamReadUIntN(streamId, Lights.turnLightSendNumBits) |
37 | self:run(connection) |
38 | end |
run
DescriptionRun action on receiving sideDefinition
run(integer connection)Arguments
integer | connection | connection |
52 | function VehicleSetTurnLightEvent:run(connection) |
53 | if self.object ~= nil and self.object:getIsSynchronized() then |
54 | self.object:setTurnLightState(self.state, true, true) |
55 | end |
56 | |
57 | if not connection:getIsServer() then |
58 | g_server:broadcastEvent(VehicleSetTurnLightEvent.new(self.object, self.state), nil, connection, self.object) |
59 | end |
60 | end |
writeStream
DescriptionCalled on server side on joinDefinition
writeStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
44 | function VehicleSetTurnLightEvent:writeStream(streamId, connection) |
45 | NetworkUtil.writeNodeObject(streamId, self.object) |
46 | streamWriteUIntN(streamId, self.state, Lights.turnLightSendNumBits) |
47 | end |