Types: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 61: | Line 61: | ||
* <code>Surface</code> - Anything that is drawable (<code>RenderTarget</code>, <code>Texture</code>) | * <code>Surface</code> - Anything that is drawable (<code>RenderTarget</code>, <code>Texture</code>) | ||
==Scripting-Language Types== | |||
These scripting-language types are used in the scripting interface. | |||
Scalar types. | |||
* <code>bool</code> - Also known as <code>boolean</code>. | |||
* <code>float</code> - <code>Number</code> if the scripting language only uses 1 numerical type for ints and floats. | |||
* <code>function</code> - For callbacks. | |||
* <code>int</code> - <code>Number</code> if the scripting language only uses 1 numerical type for ints and floats. | |||
* <code>object</code> - For elements. <code>Userdata</code> if Lua. | |||
* <code>null</code> - Also known as <code>nil</code>. | |||
* <code>string</code> | |||
Container types. | |||
* <code>array<Type></code> - <code>Table</code> if Lua. Keys start at 1 if Lua, otherwise keys start at 0. | |||
* <code>dictionary<KeyType,ValueType></code> - <code>Table</code> if Lua. | |||
==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 20:42, 5 October 2021
This page hosts a list of used data types for scripting.
Types
These types are used in Scripting.
A Shared
type means that the type is available to be used on both the server and the client in scripting.
Shared
Client
- client representationClient
Effect
- effect (FX)Shared
Element
- elementShared
Transformable
- (2D / 3D) positionable elementShared
Blip
- blipShared
Entity
- entityShared
Building
- building (GTA Building)Shared
Physical
- object that interacts with physicsShared
Object
- placeable objectShared
Ped
- pedestrianShared
Player
- player
Shared
Vehicle
- any vehicleShared
Train
- train
Shared
Marker
- markerShared
Pickup
- pickup
Shared
Event
- eventShared
CancellableEvent
- cancellable eventShared
KeyEvent
- key vent
Client
Font
- fontClient
GUIElement
- gui elementClient
GUIHtmlElement
- gui html elementClient
GUIHtmlView
- gui html viewClient
GUIPage
- gui pageClient
GUIWindow
- gui windowShared
Matrix4x4
- matrix of 4 by 4 numbersShared
ReflectedFunction
- reflected functionShared
Resource
- resourceClient
Sound
Shared
Stream
Client
Surface
Client
RenderTarget
- client representation - derives fromSurface
Client
Texture
- texture - derives fromSurface
Shared
Timer
- timerShared
Vec2
- vector of 2 numbersShared
Vec3
- vector of 3 numbersShared
XmlDocument
- xml documentShared
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 asboolean
.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.object
- For elements.Userdata
if Lua.null
- Also known asnil
.string
Container types.
array<Type>
-Table
if Lua. Keys start at 1 if Lua, otherwise keys start at 0.dictionary<KeyType,ValueType>
-Table
if Lua.
Previous Versions
Type Civilian
was removed. All functionality from type Civilian
was moved to type Ped
.