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
VehicleSetLightEvent
DescriptionEvent for light stateParent
EventFunctions
emptyNew
DescriptionCreate instance of Event classDefinition
emptyNew()Return Values
table | self | instance of class event |
13 | function VehicleSetLightEvent.emptyNew() |
14 | local self = Event.new(VehicleSetLightEvent_mt) |
15 | return self |
16 | end |
new
DescriptionCreate new instance of eventDefinition
new(table object, integer lightsTypesMask)Arguments
table | object | object |
integer | lightsTypesMask | light types mask |
22 | function VehicleSetLightEvent.new(object, lightsTypesMask, numBits) |
23 | local self = VehicleSetLightEvent.emptyNew() |
24 | self.object = object |
25 | self.lightsTypesMask = lightsTypesMask |
26 | self.numBits = numBits |
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 VehicleSetLightEvent:readStream(streamId, connection) |
35 | self.object = NetworkUtil.readNodeObject(streamId) |
36 | self.numBits = streamReadUIntN(streamId, 5) |
37 | self.lightsTypesMask = streamReadUIntN(streamId, self.numBits) |
38 | self:run(connection) |
39 | end |
run
DescriptionRun action on receiving sideDefinition
run(integer connection)Arguments
integer | connection | connection |
54 | function VehicleSetLightEvent:run(connection) |
55 | if self.object ~= nil and self.object:getIsSynchronized() then |
56 | self.object:setLightsTypesMask(self.lightsTypesMask, true, true) |
57 | end |
58 | |
59 | if not connection:getIsServer() then |
60 | g_server:broadcastEvent(VehicleSetLightEvent.new(self.object, self.lightsTypesMask, self.numBits), nil, connection, self.object) |
61 | end |
62 | end |
writeStream
DescriptionCalled on server side on joinDefinition
writeStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
45 | function VehicleSetLightEvent:writeStream(streamId, connection) |
46 | NetworkUtil.writeNodeObject(streamId, self.object) |
47 | streamWriteUIntN(streamId, self.numBits, 5) |
48 | streamWriteUIntN(streamId, self.lightsTypesMask, self.numBits) |
49 | end |