GetElementSyncer
From Multi Theft Auto: Wiki
This function gets the syncer of an element. The syncer is the player who is in control of the element.
Syntax
element getElementSyncer ( element theElement )
OOP Syntax Help! I don't understand this!
- Method: element:getSyncer(...)
- Variable: .syncer
- Counterpart: setElementSyncer
Required Arguments
- theElement: The element to get the syncer of.
Returns
Returns the element that is the syncer of theElement or false if the element does not have a syncer.
Example
This code will kill the syncer of the first ped created with createPed.
local elementSyncer = getElementSyncer(getElementsByType("ped")[1]) if elementSyncer and getElementType(elementSyncer) == "player" then --Check if its a player and if there is a syncer killPed(elementSyncer, elementSyncer) end
This code will kill the syncer of the ped created with createPed.
function test(player,commandName) local idlewoodPed = createPed(26,1813.27,-1897.04,13.577) local elementSyncer = getElementSyncer(idlewoodPed) if elementSyncer and getElementType(elementSyncer) == "player" then --Check if its a player and if there is a syncer killPed(elementSyncer, elementSyncer) end end addCommandHandler("test", test)
See Also
- attachElements
- clearElementVisibleTo
- cloneElement
- createElement
- destroyElement
- detachElements
- getAllElementData
- getAttachedElements
- getElementAlpha
- getElementAttachedOffsets
- getElementAttachedTo
- getElementCollisionsEnabled
- getElementByID
- getElementByIndex
- getElementChild
- getElementChildren
- getElementChildrenCount
- getElementColShape
- getElementData
- getElementDimension
- getElementHealth
- getElementID
- getElementInterior
- getElementMatrix
- getElementModel
- getElementParent
- getElementPosition
- getElementRotation
- getElementSyncer
- getElementType
- getElementVelocity
- getElementZoneName
- getElementsByType
- getElementsWithinColShape
- getLowLODElement
- getRootElement
- isElement
- isElementAttached
- isElementCallPropagationEnabled
- isElementDoubleSided
- isElementFrozen
- isElementInWater
- isElementLowLOD
- isElementVisibleTo
- isElementWithinColShape
- isElementWithinMarker
- removeElementData
- setElementAlpha
- setElementAngularVelocity
- getElementAngularVelocity
- setElementAttachedOffsets
- setElementCallPropagationEnabled
- setElementCollisionsEnabled
- setElementData
- setElementDimension
- setElementDoubleSided
- setElementFrozen
- setElementHealth
- setElementID
- setElementInterior
- setElementModel
- setElementParent
- setElementPosition
- setElementRotation
- setElementSyncer
- setElementVelocity
- setElementVisibleTo
- setLowLODElement