Types: Difference between revisions

From GTA Connected
Jump to navigation Jump to search
No edit summary
No edit summary
Line 73: Line 73:
* <code>object</code> - For elements. <code>Userdata</code> if Lua.
* <code>object</code> - For elements. <code>Userdata</code> if Lua.
* <code>string</code>
* <code>string</code>
* <code>undefined</code> - Used in JS.


Container types.
Container types.
* <code>array&lt;Type&gt;</code> - <code>Table</code> if Lua. Keys start at 1 if Lua, otherwise keys start at 0.
* <code>array&lt;Type&gt;</code> - <code>Table</code> if Lua. Keys start at 1 if Lua, otherwise keys start at 0.
* <code>dictionary&lt;KeyType,ValueType&gt;</code> - <code>Table</code> if Lua.
* <code>dictionary&lt;KeyType,ValueType&gt;</code> - <code>Table</code> if Lua.
Other types.
* <code>void</code> - Represents no arguments or returns.


==Previous Versions==
==Previous Versions==


Type <code>Civilian</code> was removed. All functionality from type <code>Civilian</code>was moved to type <code>Ped</code>.
Type <code>Civilian</code> was removed. All functionality from type <code>Civilian</code>was moved to type <code>Ped</code>.

Revision as of 16:03, 10 October 2021

This page hosts a list of used data types for scripting.

Types

These types are used in Scripting.
A Sharedtype means that the type is available to be used on both the server and the client in scripting.

  • Shared Client - client representation
  • Client Effect - effect (FX)
  • Shared Element - element
    • Shared Transformable - (2D / 3D) positionable element
      • Shared Blip - blip
      • Shared Entity - entity
        • Shared Building - building (GTA Building)
        • Shared Physical - object that interacts with physics
          • Shared Object - placeable object
          • Shared Ped - pedestrian
            • Shared Player - player
          • Shared Vehicle - any vehicle
            • Shared Train - train
      • Shared Marker - marker
      • Shared Pickup - pickup
  • Shared Event - event
    • Shared CancellableEvent - cancellable event
    • Shared KeyEvent - key vent
  • Client Font - font
  • Client GUIElement - gui element
  • Client GUIHtmlElement - gui html element
  • Client GUIHtmlView - gui html view
  • Client GUIPage - gui page
  • Client GUIWindow - gui window
  • Shared Matrix4x4 - matrix of 4 by 4 numbers
  • Shared ReflectedFunction - reflected function
  • Shared Resource - resource
  • Client Sound
  • Shared Stream
  • Client Surface
    • Client RenderTarget - client representation - derives from Surface
    • Client Texture - texture - derives from Surface
  • Shared Timer - timer
  • Shared Vec2 - vector of 2 numbers
  • Shared Vec3 - vector of 3 numbers
  • Shared XmlDocument - xml document
  • Shared XmlElement - xml element

Types Derived From Element

Types derived from type Element, as shown in the list above.

Blip : Transformable : Element
Building : Entity : Transformable : Element
Marker : Transformable : Element
Object : Physical : Entity : Transformable : Element
Pickup : Transformable : Element
Player : Ped : Physical : Entity : Transformable : Element
Train : Vehicle : Physical : Entity : Transformable : Element

Abstract Base Types

These types aren't used directly in Scripting. They just represent abstract types used behind the scenes.

  • Surface - Anything that is drawable (RenderTarget, Texture)

Scripting-Language Types

These scripting-language types are used in the scripting interface.

Scalar types.

  • bool - Also known as boolean.
  • float - Number if the scripting language only uses 1 numerical type for ints and floats.
  • function - For callbacks.
  • int - Number if the scripting language only uses 1 numerical type for ints and floats.
  • null - Also known as nil.
  • object - For elements. Userdata if Lua.
  • string
  • undefined - Used in JS.

Container types.

  • array<Type> - Table if Lua. Keys start at 1 if Lua, otherwise keys start at 0.
  • dictionary<KeyType,ValueType> - Table if Lua.

Other types.

  • void - Represents no arguments or returns.

Previous Versions

Type Civilian was removed. All functionality from type Civilianwas moved to type Ped.