This commit is contained in:
Luke committed 2023-06-04 15:15:21 +02:00
1 parent 3cebaf7fa5
commit b5eba8423f
229 files changed
+6238 -10690

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
---
title: Callbacks
---
### ox:getStatus
```lua
lib.callback.await('ox:getStatus', delay, targetId, statusName)
```
- delay: `number`
- targetId: `number`
- The server id for the player to get statuses for.
- statusName?: `string`
- The name of the status (i.e. hunger). Can be omitted to return all statuses.
### ox:getLicense
```lua
lib.callback.await('ox:getLicense', delay, licenseName, targetId)
```
- delay: `number`
- licenseName: `string`
- The name of the license to get data for. Can be omitted to return all licenses.
- targetId?: `number`
- The server id to get license data for, defaulting to the current player.
### ox:getNearbyVehicles
```lua
lib.callback.register('ox:getNearbyVehicles', function(radius)
```
Returns an array of vehicle netids within a given radius of the player's location.
- radius?: `number`
- The radius from the player's location to return vehicles.
+55
View File
@@ -0,0 +1,55 @@
---
title: Events
---
## Client events
### ox:playerLoaded
Triggered once the player has selected a character and spawned.
```lua
AddEventHandler('ox:playerLoaded', function(data) end)
```
### ox:playerLogout
Triggered when the player enters character selection if they were previously playing a character.
```lua
AddEventHandler('ox:playerLogout', function() end)
```
### ox:statusTick
Triggered every 1000ms interval, when status values are updated internally.
```lua
AddEventHandler('ox:statusTick', function(statuses) end)
```
## Networked events
### ox:setGroup
Triggered when the player's grade in a group is modified on the server with `player.setGroup`.
```lua
RegisterNetEvent('ox:setGroup', function(group, grade) end)
```
### ox:licenseAdded
Triggered when the player has been granted a license.
```lua
RegisterNetEvent('ox:licenseAdded', function(name) end)
```
### ox:licenseRemoved
Triggered when the player's license is revoked.
```lua
RegisterNetEvent('ox:licenseRemoved', function(name) end)
```