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
SprayerDoubledAmountEvent
DescriptionEvent for sprayer doubled amount stateParent
EventFunctions
emptyNew
DescriptionCreate instance of Event classDefinition
emptyNew()Return Values
table | self | instance of class event |
13 | function SprayerDoubledAmountEvent.emptyNew() |
14 | local self = Event.new(SprayerDoubledAmountEvent_mt) |
15 | return self |
16 | end |
new
DescriptionCreate new instance of eventDefinition
new(table object, integer isActive)Arguments
table | object | object |
integer | isActive | pipe state |
22 | function SprayerDoubledAmountEvent.new(object, isActive) |
23 | local self = SprayerDoubledAmountEvent.emptyNew() |
24 | self.object = object |
25 | self.isActive = isActive |
26 | |
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 SprayerDoubledAmountEvent:readStream(streamId, connection) |
35 | self.object = NetworkUtil.readNodeObject(streamId) |
36 | self.isActive = streamReadBool(streamId) |
37 | self:run(connection) |
38 | end |
run
DescriptionRun action on receiving sideDefinition
run(integer connection)Arguments
integer | connection | connection |
52 | function SprayerDoubledAmountEvent:run(connection) |
53 | if self.object ~= nil and self.object:getIsSynchronized() then |
54 | self.object:setSprayerDoubledAmountActive(self.isActive, true) |
55 | end |
56 | |
57 | if not connection:getIsServer() then |
58 | g_server:broadcastEvent(SprayerDoubledAmountEvent.new(self.object, self.isActive), nil, connection, self.object) |
59 | end |
60 | end |
sendEvent
DescriptionBroadcast event from server to all clients, if called on client call function on server and broadcast it to all clientsDefinition
sendEvent(table object, boolean isActive, boolean noEventSend)Arguments
table | object | object |
boolean | isActive | is active |
boolean | noEventSend | no event send |
67 | function SprayerDoubledAmountEvent.sendEvent(vehicle, isActive, noEventSend) |
68 | if noEventSend == nil or noEventSend == false then |
69 | if g_server ~= nil then |
70 | g_server:broadcastEvent(SprayerDoubledAmountEvent.new(vehicle, isActive), nil, nil, vehicle) |
71 | else |
72 | g_client:getServerConnection():sendEvent(SprayerDoubledAmountEvent.new(vehicle, isActive)) |
73 | end |
74 | end |
75 | end |
writeStream
DescriptionCalled on server side on joinDefinition
writeStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
44 | function SprayerDoubledAmountEvent:writeStream(streamId, connection) |
45 | NetworkUtil.writeNodeObject(streamId, self.object) |
46 | streamWriteBool(streamId, self.isActive) |
47 | end |