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
WearableRepairEvent
DescriptionEvent for repairingParent
EventFunctions
emptyNew
DescriptionCreate instance of Event classDefinition
emptyNew()Return Values
table | self | instance of class event |
13 | function WearableRepairEvent.emptyNew() |
14 | return Event.new(WearableRepairEvent_mt) |
15 | end |
new
DescriptionCreate new instance of eventDefinition
new(table vehicle)Arguments
table | vehicle | vehicle |
20 | function WearableRepairEvent.new(vehicle, atSellingPoint) |
21 | local self = WearableRepairEvent.emptyNew() |
22 | self.vehicle = vehicle |
23 | self.atSellingPoint = atSellingPoint |
24 | return self |
25 | end |
readStream
DescriptionCalled on client side on joinDefinition
readStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
31 | function WearableRepairEvent:readStream(streamId, connection) |
32 | self.vehicle = NetworkUtil.readNodeObject(streamId) |
33 | self.atSellingPoint = streamReadBool(streamId) |
34 | self:run(connection) |
35 | end |
run
DescriptionRun action on receiving sideDefinition
run(integer connection)Arguments
integer | connection | connection |
49 | function WearableRepairEvent:run(connection) |
50 | if not connection:getIsServer() then |
51 | if self.vehicle ~= nil and self.vehicle:getIsSynchronized() then |
52 | if self.vehicle.repairVehicle ~= nil then |
53 | self.vehicle:repairVehicle(self.atSellingPoint) |
54 | |
55 | g_server:broadcastEvent(self) -- broadcast for UI updates |
56 | g_messageCenter:publish(MessageType.VEHICLE_REPAIRED, self.vehicle, self.atSellingPoint) |
57 | end |
58 | end |
59 | else |
60 | g_messageCenter:publish(MessageType.VEHICLE_REPAIRED, self.vehicle, self.atSellingPoint) |
61 | end |
62 | end |
writeStream
DescriptionCalled on server side on joinDefinition
writeStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
41 | function WearableRepairEvent:writeStream(streamId, connection) |
42 | NetworkUtil.writeNodeObject(streamId, self.vehicle) |
43 | streamWriteBool(streamId, self.atSellingPoint) |
44 | end |