This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
YimMenu/docs/lua/tables/globals.md

163 lines
2.6 KiB
Markdown
Raw Normal View History

2023-07-02 00:59:02 +02:00
# Table: globals
Table containing functions for manipulating gta script globals.
## Functions (11)
2023-07-02 00:59:02 +02:00
### `get_int(global)`
Retrieves an int global value.
- **Parameters:**
- `global` (integer): index of the global
- **Returns:**
- `integer`: value of the global
**Example Usage:**
2023-07-02 00:59:02 +02:00
```lua
integer = globals.get_int(global)
```
### `get_uint(global)`
Retrieves an uint global value.
- **Parameters:**
- `global` (integer): index of the global
- **Returns:**
- `integer`: value of the global
**Example Usage:**
```lua
integer = globals.get_uint(global)
```
2023-07-02 00:59:02 +02:00
### `get_float(global)`
Retrieves a float global value.
- **Parameters:**
- `global` (integer): index of the global
- **Returns:**
- `float`: value of the global
**Example Usage:**
2023-07-02 00:59:02 +02:00
```lua
float = globals.get_float(global)
```
### `get_string(global)`
Retrieves a string global value.
- **Parameters:**
- `global` (integer): index of the global
- **Returns:**
- `string`: value of the global
**Example Usage:**
2023-07-02 00:59:02 +02:00
```lua
string = globals.get_string(global)
```
### `get_vec3(global)`
Retrieves a Vector3 global value.
- **Parameters:**
- `global` (integer): index of the global
- **Returns:**
- `Vector3`: value of the global
**Example Usage:**
```lua
Vector3 = globals.get_vec3(global)
```
2023-07-02 00:59:02 +02:00
### `set_int(global, val)`
Sets an int global value.
- **Parameters:**
- `global` (integer): index of the global
- `val` (integer): new value for the global
**Example Usage:**
2023-07-02 00:59:02 +02:00
```lua
globals.set_int(global, val)
```
### `set_uint(global, val)`
Sets an uint global value.
- **Parameters:**
- `global` (integer): index of the global
- `val` (integer): new value for the global
**Example Usage:**
```lua
globals.set_uint(global, val)
```
2023-07-02 00:59:02 +02:00
### `set_float(global, val)`
Sets a float global value.
- **Parameters:**
- `global` (integer): index of the global
- `val` (float): new value for the global
**Example Usage:**
2023-07-02 00:59:02 +02:00
```lua
globals.set_float(global, val)
```
### `set_string(global, str)`
Sets a string global value.
- **Parameters:**
- `global` (integer): index of the global
- `str` (string): new value for the global
**Example Usage:**
2023-07-02 00:59:02 +02:00
```lua
globals.set_string(global, str)
```
### `set_vec3(global, param)`
Sets a Vector3 global value.
- **Parameters:**
- `global` (integer): index of the global
- `param` (Vector3): new value for the global
**Example Usage:**
```lua
globals.set_vec3(global, param)
```
2023-07-02 00:59:02 +02:00
### `get_pointer(global)`
Retrieves a pointer global.
- **Parameters:**
- `global` (integer): index of the global
- **Returns:**
- `pointer`: value of the global
**Example Usage:**
2023-07-02 00:59:02 +02:00
```lua
pointer = globals.get_pointer(global)
```