DE/CreateObject

From Multi Theft Auto: Wiki
Revision as of 15:55, 5 May 2012 by Deadmen (talk | contribs) (Created page with "__NOTOC__ {{Server client function}} Erstellt ein Objekt in GTA ==Syntax== <syntaxhighlight lang="lua">object createObject ( int modelid, float x, float y, float z, [ float rx, float ry, fl...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Erstellt ein Objekt in GTA

Syntax

object createObject ( int modelid, float x, float y, float z, [ float rx, float ry, float rz, bool isLowLOD = false ] )

Benötigte Parameter

  • modelid: A whole integer specifying the GTASA object model ID.
  • x: Eine Fließkommadarstellungen, welche die X Koordinate in der Karte darstellt.
  • y: Eine Fließkommadarstellungen, welche die Y Koordinate in der Karte darstellt.
  • z: Eine Fließkommadarstellungen, welche die Z Koordinate in der Karte darstellt.

Optionale Parameter

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: Eine Fließkommadarstellungen, welche die Rotation and der X Axe darstellt.
  • ry: Eine Fließkommadarstellungen, welche die Rotation and der Y Axe darstellt.
  • rz: Eine Fließkommadarstellungen, welche die Rotation and der Z Axe darstellt.
  • isLowLOD: Ein Boolean, welches bestimt, ob das Objekt ein low LOD Objekt ist. Ein low LOD Objekt hat keine Kollision und wird auf längere Distanz dargestellt.

Returns

Gibt das objekt Element zurück, falls es erfolgreich erstellt wurde, ansonsten den Boolean false

Beispiel

Click to collapse [-]
Server

Dieses Beispiel erstellt beim Start einer Resource ein Objekt:

function mapLoad ( name )
   -- erstellt ein Objekt mit den angegebenen Koordinaten und Rotationen
   createObject ( 1337, 5540.6654, 1020.55122, 1240.545, 90, 0, 0 )
end
addEventHandler ( "onResourceStart", getRootElement(), mapLoad )

Ähnliches

Shared