Added packed stats handler to the stats Lua class. (#2460)

This commit is contained in:
gir489
2023-11-29 17:15:10 -05:00
committed by GitHub
parent 2a81e3eeef
commit 847a729918
2 changed files with 101 additions and 11 deletions

View File

@ -297,4 +297,50 @@ boolean = stats.set_masked_int(stat_hash, new_value, bit_start, bit_size)
boolean = stats.set_masked_int(stat_name, new_value, bit_start, bit_size)
```
### `get_packed_stat_bool(index)`
- **Parameters:**
- `index` (int): packed stat's index.
- **Returns:**
- `boolean`: Value of the stat.
**Example Usage:**
```lua
local pstat_value = stats.get_packed_stat_bool(index)
```
### `set_packed_stat_bool(index, value)`
- **Parameters:**
- `index` (int): packed stat's index.
- `value` (bool): value to set the packed stat to.
**Example Usage:**
```lua
stats.set_packed_stat_bool(index, value)
```
### `get_packed_stat_int(index)`
- **Parameters:**
- `index` (int): packed stat's index
- **Returns:**
- `int`: Value of the stat.
**Example Usage:**
```lua
local pstat_value = stats.get_packed_stat_int(index)
```
### `set_packed_stat_int(index, value)`
- **Parameters:**
- `index` (int): packed stat's index.
- `value` (int): value to set the packed stat to.
**Example Usage:**
```lua
stats.set_packed_stat_int(index, value)
```