OnElementStartSync: Difference between revisions
Jump to navigation
Jump to search
m (→Parameters) |
m (→Parameters) |
||
Line 8: | Line 8: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
*'''newSyncer''': [[player]] element representing the player who is now syncing the element. | *'''newSyncer''': a [[player]] element representing the player who is now syncing the [[element]]. | ||
==Source== | ==Source== |
Revision as of 22:05, 2 April 2018
This event is triggered when an element becomes synced by a player.
Parameters
player newSyncer
Source
The source of this event is the element that got synced by a player.
Example
When an element receives a new syncer, this example matches the model of the element to the player.
function elementStartSync( newSyncer ) local strElementType = getElementType( source ) local playerVehicle = getPedOccupiedVehicle( newSyncer ) if ( strElementType == 'vehicle' ) then if ( not playerVehicle ) then return false end setElementModel( source, getElementModel(playerVehicle) ) elseif ( strElementType == 'ped' ) then setElementModel( source, getElementModel(newSyncer) ) end end addEventHandler ('onElementStartSync', root, elementStartSync)
See Also
Element events
- onElementClicked
- onElementColShapeHit
- onElementColShapeLeave
- onElementDataChange
- onElementDestroy
- onElementDimensionChange
- onElementInteriorChange
- onElementModelChange
- onElementStartSync
- onElementStopSync
Event functions
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled