IsObjectMoving

From Multi Theft Auto: Wiki
Revision as of 22:33, 21 January 2021 by Cleopatradev (talk | contribs) (Removed redirect to IsElementMoving)
Jump to navigation Jump to search

This function checks if the object is movings.

Syntax

bool isObjectMoving ( object theObject )

Required Arguments

Returns

  • true if the object is moving.
  • false if the object is not moving.

Example

This example creates an object when the resource starts and checks if the object is moving.

addEventHandler("onClientResourceStart", resourceRoot,
    function()
        local x, y, z = getElementPosition(localPlayer)
        object = createObject(1239, x, y, z)

        moveObject(object, 5000, x, y, z + 5)
    end
)

addCommandHandler("getmoving",
    function(cmd)
        outputChatBox("Is object "..(isObjectMoving(object) and "moving" or "not moving"))
    end
)

Requirements

Minimum server version n/a
Minimum client version 1.5.8-9.20811

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version client="1.5.8-9.20811" />

See Also