mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 14:38:50 +00:00
ox_core licenses
This commit is contained in:
1 parent
3556a4a55a
commit
962442b53c
4 files changed
+88
-5
No files matched your search
@@ -13,4 +13,15 @@ lib.callback.await('ox:getStatus', delay, targetId, statusName)
|
||||
- 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.
|
||||
@@ -32,8 +32,26 @@ AddEventHandler('ox:statusTick', function(statuses) end)
|
||||
|
||||
### ox:setGroup
|
||||
|
||||
Triggered when a player's grade in a group is modified on the server with `player.setGroup`.
|
||||
Triggered when the player's grade in a group is modified on the server with `player.setGroup`.
|
||||
|
||||
```lua
|
||||
RegisterNetEvent('ox:setGroup', function(source, group, grade) end)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### ox:licenseAdded
|
||||
|
||||
Triggered when the player has been granted a license.
|
||||
|
||||
```lua
|
||||
RegisterNetEvent('ox:licenseAdded', function(name) end)
|
||||
```
|
||||
|
||||
### ox:licenseAdded
|
||||
|
||||
Triggered when the player's license is revoked.
|
||||
|
||||
```lua
|
||||
RegisterNetEvent('ox:licenseRemoved', function(name) end)
|
||||
```
|
||||
@@ -22,7 +22,7 @@ AddEventHandler('ox:setGroup', function(source, group, grade) end)
|
||||
|
||||
### ox:playerLogout
|
||||
|
||||
Triggered when the player logs out from their current character or disconnects from the server.
|
||||
Triggered when a player logs out from their current character or disconnects from the server.
|
||||
|
||||
```lua
|
||||
AddEventHandler('ox:playerLogout', function(source, userid, charid) end)
|
||||
@@ -30,12 +30,28 @@ AddEventHandler('ox:playerLogout', function(source, userid, charid) end)
|
||||
|
||||
### ox:characterDeleted
|
||||
|
||||
Triggered when the player has deleted a character.
|
||||
Triggered when a player has deleted a character.
|
||||
|
||||
```lua
|
||||
AddEventHandler('ox:characterDeleted', function(source, userid, charid) end)
|
||||
```
|
||||
|
||||
### ox:licenseAdded
|
||||
|
||||
Triggered when a player has been granted a license.
|
||||
|
||||
```lua
|
||||
AddEventHandler('ox:licenseAdded', function(source, name) end)
|
||||
```
|
||||
|
||||
### ox:licenseAdded
|
||||
|
||||
Triggered when a player's license is revoked.
|
||||
|
||||
```lua
|
||||
AddEventHandler('ox:licenseRemoved', function(source, name) end)
|
||||
```
|
||||
|
||||
## Networked events
|
||||
|
||||
### ox:playerDeath
|
||||
|
||||
@@ -94,6 +94,8 @@ The filter can be a string, array, or object where key is the group, and value i
|
||||
player.hasGroup(filter)
|
||||
```
|
||||
|
||||
- filter: `string | string[] | { [string]: number }`
|
||||
|
||||
## player.setStatus
|
||||
|
||||
Set the current value for a status (i.e. hunger, thirst).
|
||||
@@ -127,7 +129,43 @@ player.removeStatus(name, value)
|
||||
- name: string
|
||||
- value: number
|
||||
|
||||
- filter: `string | string[] | { [string]: number }`
|
||||
## player.getLicenses
|
||||
|
||||
Get all licenses for the player.
|
||||
|
||||
```lua
|
||||
player.getLicenses()
|
||||
```
|
||||
|
||||
## player.getLicense
|
||||
|
||||
Get the license of the given name for the player, as an object containing license information.
|
||||
|
||||
```lua
|
||||
player.getLicense(name)
|
||||
```
|
||||
|
||||
- name: string
|
||||
|
||||
## player.addLicense
|
||||
|
||||
Grants a license to the player and triggers 'ox:licenseAdded' on the server and client.
|
||||
|
||||
```lua
|
||||
player.addLicense(name)
|
||||
```
|
||||
|
||||
- name: string
|
||||
|
||||
## player.removeLicense
|
||||
|
||||
Revokes a license from the player and triggers 'ox:licenseRemoved' on the server and client.
|
||||
|
||||
```lua
|
||||
player.removeLicense(name)
|
||||
```
|
||||
|
||||
- name: string
|
||||
|
||||
## player.getPlayersInScope
|
||||
|
||||
|
||||
Reference in new issue
Block a user