Lua: refactor script api, more doc, add button for Open Lua Scripts Folder (#1588)
* lua manager: pass down the scripts folder to the instance instead of hard coding calls to the file manager everywhere * lua: add open lua scripts folder button * lua api: change script binding so that user cannot by mistake try to sleep or yield in a non script context
This commit is contained in:
28
docs/lua/classes/script_util.md
Normal file
28
docs/lua/classes/script_util.md
Normal file
@ -0,0 +1,28 @@
|
||||
# Class: script_util
|
||||
|
||||
Class for gta script utils, the instance is usually given to you.
|
||||
|
||||
## Functions (2)
|
||||
|
||||
### `yield()`
|
||||
|
||||
Yield execution.
|
||||
|
||||
**Exemple Usage:**
|
||||
```lua
|
||||
script_util:yield()
|
||||
```
|
||||
|
||||
### `sleep(ms)`
|
||||
|
||||
Sleep for the given amount of time, time is in milliseconds.
|
||||
|
||||
- **Parameters:**
|
||||
- `ms` (integer): The amount of time in milliseconds that we will sleep for.
|
||||
|
||||
**Exemple Usage:**
|
||||
```lua
|
||||
script_util:sleep(ms)
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user