GetObjectRotation: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 33: Line 33:
function onPlayerTargeted ( element )
function onPlayerTargeted ( element )
     if ( isElement(element) and getElementType ( element ) == "object") then
     if ( isElement(element) and getElementType ( element ) == "object") then
local x,y,z = getObjectRotation(element)
        local x,y,z = getObjectRotation(element)
         outputChatBox("Object rotation: "..x.." "..y.." "..z,source)
         outputChatBox("Object rotation: "..x.." "..y.." "..z,source)
     end
     end
Line 44: Line 44:
function onPlayerTargeted ( element )
function onPlayerTargeted ( element )
     if ( isElement(element) and getElementType ( element ) == "object") then
     if ( isElement(element) and getElementType ( element ) == "object") then
local x,y,z = getObjectRotation(element)
        local x,y,z = getObjectRotation(element)
         outputChatBox("Object rotation: "..x.." "..y.." "..z,source)
         outputChatBox("Object rotation: "..x.." "..y.." "..z,source)
     end
     end

Revision as of 13:39, 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

Shared