GetElementSyncer

From Multi Theft Auto: Wiki
Revision as of 11:29, 23 April 2009 by Trjack (talk | contribs) (→‎Example)
Jump to navigation Jump to search

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 )

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 is not being synced.

Example

Click to collapse [-]
Server

This code will kill the syncer of the first ped created with createPed

local elementSyncer = getElementSyncer(getElementsByType("ped")[1])
if getElementType(elementSyncer) == "player" then
    killPed(elementSyncer,elementSyncer)
end

See Also