CreateObject

From Multi Theft Auto: Wiki
Revision as of 05:37, 18 May 2006 by Ransom (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Creates any GTASA world object at a specified location using x,y,z. The object rotation can also be set with the optional arguments rx, ry, rz.

Syntax

createObject ( id, x, y, z, [rx, ry, rz] )

Required Arguments

  • ID: An integer specifying the GTASA object model ID
  • X: Specifies the X coordinate to spawn the object in the GTASA world
  • Y: Specifies the Y coordinate to spawn the object in the GTASA world
  • Z: Specifies the Z coordinate to spawn the object in the GTASA world

Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • rx: explaination Specifies the created objects X rotation
  • ry: explaination Specifies the created objects Y rotation
  • rz: explaination Specifies the created objects Z rotation

Example

Explain what the example does here

root = getRootElement ()
addEventHandler ( "onMapLoad", root, "onMapLoad" )
function onMapLoad ( name, root )
createObject ( 5540.6654, 1020.55122, 1240.545, 15, 10, 4.4, 6.2] )
end