GetObjectRotation: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 40: Line 40:
</section>
</section>
<section name="Client" class="client">
<section name="Client" class="client">
<syntaxhighlight lang="lua">
function onPlayerTargeted ( element )
function onPlayerTargeted ( element )
     if ( isElement(element) and getElementType ( element ) == "object") then
     if ( isElement(element) and getElementType ( element ) == "object") then
Line 47: Line 48:
end
end
addEventHandler ( "onClientPlayerTarget", getRootElement(), onPlayerTargeted )
addEventHandler ( "onClientPlayerTarget", getRootElement(), onPlayerTargeted )
</syntaxhighlight>
</section>
</section>


==See Also==
==See Also==
{{Object functions}}
{{Object functions}}

Revision as of 12:41, 3 August 2007

Object rotation can be retrieved from objects in mapfiles or objects that are created in scripts.

Syntax

Click to expand [+]
Server
Click to expand [+]
Client

Example

If a player points at an object with a gun, it will output it's rotation to the player.

Click to expand [+]
Server
Click to expand [+]
Client

See Also