mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 22:21:48 +00:00
use same params and types format for all of lib
This commit is contained in:
1 parent
e3293c2109
commit
6c2ab8f8ec
14 files changed
+114
-67
No files matched your search
@@ -3,11 +3,14 @@ Triggers a registered server callback and registers an event handler for the res
|
||||
### lib.callback
|
||||
The response is handled in a separate coroutine.
|
||||
```lua
|
||||
-- name: string
|
||||
-- delay: number or false
|
||||
-- cb: function
|
||||
lib.callback(name, delay, cb, ...)
|
||||
```
|
||||
* name: `string`
|
||||
* delay: `number` or `false`
|
||||
* cb: `function`
|
||||
* ...: `any`
|
||||
|
||||
```lua
|
||||
lib.callback('ox_inventory:getItemCount', false, function(count)
|
||||
print(count)
|
||||
end, 'water', {type = 'fresh'})
|
||||
@@ -16,10 +19,13 @@ end, 'water', {type = 'fresh'})
|
||||
### lib.callback.await
|
||||
The current coroutine is yielded until a response is received.
|
||||
```lua
|
||||
-- name: string
|
||||
-- delay: number or false
|
||||
lib.callback.await(name, delay, ...)
|
||||
```
|
||||
* name: `string`
|
||||
* delay: `number` or `false`
|
||||
* ...: `any`
|
||||
|
||||
```lua
|
||||
local count = lib.callback.await('ox_inventory:getItemCount', false, 'water', {type = 'fresh'})
|
||||
print(count)
|
||||
```
|
||||
Reference in new issue
Block a user