MTA:Eir/functions/createBuilding

From Multi Theft Auto: Wiki
Revision as of 20:10, 12 December 2013 by The GTA (talk | contribs)
Jump to navigation Jump to search

This function creates a building. A building is a special type of object that does not have physical properties itself. It is lightweight rendering and collidable instance on the GTA:SA world. As opposed to Objects, buildings to do stream. They can have an infinite drawing distance.

This function is part of the discussion: shall buildings be made MTA entities?

Syntax

building createBuilding ( int model, float x, float y, float z )

Arguments

  • model: the atomic model info index to use with this model
  • x, y, z: position vector on the GTA:SA world

Returns

Returns a building instance if successfully created, false otherwise.

Example

Click to collapse [-]
Client

This snippet creates a random building instance and warps the local player to it.

local myBuilding = createBuilding( 3376, 0, 0, 10 );
setElementPosition( localPlayer, 0, 0, 12 );