GetElementSyncer: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 17: Line 17:
<section name="Server" class="server" show="true">
<section name="Server" class="server" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
-- TODO
local elementSyncer = getElementSyncer(getElementsByType("ped")[1])
if getElementType(elementSyncer) == "player" then
    killPed(elementSyncer,elementSyncer)
end
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>

Revision as of 11:28, 23 April 2009

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
local elementSyncer = getElementSyncer(getElementsByType("ped")[1])
if getElementType(elementSyncer) == "player" then
    killPed(elementSyncer,elementSyncer)
end

See Also