CreateObject: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
Line 13: Line 13:
===Optional Arguments===  
===Optional Arguments===  
{{OptionalArg}}  
{{OptionalArg}}  
*'''rx:''' explaination Specifies the created objects X rotation
*'''rx:''' A Float value that specifies the created objects X rotation
*'''ry:''' explaination Specifies the created objects Y rotation
*'''ry:''' A Float value that specifies the created objects Y rotation
*'''rz:''' explaination Specifies the created objects Z rotation
*'''rz:''' A Float value that specifies the created objects Z rotation


==Example==  
==Example==  

Revision as of 05:38, 18 May 2006

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: A Whole integer specifying the GTASA object model ID
  • X: A Float value that specifies the X coordinate to spawn the object in the GTASA world
  • Y: A Float value Specifies the Y coordinate to spawn the object in the GTASA world
  • Z: A Float value 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: A Float value that specifies the created objects X rotation
  • ry: A Float value that specifies the created objects Y rotation
  • rz: A Float value that 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