AddElementDataSubscriber: Difference between revisions
Jump to navigation
Jump to search
m (→See Also) |
Fernando187 (talk | contribs) (Remove obsolete Requirements section) |
||
Line 32: | Line 32: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | </section> | ||
==See Also== | ==See Also== | ||
{{Element_functions|server}} | {{Element_functions|server}} |
Latest revision as of 17:19, 7 November 2024
This function subscribes a player to specific element data. This function is used together with setElementData in "subscribe" mode.
Syntax
bool addElementDataSubscriber ( element theElement, string key, player thePlayer )
OOP Syntax Help! I don't understand this!
- Method: element:addDataSubscriber(...)
- Counterpart: removeElementDataSubscriber
Required Arguments
- theElement: The element you wish to subscribe the player to.
- key: The key you wish to subscribe the player to.
- thePlayer: The player you wish to subscribe.
Returns
Returns true if the player was subscribed, false otherwise.
Example
Click to collapse [-]
ServeraddEventHandler("onVehicleEnter", getRootElement(), function(thePlayer, seat) if seat==0 then -- if the player is a driver addElementDataSubscriber(source, "id", thePlayer) -- subscribe the player to element end end)
See Also
- addElementDataSubscriber
- clearElementVisibleTo
- cloneElement
- getElementSyncer
- getElementZoneName
- hasElementDataSubscriber
- isElementVisibleTo
- removeElementData
- removeElementDataSubscriber
- setElementSyncer
- setElementVisibleTo
- Shared
- attachElements
- createElement
- destroyElement
- detachElements
- getAttachedElements
- getElementAlpha
- getElementAttachedOffsets
- getElementAttachedTo
- getElementByIndex
- getElementByID
- getElementChild
- getElementChildren
- getElementChildrenCount
- getElementCollisionsEnabled
- getElementColShape
- getElementData
- getAllElementData
- hasElementData
- getElementDimension
- getElementHealth
- getElementID
- getElementInterior
- getElementMatrix
- getElementModel
- getElementParent
- getElementPosition
- getElementRotation
- getElementsByType
- getElementsWithinColShape
- getElementsWithinRange
- getElementType
- getElementVelocity
- getLowLODElement
- getRootElement
- isElement
- isElementAttached
- isElementCallPropagationEnabled
- isElementDoubleSided
- isElementFrozen
- isElementInWater
- isElementLowLOD
- isElementWithinColShape
- isElementWithinMarker
- setElementAlpha
- setElementAngularVelocity
- getElementAngularVelocity
- setElementAttachedOffsets
- setElementCallPropagationEnabled
- setElementCollisionsEnabled
- setElementData
- setElementDimension
- setElementDoubleSided
- setElementFrozen
- setElementHealth
- setElementID
- setElementInterior
- setElementModel
- setElementParent
- setElementPosition
- setElementRotation
- setElementVelocity
- setLowLODElement
- getPedContactElement
- getResourceDynamicElementRoot
- getResourceRootElement