From 74227cc2623e0b91b751a921b602850875cfb620 Mon Sep 17 00:00:00 2001
From: Jag <77469789+jag3dagster@users.noreply.github.com>
Date: Sun, 2 Jul 2023 20:13:56 -0700
Subject: [PATCH] chore: oxmysql and ox_lib clean-up (#134)
* oxmysql and some lib interface fixes
- Various fixes throughout oxmysql
- started ox_lib audit
* chore: More clean up
- Reword some confusing descriptions
- Add some descriptions
- Type fixes
- Spelling and grammar fixes
- Swapping in `-` where `*` used to be for
bullet point consistency
ox_lib
- Interface, ACL through GetClosestVehicle audited
* chore: Finishing up ox_lib
---
pages/ox_lib/Modules/ACL/Server.mdx | 4 +-
pages/ox_lib/Modules/AddKeybind/Client.mdx | 61 +++++++++---
pages/ox_lib/Modules/Cache/Client.mdx | 19 ++--
.../Modules/Callback/JavaScript/Client.mdx | 11 ++-
.../Modules/Callback/JavaScript/Server.mdx | 8 +-
pages/ox_lib/Modules/Callback/Lua/Client.mdx | 2 +
pages/ox_lib/Modules/Callback/Lua/Server.mdx | 8 +-
pages/ox_lib/Modules/Cron/Server.mdx | 11 +--
.../ox_lib/Modules/DisableControls/Client.mdx | 21 ++++-
.../Modules/GetClosestObject/Client.mdx | 13 +--
pages/ox_lib/Modules/GetClosestPed/Client.mdx | 13 +--
.../Modules/GetClosestPlayer/Client.mdx | 22 +++--
.../Modules/GetClosestVehicle/Client.mdx | 20 ++--
.../Modules/GetNearbyObjects/Client.mdx | 11 ++-
pages/ox_lib/Modules/GetNearbyPeds/Client.mdx | 11 ++-
.../Modules/GetNearbyPlayers/Client.mdx | 18 ++--
.../Modules/GetNearbyVehicles/Client.mdx | 18 ++--
.../ox_lib/Modules/Interface/Client/alert.mdx | 4 +-
.../ox_lib/Modules/Interface/Client/input.mdx | 4 +-
.../ox_lib/Modules/Interface/Client/menu.mdx | 1 +
.../Modules/Interface/Client/radial.mdx | 67 ++++++++-----
.../Modules/Interface/Client/skillcheck.mdx | 23 +++--
.../Modules/Interface/Client/textui.mdx | 2 +-
pages/ox_lib/Modules/Locale/Shared.mdx | 17 ++--
pages/ox_lib/Modules/Logger/Server.mdx | 4 +-
pages/ox_lib/Modules/Math/Shared.mdx | 16 ++++
.../Modules/Points/JavaScript/Client.mdx | 13 ++-
pages/ox_lib/Modules/Points/Lua/Client.mdx | 49 ++++++----
pages/ox_lib/Modules/Raycast/Client.mdx | 29 +++---
pages/ox_lib/Modules/Streaming/Client.mdx | 72 +++++++-------
pages/ox_lib/Modules/Table/Shared.mdx | 66 +++++++++++--
.../Modules/VehicleProperties/Client.mdx | 94 ++++++++++++++++++-
pages/ox_lib/Modules/Version/Server.mdx | 2 +-
pages/ox_lib/Modules/Version/Shared.mdx | 4 +-
pages/ox_lib/Modules/Zones/Shared.mdx | 30 ++++--
pages/oxmysql/Functions/prepare.mdx | 2 +-
pages/oxmysql/Functions/rawExecute.mdx | 6 +-
pages/oxmysql/issues.mdx | 2 +-
pages/oxmysql/ui.mdx | 2 +-
39 files changed, 533 insertions(+), 247 deletions(-)
diff --git a/pages/ox_lib/Modules/ACL/Server.mdx b/pages/ox_lib/Modules/ACL/Server.mdx
index 3f29a1d3..c21d9d62 100644
--- a/pages/ox_lib/Modules/ACL/Server.mdx
+++ b/pages/ox_lib/Modules/ACL/Server.mdx
@@ -5,7 +5,7 @@ import { Tabs, Tab } from 'nextra-theme-docs';
### lib.addAce
-Assigns the ace permission to a principal. Third parameter defaults to 'allow', while false sets the permission to 'deny'.
+Assigns the ace permission to a principal. Third parameter defaults to 'allow', while passing `false` sets the permission to 'deny'.
@@ -36,7 +36,7 @@ lib.addAce('group.admin', 'command.say')
### lib.removeAce
-Removes the ace permission from a principal. Third parameter defaults to 'allow', while false sets the permission to 'deny'.
+Removes the ace permission from a principal. Third parameter defaults to 'allow', while passing `false` sets the permission to 'deny'.
diff --git a/pages/ox_lib/Modules/AddKeybind/Client.mdx b/pages/ox_lib/Modules/AddKeybind/Client.mdx
index 3324fe58..1d5d7efd 100644
--- a/pages/ox_lib/Modules/AddKeybind/Client.mdx
+++ b/pages/ox_lib/Modules/AddKeybind/Client.mdx
@@ -1,17 +1,48 @@
+Registers keybinds and simplifies interactions of the keybinds.
+
+### CKeybind
+
+A table representing a keybind with the following properties.
+
+- name: `string`
+- description: `string`
+- currentKey: `string`
+ - Key that the current user has this keybind set to
+- disabled: `boolean`
+ - Whether or not the keybind is currently disabled
+- hash: `number`
+ - Internal hash of the keybind that is used to reference it within the game itself
+- defaultKey?: `string`
+ - Default key to set the keybind to for new players
+ - NOTE: Changing this will not change the key for existing players
+- defaultMapper?: `string`
+ - See [Input Mapper Ids](https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/) for more information
+- disable: `function(self: CKeybind, disable: boolean)`
+ - Built-in function to enable / disable a keybind
+- onPressed?: `function(self: CKeybind)`
+ - User-defined function triggered on keybind press
+- onReleased?: `function(self: CKeybind)`
+ - User-defined function triggered on keybind release
+
+### lib.addKeybind
+
```lua
lib.addKeybind(data)
```
-* data: `table`
- * name: `string`
- * description: `string`
- * defaultKey?: `string`
- * Default: None
- * currentKey: `string`
- * disabled?: `boolean`
- * disable?: `function`(self: `table`, toggle: `boolean`)
- * onPressed?: `function`(self: `table`)
- * onReleased?: `function`(self: `table`)
+- data: `table`
+ - name: `string`
+ - description: `string`
+ - defaultKey?: `string`
+ - Default: `None`
+ - defaultMapper?: `string`
+ - Default: `keyboard`
+ - disabled?: `boolean`
+ - Whether or not the keybind should be disabled by default
+ - onPressed?: `function(self: CKeybind)`
+ - Function triggered on keybind press
+ - onReleased?: `function(self: CKeybind)`
+ - Function triggered on keybind release
```lua
local keybind = lib.addKeybind({
@@ -23,13 +54,15 @@ local keybind = lib.addKeybind({
end,
onReleased = function(self)
print(('released %s (%s)'):format(self.currentKey, self.name))
- end,
+ end
})
```
-Keybinds can be enabled/disabled by using the disable method.
+### Enable / Disable Keybinds
+
+Keybinds can be enabled / disabled by using the disable method.
```lua
-keybind:disable(true) -- disable
-keybind:disable(false) -- enable
+keybind:disable(true) -- disables the keybind
+keybind:disable(false) -- enables the keybind
```
diff --git a/pages/ox_lib/Modules/Cache/Client.mdx b/pages/ox_lib/Modules/Cache/Client.mdx
index c270b5c6..6c8e94dd 100644
--- a/pages/ox_lib/Modules/Cache/Client.mdx
+++ b/pages/ox_lib/Modules/Cache/Client.mdx
@@ -1,6 +1,6 @@
import { Tabs, Tab } from 'nextra-theme-docs';
-Caches data related to the player and handling some events or statebags.
+Caches data related to the player.
An interval runs every 100ms to update data that cannot be checked via handlers.
## States
@@ -11,18 +11,18 @@ An interval runs every 100ms to update data that cannot be checked via handlers.
- player id
- serverId: `number`
- player server id
+- weapon: `number` or `false`
+ - current weapon hash
- vehicle: `number` or `false`
- vehicle entity id
- seat: `number` or `false`
- vehicle seat index
-- resource: `string`
- - invoking resource name
-- weapon: `number` or `false`
- - current ped weapon
-- coords: `vec3`
+- coords: `vector3`
- current player coords
- only populated if using `zones` or `points`
- - cannot be listened for with `onCache`
+ - cannot be listened for with `lib.onCache`
+- resource: `string`
+ - invoking resource name
- mount: `number` or `false` (RedM only)
- mount entity id
@@ -38,6 +38,11 @@ lib.onCache(key, function(value) end)
```
- key: `string`
+ - `ped`
+ - `vehicle`
+ - `seat`
+ - `weapon`
+ - `mount` (RedM only)
- value: `any`
```lua
diff --git a/pages/ox_lib/Modules/Callback/JavaScript/Client.mdx b/pages/ox_lib/Modules/Callback/JavaScript/Client.mdx
index 8d7d9905..b1ff7f7d 100644
--- a/pages/ox_lib/Modules/Callback/JavaScript/Client.mdx
+++ b/pages/ox_lib/Modules/Callback/JavaScript/Client.mdx
@@ -6,9 +6,10 @@
triggerServerCallback(eventName, delay, ...args)
```
-* eventName: `string`
-* delay: `number` or `null`
-* ..args: `any`
+- eventName: `string`
+- delay: `number` or `null`
+ - Amount of time until this callback can be triggered again
+- ..args: `any`
## Register Client Callback
@@ -18,8 +19,8 @@ triggerServerCallback(eventName, delay, ...args)
onServerCallback(eventName, cb)
```
-* eventName: `string`
-* cb: `function`(...args: `any`)
+- eventName: `string`
+- cb: `function`(...args: `any`)
## Usage Example
diff --git a/pages/ox_lib/Modules/Callback/JavaScript/Server.mdx b/pages/ox_lib/Modules/Callback/JavaScript/Server.mdx
index b50c4fac..f43177a8 100644
--- a/pages/ox_lib/Modules/Callback/JavaScript/Server.mdx
+++ b/pages/ox_lib/Modules/Callback/JavaScript/Server.mdx
@@ -6,11 +6,11 @@
triggerClientCallback(eventName, playerId, ...args)
```
-* eventName: `string`
-* playerId: `number`
-* ...args: `any`
+- eventName: `string`
+- playerId: `number`
+- ...args: `any`
-## Register Client Callback
+## Register Server Callback
### onClientCallback
diff --git a/pages/ox_lib/Modules/Callback/Lua/Client.mdx b/pages/ox_lib/Modules/Callback/Lua/Client.mdx
index d798132c..66747c01 100644
--- a/pages/ox_lib/Modules/Callback/Lua/Client.mdx
+++ b/pages/ox_lib/Modules/Callback/Lua/Client.mdx
@@ -10,6 +10,7 @@ lib.callback(name, delay, cb, ...)
- name: `string`
- delay: `number` or `false`
+ - Amount of time until this callback can be triggered again
- cb: `function`
- ...: `any`
@@ -29,6 +30,7 @@ lib.callback.await(name, delay, ...)
- name: `string`
- delay: `number` or `false`
+ - Amount of time until this callback can be triggered again
- ...: `any`
```lua
diff --git a/pages/ox_lib/Modules/Callback/Lua/Server.mdx b/pages/ox_lib/Modules/Callback/Lua/Server.mdx
index 4f8bf822..44d2cb81 100644
--- a/pages/ox_lib/Modules/Callback/Lua/Server.mdx
+++ b/pages/ox_lib/Modules/Callback/Lua/Server.mdx
@@ -5,11 +5,11 @@
The response is handled in a separate coroutine.
```lua
-lib.callback(name, source, cb, ...)
+lib.callback(name, playerId, cb, ...)
```
- name: `string`
-- source: `number`
+- playerId: `number`
- cb: `function`
- ...: `any`
@@ -26,11 +26,11 @@ end, args.radius)
The current coroutine is yielded until a response is received.
```lua
-lib.callback.await(name, source, ...)
+lib.callback.await(name, playerId, ...)
```
- name: `string`
-- source: `number`
+- playerId: `number`
- ...: `any`
```lua
diff --git a/pages/ox_lib/Modules/Cron/Server.mdx b/pages/ox_lib/Modules/Cron/Server.mdx
index 1dfbf04c..b2fcc618 100644
--- a/pages/ox_lib/Modules/Cron/Server.mdx
+++ b/pages/ox_lib/Modules/Cron/Server.mdx
@@ -38,11 +38,10 @@ Creates a new [cronjob](https://en.wikipedia.org/wiki/Cron), scheduling a task t
lib.cron.new(expression, job, options)
```
-* expression:
- * string A cron expression such as `* * * * *` representing minute, hour, day, month, and day of the week
-* job:
- * fun(task: `OxTask`, date: `osdate`)
-* options?:
- * debug?: `boolean`
+- expression: `string`
+ - A cron expression such as `* * * * *` representing minute, hour, day, month, and day of the week
+- job: `fun(task: OxTask, date: osdate)`
+- options?: `table`
+ - debug?: `boolean`
**returns**: OxTask
diff --git a/pages/ox_lib/Modules/DisableControls/Client.mdx b/pages/ox_lib/Modules/DisableControls/Client.mdx
index 0466d279..2f5adc87 100644
--- a/pages/ox_lib/Modules/DisableControls/Client.mdx
+++ b/pages/ox_lib/Modules/DisableControls/Client.mdx
@@ -1,6 +1,8 @@
+A centralized way to track and disable controls.
+
### lib.disableControls
-Call on frame to disable all stored keys.
+Call on frame to disable all stored controls.
```lua
lib.disableControls()
@@ -8,24 +10,35 @@ lib.disableControls()
### lib.disableControls:Add
+Adds the specified control(s) to the stored list.
+If the control is already being tracked, the stored counter will be incremented.
+
```lua
lib.disableControls:Add(...)
```
-* vararg: `number`
+- vararg: `number` or `table`
+ - Control(s) to add a stored count of
### lib.disableControls:Remove
+Removes the specified control(s) from the stored list.
+If the stored counter for a given control is greater than one, the stored counter will be decremented.
+
```lua
lib.disableControls:Remove(...)
```
-* vararg: `number`
+- vararg: `number` or `table`
+ - Control(s) to remove a stored count of
### lib.disableControls:Clear
+Clears the stored counter(s) for the specified control(s).
+
```lua
lib.disableControls:Clear(...)
```
-* vararg: `number`
+- vararg: `number` or `table`
+ - Control(s) to clear out from being tracked
diff --git a/pages/ox_lib/Modules/GetClosestObject/Client.mdx b/pages/ox_lib/Modules/GetClosestObject/Client.mdx
index dc58d6d3..0e7a2b57 100644
--- a/pages/ox_lib/Modules/GetClosestObject/Client.mdx
+++ b/pages/ox_lib/Modules/GetClosestObject/Client.mdx
@@ -6,12 +6,13 @@ Get the object handle and coords of the closest object to a set of coordinates.
lib.getClosestObject(coords, maxDistance)
```
-* coords: `vector3`
- * The coords to check from.
-* maxDistance: `number`
- * The max distance to check.
+- coords: `vector3`
+ - The coords to check from.
+- maxDistance?: `number`
+ - The max distance to check.
+ - Default: `2.0`
Return:
-* ped?: `number`
-* coords?: `number`
+- object?: `number`
+- coords?: `vector3`
diff --git a/pages/ox_lib/Modules/GetClosestPed/Client.mdx b/pages/ox_lib/Modules/GetClosestPed/Client.mdx
index 3b6dc87d..be990c89 100644
--- a/pages/ox_lib/Modules/GetClosestPed/Client.mdx
+++ b/pages/ox_lib/Modules/GetClosestPed/Client.mdx
@@ -6,12 +6,13 @@ Get the ped handle and coords of the closest ped to a set of coordinates.
lib.getClosestPed(coords, maxDistance)
```
-* coords: `vector3`
- * The coords to check from.
-* maxDistance: `number`
- * The max distance to check.
+- coords: `vector3`
+ - The coords to check from.
+- maxDistance?: `number`
+ - The max distance to check.
+ - Default: `2.0`
Return:
-* ped?: `number`
-* coords?: `number`
+- ped?: `number`
+- coords?: `vector3`
diff --git a/pages/ox_lib/Modules/GetClosestPlayer/Client.mdx b/pages/ox_lib/Modules/GetClosestPlayer/Client.mdx
index 9fe7bcd2..886e0903 100644
--- a/pages/ox_lib/Modules/GetClosestPlayer/Client.mdx
+++ b/pages/ox_lib/Modules/GetClosestPlayer/Client.mdx
@@ -1,20 +1,22 @@
### lib.getClosestPlayer
-Get the id, ped, and coords of the closest player to a set of coordinates.
+Get the player id, ped handle, and coords of the closest player to a set of coordinates.
```lua
lib.getClosestPlayer(coords, maxDistance, includePlayer)
```
-* coords: `vector3`
- * The coords to check from.
-* maxDistance: `number`
- * The max distance to check.
-* includePlayer: `boolean`
- * Whether or not to include the current player.
+- coords: `vector3`
+ - The coords to check from.
+- maxDistance?: `number`
+ - The max distance to check.
+ - Default: `2.0`
+- includePlayer?: `boolean`
+ - Whether or not to include the current player.
+ - Default: `false`
Return:
-* playerId?: `number`
-* playerPed?: `number`
-* playerCoords?: `vector3`
+- playerId?: `number`
+- playerPed?: `number`
+- playerCoords?: `vector3`
diff --git a/pages/ox_lib/Modules/GetClosestVehicle/Client.mdx b/pages/ox_lib/Modules/GetClosestVehicle/Client.mdx
index 3ad980d5..de9f950e 100644
--- a/pages/ox_lib/Modules/GetClosestVehicle/Client.mdx
+++ b/pages/ox_lib/Modules/GetClosestVehicle/Client.mdx
@@ -1,19 +1,21 @@
### lib.getClosestVehicle
-Get the id and coords of the closest vehicle to a set of coordinates.
+Get the vehicle handle and coords of the closest vehicle to a set of coordinates.
```lua
lib.getClosestVehicle(coords, maxDistance, includePlayerVehicle)
```
-* coords: `vector3`
- * The coords to check from.
-* maxDistance: `number`
- * The max distance to check.
-* includePlayerVehicle: `boolean`
- * Whether or not to include the player's current vehicle.
+- coords: `vector3`
+ - The coords to check from.
+- maxDistance?: `number`
+ - The max distance to check.
+ - Default: `2.0`
+- includePlayerVehicle?: `boolean`
+ - Whether or not to include the player's current vehicle.
+ - Default: `false`
Return:
-* vehicle?: `number`
-* vehicleCoords?: `vector3`
+- vehicle?: `number`
+- vehicleCoords?: `vector3`
diff --git a/pages/ox_lib/Modules/GetNearbyObjects/Client.mdx b/pages/ox_lib/Modules/GetNearbyObjects/Client.mdx
index 0a7d5143..a6321175 100644
--- a/pages/ox_lib/Modules/GetNearbyObjects/Client.mdx
+++ b/pages/ox_lib/Modules/GetNearbyObjects/Client.mdx
@@ -6,11 +6,12 @@ Get the object handle and coords of all objects within range of a set of coordin
lib.getNearbyObjects(coords, maxDistance)
```
-* coords: `vector3`
- * The coords to check from.
-* maxDistance: `number`
- * The max distance to check.
+- coords: `vector3`
+ - The coords to check from.
+- maxDistance?: `number`
+ - The max distance to check.
+ - Default: `2.0`
Return:
-* `{ object: number, coords: vector3 }[]`
+- objects: `{ object: number, coords: vector3 }[]`
diff --git a/pages/ox_lib/Modules/GetNearbyPeds/Client.mdx b/pages/ox_lib/Modules/GetNearbyPeds/Client.mdx
index 52c0a2f4..ba2292e9 100644
--- a/pages/ox_lib/Modules/GetNearbyPeds/Client.mdx
+++ b/pages/ox_lib/Modules/GetNearbyPeds/Client.mdx
@@ -6,11 +6,12 @@ Get the ped handle and coords of all peds within range of a set of coordinates.
lib.getNearbyPeds(coords, maxDistance)
```
-* coords: `vector3`
- * The coords to check from.
-* maxDistance: `number`
- * The max distance to check.
+- coords: `vector3`
+ - The coords to check from.
+- maxDistance?: `number`
+ - The max distance to check.
+ - Default: `2.0`
Return:
-* `{ ped: number, coords: vector3 }[]`
+- peds: `{ ped: number, coords: vector3 }[]`
diff --git a/pages/ox_lib/Modules/GetNearbyPlayers/Client.mdx b/pages/ox_lib/Modules/GetNearbyPlayers/Client.mdx
index 5913a786..6515b4fb 100644
--- a/pages/ox_lib/Modules/GetNearbyPlayers/Client.mdx
+++ b/pages/ox_lib/Modules/GetNearbyPlayers/Client.mdx
@@ -1,18 +1,20 @@
### lib.getNearbyPlayers
-Get the id, ped, and coords of all players within range of a set of coordinates.
+Get the player id, ped handle, and coords of all players within range of a set of coordinates.
```lua
lib.getNearbyPlayers(coords, maxDistance, includePlayer)
```
-* coords: `vector3`
- * The coords to check from.
-* maxDistance: `number`
- * The max distance to check.
-* includePlayer: `boolean`
- * Whether or not to include the current player.
+- coords: `vector3`
+ - The coords to check from.
+- maxDistance?: `number`
+ - The max distance to check.
+ - Default: `2.0`
+- includePlayer?: `boolean`
+ - Whether or not to include the current player.
+ - Default: `false`
Return:
-* `{ id: number, ped: number, coords: vector3 }[]`
+- players: `{ id: number, ped: number, coords: vector3 }[]`
diff --git a/pages/ox_lib/Modules/GetNearbyVehicles/Client.mdx b/pages/ox_lib/Modules/GetNearbyVehicles/Client.mdx
index 75ac4f8b..c2414d8c 100644
--- a/pages/ox_lib/Modules/GetNearbyVehicles/Client.mdx
+++ b/pages/ox_lib/Modules/GetNearbyVehicles/Client.mdx
@@ -1,18 +1,20 @@
### lib.getNearbyVehicles
-Get the id and coords of all vehicles within range of a set of coordinates.
+Get the vehicle handle and coords of all vehicles within range of a set of coordinates.
```lua
lib.getNearbyVehicles(coords, maxDistance, includePlayerVehicle)
```
-* coords: `vector3`
- * The coords to check from.
-* maxDistance: `number`
- * The max distance to check.
-* includePlayerVehicle: `boolean`
- * Whether or not to include the player's current vehicle.
+- coords: `vector3`
+ - The coords to check from.
+- maxDistance?: `number`
+ - The max distance to check.
+ - Default: `2.0`
+- includePlayerVehicle?: `boolean`
+ - Whether or not to include the player's current vehicle.
+ - Default: `false`
Return:
-* `{ vehicle: number, coords: vector3 }[]`
+- vehicles: `{ vehicle: number, coords: vector3 }[]`
diff --git a/pages/ox_lib/Modules/Interface/Client/alert.mdx b/pages/ox_lib/Modules/Interface/Client/alert.mdx
index bac69ec0..cd1b7e8c 100644
--- a/pages/ox_lib/Modules/Interface/Client/alert.mdx
+++ b/pages/ox_lib/Modules/Interface/Client/alert.mdx
@@ -62,8 +62,8 @@ lib.alertDialog(data);
- cancel?: `string`
- confirm?: `string`
-Returns `confirm` if the player pressed the confirm button, otherwise if the player pressed the cancel button
-or has exited the dialog with ESC the return will be `cancel`.
+Returns `'confirm'` if the player pressed the confirm button, otherwise if the player pressed the cancel button
+or has exited the dialog with ESC the return will be `'cancel'`.
### lib.closeAlertDialog
diff --git a/pages/ox_lib/Modules/Interface/Client/input.mdx b/pages/ox_lib/Modules/Interface/Client/input.mdx
index d4d354e6..5bb4d561 100644
--- a/pages/ox_lib/Modules/Interface/Client/input.mdx
+++ b/pages/ox_lib/Modules/Interface/Client/input.mdx
@@ -207,7 +207,7 @@ lib.closeInputDialog();
local input = lib.inputDialog('Basic dialog', {'First row', 'Second row'})
if not input then return end
-print(input, input[1], input[2])
+print(json.encode(input), input[1], input[2])
```
@@ -247,7 +247,7 @@ local input = lib.inputDialog('Dialog title', {
print(json.encode(input))
--- Getting rgbb values from colour picker
+-- Getting rgb values from colour picker
local rgb = lib.math.torgba(input[4])
-- Transforming date timestamp to a readable format with Lua's os library (server-only)
diff --git a/pages/ox_lib/Modules/Interface/Client/menu.mdx b/pages/ox_lib/Modules/Interface/Client/menu.mdx
index 7fdd2686..08c611d7 100644
--- a/pages/ox_lib/Modules/Interface/Client/menu.mdx
+++ b/pages/ox_lib/Modules/Interface/Client/menu.mdx
@@ -70,6 +70,7 @@ lib.registerMenu(data, cb);
- onSideScroll: `function`(selected: `number`, scrollIndex: `number`, args: `{[string]: any}`)
- Function ran whenever a scroll list item is changed.
- onCheck: `function`(selected: `number`, checked: `boolean`, args: `{[string]: any}`)
+ - Function ran whenever a checkbox is toggled.
- cb: `function`(selected: `number`, scrollIndex: `number`, args: `{[string]: any}`)
- Callback function when the menu item is pressed.
diff --git a/pages/ox_lib/Modules/Interface/Client/radial.mdx b/pages/ox_lib/Modules/Interface/Client/radial.mdx
index 28d8aba6..572d36af 100644
--- a/pages/ox_lib/Modules/Interface/Client/radial.mdx
+++ b/pages/ox_lib/Modules/Interface/Client/radial.mdx
@@ -32,16 +32,17 @@ lib.addRadialItem(items);
-- id: `string`
- - Id that is used for removing options.
-- icon: `string`
-- label: `string`
- - Label uses ` \n` to insert a newline
-- menu?: `string`
- - Id of a menu to open.
-- onSelect: `function(currentMenu: string | nil, itemIndex: number)` | `string`
- - Function that's ran when a user clicks the item.
-- keepOpen?: `boolean`
+- items: `table` (`object` or `array`)
+ - id: `string`
+ - Id that is used for removing options.
+ - icon: `string`
+ - label: `string`
+ - Label uses ` \n` to insert a newline
+ - menu?: `string`
+ - Id of a menu to open.
+ - onSelect: `function(currentMenu: string | nil, itemIndex: number)` | `string`
+ - Function that's ran when a user clicks the item.
+ - keepOpen?: `boolean`
### lib.removeRadialItem
@@ -114,16 +115,17 @@ lib.registerRadial(radial);
-- id: `string`
- - Unique menu id used to open with `menu` prop on an item.
-- items: `array`
- - icon: `string`
- - label: `string`
- - Label uses ` \n` to insert a newline
- - menu?: `string`
- - Id of a menu to open.
- - onSelect?: `function(currentMenu: string | nil, itemIndex: number)` | `string`
- - Function that's ran when a user clicks the item.
+- radial: `table` (`object`)
+ - id: `string`
+ - Unique menu id used to open with `menu` prop on an item.
+ - items: `array`
+ - icon: `string`
+ - label: `string`
+ - Label uses ` \n` to insert a newline
+ - menu?: `string`
+ - Id of a menu to open.
+ - onSelect?: `function(currentMenu: string | nil, itemIndex: number)` | `string`
+ - Function that's ran when a user clicks the item.
### lib.hideRadial
@@ -174,12 +176,35 @@ lib.disableRadial(state);
- state: `boolean`
- Whether or not radial menu should be disabled
+### lib.getCurrentRadialId
+
+Returns the id of the currently open radial menu.
+
+
+
+
+```lua
+local id = lib.getCurrentRadialId()
+```
+
+
+
+
+```ts
+import lib from '@overextended/ox_lib/client';
+
+let id = lib.getCurrentRadialId();
+```
+
+
+
+
### Usage Example
When adding radial menu items whether they are global or for a sub menu, make sure to stick to short as possible labels
-as long labels will look out of place and should not be used with the radial menu because of it's density.
+as long labels will look out of place and should not be used with the radial menu because of its density.
diff --git a/pages/ox_lib/Modules/Interface/Client/skillcheck.mdx b/pages/ox_lib/Modules/Interface/Client/skillcheck.mdx
index 1d73b06d..c8f0068b 100644
--- a/pages/ox_lib/Modules/Interface/Client/skillcheck.mdx
+++ b/pages/ox_lib/Modules/Interface/Client/skillcheck.mdx
@@ -27,16 +27,19 @@ lib.skillCheck(difficulty, inputs);
-- difficulty: `easy` or `medium` or `hard` or `object`
- - Can set custom difficulty by sending a object instead of string
- - `{ areaSize: number, speedMultiplier: number }`
- - easy: `{ areaSize: 50, speedMultiplier: 1 }`
- - medium: `{ areaSize: 40, speedMultiplier: 1.5 }`
- - hard: `{ areaSize: 25, speedMultiplier: 1.75 }`
- - `areaSize` size of the area in degrees.
- - Sending an array will chain the checks together and return false if one fails and true if all succeed
-- inputs: `string[]`
- - Picks a random key from the inputs table to use on each skill check pass.
+- difficulty: `'easy'` or `'medium'` or `'hard'` or `table`
+ - Preset difficulties:
+ - 'easy' - `{ areaSize: 50, speedMultiplier: 1 }`
+ - 'medium' - `{ areaSize: 40, speedMultiplier: 1.5 }`
+ - 'hard' - `{ areaSize: 25, speedMultiplier: 1.75 }`
+ - Custom difficulties can be set by sending an object instead of one of the preset strings above
+ - areaSize: `number`
+ - Size of the success area in degrees
+ - speedMultiplier: `number`
+ - Multiplier for the speed of the indicator
+- inputs?: `string[]`
+ - A random key will be picked from the inputs table for each skill check
+ - If no inputs are defined the key is defaulted to `e`
### Usage Example
diff --git a/pages/ox_lib/Modules/Interface/Client/textui.mdx b/pages/ox_lib/Modules/Interface/Client/textui.mdx
index 02e10fdd..51014765 100644
--- a/pages/ox_lib/Modules/Interface/Client/textui.mdx
+++ b/pages/ox_lib/Modules/Interface/Client/textui.mdx
@@ -11,7 +11,7 @@ Show the TextUI window.
-**DO NOT** run this function every tick, it's intented to be used as a toggle.
+**DO NOT** run this function every tick, it's intended to be used as a toggle.
diff --git a/pages/ox_lib/Modules/Locale/Shared.mdx b/pages/ox_lib/Modules/Locale/Shared.mdx
index 9e58151a..9240d47e 100644
--- a/pages/ox_lib/Modules/Locale/Shared.mdx
+++ b/pages/ox_lib/Modules/Locale/Shared.mdx
@@ -2,7 +2,7 @@ Allows servers to set a preferred language and attempt to load locale files in a
Locale files should use the [ISO Language Code](http://www.lingoes.net/en/translator/langcode.htm) and be saved as `./locales/langcode.json`
## Setup
-To change the preferred language from English, add the convar to your server.cfg
+To change the preferred language from English, add the convar to your server.cfg and change `en` to the desired language code.
```yaml
setr ox:locale en
@@ -10,25 +10,25 @@ setr ox:locale en
Create a locales directory and a file for your language.
-```json title="locales/en.json"
+```json filename="locales/en.json"
{
"grand_theft_auto": "grand theft auto",
"male": "male",
"female": "female",
- "suspect_sex": "suspect is %s",
+ "suspect_sex": "suspect is %s"
}
```
-```json title="locales/fr.json"
+```json filename="locales/fr.json"
{
"grand_theft_auto": "vol de voiture",
"male": "homme",
"female": "femme",
- "suspect_sex": "le suspect est %s",
+ "suspect_sex": "le suspect est %s"
}
```
-```lua title="fxmanifest.lua"
+```lua filename="fxmanifest.lua"
files {
'locales/*.json'
}
@@ -49,8 +49,8 @@ Additional arguments can be sent to format the locale output.
locale(str, ...)
```
-* str: `string`
-* ...: `string` or `number`
+- str: `string`
+- vararg?: `string` or `number`
```lua
-- Load the locale module
@@ -72,6 +72,7 @@ You can create a locale string that references other locales to construct a phra
"hello_my_name_is": "${hello}! ${my_name_is}."
}
```
+
```lua
print(locale('hello_my_name_is', 'doka', 'linden'))
```
diff --git a/pages/ox_lib/Modules/Logger/Server.mdx b/pages/ox_lib/Modules/Logger/Server.mdx
index 151bf420..9f86dadd 100644
--- a/pages/ox_lib/Modules/Logger/Server.mdx
+++ b/pages/ox_lib/Modules/Logger/Server.mdx
@@ -12,7 +12,7 @@ lib.logger(source, event, message, ...)
- A name for the log event (i.e. the trigerring event or a description)
- message: `string`
- The content for the log.
-- ...: `string`
+- vararg: `string`
- Additional arguments are converted to tags for additional filtering and searching.
### Example
@@ -68,7 +68,7 @@ It is designed to be very cost effective and easy to operate.
- To setup a grafana instance you'll require docker, and knowledge on containers or kubernetes.
+ To setup a grafana instance you'll need docker, and knowledge on containers or kubernetes.
Please find a guide to setup a grafana stack (min requirement grafana and grafana loki) and follow that.
Once done, setup authentication and use the username and password securing your endpoint.
diff --git a/pages/ox_lib/Modules/Math/Shared.mdx b/pages/ox_lib/Modules/Math/Shared.mdx
index 3040283b..77c04278 100644
--- a/pages/ox_lib/Modules/Math/Shared.mdx
+++ b/pages/ox_lib/Modules/Math/Shared.mdx
@@ -69,3 +69,19 @@ math.tohex(n, upper)
Return:
- hex: `string`
+
+### math.groupdigits
+
+Takes a number and formats it into grouped digits.
+
+```lua
+math.groupdigits(number, seperator)
+```
+
+- number: `number`
+- seperator?: `string`
+ - Default: `,`
+
+Return:
+
+- groupedDigits: `string`
diff --git a/pages/ox_lib/Modules/Points/JavaScript/Client.mdx b/pages/ox_lib/Modules/Points/JavaScript/Client.mdx
index 8c5112c4..2fd741eb 100644
--- a/pages/ox_lib/Modules/Points/JavaScript/Client.mdx
+++ b/pages/ox_lib/Modules/Points/JavaScript/Client.mdx
@@ -6,12 +6,12 @@ Simple and centralised distance checking, supporting callbacks when entering, le
Point({coords, distance, onEnter, onExit, nearby, args})
```
-* coords: `number[]`
-* distance: `number`
-* onEnter?: `function`
-* onExit?: `function`
-* nearby?: `function`
-* args?: `T`
+- coords: `number[]`
+- distance: `number`
+- onEnter?: `function`
+- onExit?: `function`
+- nearby?: `function`
+- args?: `T`
```ts
import { Point, cache } from '@overextended/ox_lib/client'
@@ -43,4 +43,3 @@ point.onExit = () => {
console.log('Left range of point', point.id)
}
```
-
diff --git a/pages/ox_lib/Modules/Points/Lua/Client.mdx b/pages/ox_lib/Modules/Points/Lua/Client.mdx
index 2d622a53..85d6eec0 100644
--- a/pages/ox_lib/Modules/Points/Lua/Client.mdx
+++ b/pages/ox_lib/Modules/Points/Lua/Client.mdx
@@ -4,17 +4,23 @@ Simple and centralised distance checking, supporting callbacks when entering, le
### CPoint
-A table representing a point, with the following properties.
+A table representing a point with the following properties.
-* id: `number`
-* coords: `vector3`
-* distance: `number`
- * The distance for the player to be "inside" a point (i.e. the point's radius).
-* currentDistance: `number`
- * The players current distance from the centre of the point.
-* isClosest?: `boolean`
-* remove: `function()`
- * Removes the point from the points registry.
+- id: `number`
+- coords: `vector3`
+- distance: `number`
+ - The distance for the player to be "inside" a point (i.e. the point's radius).
+- currentDistance: `number`
+ - The players current distance from the centre of the point.
+- isClosest?: `boolean`
+- remove: `function()`
+ - Removes the point from the points registry.
+- onEnter?: `function(self: CPoint)`
+ - Function triggered when player gets within `distance` of the point
+- onExit?: `function(self: CPoint)`
+ - Function triggered when player goes beyond `distance` of the point
+- nearby?: `function(self: CPoint)`
+ - Function triggered on frame when within `distance` of the point
### lib.points.new
@@ -22,12 +28,15 @@ A table representing a point, with the following properties.
lib.points.new(data)
```
-* data: `table`
- * coords: `vector3`
- * distance: `number`
+- data: `table`
+ - coords: `vector3`
+ - distance: `number`
-**Returns:** CPoint
+Returns:
+- point: `CPoint`
+
+#### Example
```lua
local point = lib.points.new({
coords = GetEntityCoords(cache.ped),
@@ -60,7 +69,9 @@ Get a table of all points created in the resource.
lib.points.getAllPoints()
```
-**Return:** `table`
+Return:
+
+- points: `CPoint[]`
### lib.points.getNearbyPoints
@@ -70,7 +81,9 @@ Get an array of all points in range of the player.
lib.points.getNearbyPoints()
```
-**Return:** `CPoint[]`
+Return:
+
+- nearbyPoints: `CPoint[]`
### lib.points.getClosestPoint
@@ -80,4 +93,6 @@ Get the data for the closest point to the player.
lib.points.getClosestPoint()
```
-**Returns:** `CPoint`
+Return:
+
+- closestPoint?: `CPoint`
diff --git a/pages/ox_lib/Modules/Raycast/Client.mdx b/pages/ox_lib/Modules/Raycast/Client.mdx
index ad1e0366..9c971bc9 100644
--- a/pages/ox_lib/Modules/Raycast/Client.mdx
+++ b/pages/ox_lib/Modules/Raycast/Client.mdx
@@ -1,21 +1,28 @@
### lib.raycast.cam
-Starts a shapetest originating from the camera, extending to ~10m.
+Starts a shapetest originating from the camera, extending to ~10m by default.
```lua
lib.raycast.cam(flags, ignore, distance)
```
-* flags?: `number`
- * Defaults to 1|2|8|16 (see: https://docs.fivem.net/natives/?_0x377906D8A31E5586)
-* ignore?: `number`
- * A bit mask with bits 1, 2, 4, or 7 relating to collider types. 4 and 7 are usually used.
-* distance?: `number`
+- flags?: `number`
+ - See: https://docs.fivem.net/natives/?_0x377906D8A31E5586
+ - Default: `511`
+- ignore?: `number`
+ - A bit mask with bits 1, 2, 4, or 7 relating to collider types. 4 and 7 are usually used.
+ - Default: `4`
+- distance?: `number`
+ - Default: `10`
Return:
-* hit: `boolean`
-* entityHit: `number`
-* endCoords: `vector3`
-* surfaceNormal: `vector3`
-* materialHash: `number`
+- hit: `boolean`
+ - Whether or not an entity was hit
+- entityHit: `number`
+ - Entity handle of hit entity
+- endCoords: `vector3`
+ - Closest coords to where the raycast hit
+- surfaceNormal: `vector3`
+ - Normal to the surface that was hit
+- materialHash: `number`
diff --git a/pages/ox_lib/Modules/Streaming/Client.mdx b/pages/ox_lib/Modules/Streaming/Client.mdx
index b1931f30..1fe6765f 100644
--- a/pages/ox_lib/Modules/Streaming/Client.mdx
+++ b/pages/ox_lib/Modules/Streaming/Client.mdx
@@ -24,9 +24,10 @@ lib.requestAnimDict(dict, timeout)
-* dict: `string`
-* timeout: `number`
- * Default: `100`
+- dict: `string`
+- timeout?: `number`
+ - Number of ticks to wait for the asset to load.
+ - Default: `500`
### lib.requestAnimSet
@@ -49,9 +50,10 @@ lib.requestAnimSet(set, timeout)
-* set: `string`
-* timeout: `number`
- * Default: `100`
+- set: `string`
+- timeout?: `number`
+ - Number of ticks to wait for the asset to load.
+ - Default: `500`
### lib.requestModel
@@ -74,9 +76,10 @@ lib.requestModel(model, timeout)
-* model: `string`
-* timeout: `number`
- * Default: `100`
+- model: `string`
+- timeout?: `number`
+ - Number of ticks to wait for the asset to load.
+ - Default: `500`
### lib.requestStreamedTextureDict
@@ -99,9 +102,10 @@ lib.requestStreamedTextureDict(dict, timeout)
-* dict: `string`
-* timeout: `number`
- * Default: `100`
+- dict: `string`
+- timeout?: `number`
+ - Number of ticks to wait for the asset to load.
+ - Default: `500`
### lib.requestNamedPtfxAsset
@@ -109,7 +113,7 @@ lib.requestStreamedTextureDict(dict, timeout)
```lua
-lib.requestNamedPtfxAsset(fxName, timeout)
+lib.requestNamedPtfxAsset(ptFxName, timeout)
```
@@ -118,15 +122,16 @@ lib.requestNamedPtfxAsset(fxName, timeout)
```ts
import lib from '@overextended/ox_lib/client'
-lib.requestNamedPtfxAsset(fxName, timeout)
+lib.requestNamedPtfxAsset(ptFxName, timeout)
```
-* fxName: `string`
-* timeout: `number`
- * Default: `100`
+- ptFxName: `string`
+- timeout?: `number`
+ - Number of ticks to wait for the asset to load.
+ - Default: `500`
### lib.requestScaleformMovie
@@ -134,7 +139,7 @@ lib.requestNamedPtfxAsset(fxName, timeout)
```lua
-lib.requestScaleformMovie(scaleformMovie, timeout)
+lib.requestScaleformMovie(scaleformName, timeout)
```
@@ -143,15 +148,16 @@ lib.requestScaleformMovie(scaleformMovie, timeout)
```ts
import lib from '@overextended/ox_lib/client'
-lib.requestScaleformMovie(scaleformMovie, timeout)
+lib.requestScaleformMovie(scaleformName, timeout)
```
-* dict: `string`
-* timeout: `number`
- * Default: `100`
+- scaleformName: `string`
+- timeout?: `number`
+ - Number of ticks to wait for the asset to load.
+ - Default: `500`
### lib.requestWeaponAsset
@@ -174,18 +180,16 @@ lib.requestWeaponAsset(weaponType, timeout, weaponResourceFlags, extraWeaponComp
-* weaponType: `string | number`
-* timeout: `number?`
- * Number of ticks to wait for the asset to load. Default is `500`
-* weaponResourceFlags: `WeaponResourceFlags?`
- * Default is `31`
-* extraWeaponComponentFlags: `ExtraWeaponComponentFlags?`
- * Default is `0`
+- weaponType: `string | number`
+- timeout?: `number`
+ - Number of ticks to wait for the asset to load.
+ - Default: `500`
+- weaponResourceFlags?: `WeaponResourceFlags`
+ - Default: `31`
+- extraWeaponComponentFlags?: `ExtraWeaponComponentFlags`
+ - Default: `0`
-Return:
-* `string | number?` weaponType
-
-### WeaponResourceFlags
+#### WeaponResourceFlags
```
1 WRF_REQUEST_BASE_ANIMS
@@ -197,7 +201,7 @@ Return:
31 WRF_REQUEST_ALL_ANIMS
```
-### ExtraWeaponComponentFlags
+#### ExtraWeaponComponentFlags
```
0 WEAPON_COMPONENT_NONE
diff --git a/pages/ox_lib/Modules/Table/Shared.mdx b/pages/ox_lib/Modules/Table/Shared.mdx
index 3e1b409f..19e72ed0 100644
--- a/pages/ox_lib/Modules/Table/Shared.mdx
+++ b/pages/ox_lib/Modules/Table/Shared.mdx
@@ -1,11 +1,18 @@
+Adds additional functions alongside the standard table library
+
## lib.table.contains
```lua
-lib.table.contains(table, value)
+lib.table.contains(tbl, value)
```
-* table: `table`
-* value: `any`
+Checks if `table` contains the given `value`. Only intended for simple values and unnested tables.
+
+- tbl: `table`
+- value: `any`
+
+Return:
+- isContained: `boolean`
## lib.table.matches
@@ -13,22 +20,63 @@ lib.table.contains(table, value)
lib.table.matches(tableOne, tableTwo)
```
-* tableOne: `table`.
-* tableTwo: `table`
+Compares if two values are equal, iterating over tables and matching both keys and values.
+
+- tableOne: `table`
+- tableTwo: `table`
+
+Return:
+- matches: `boolean`
## lib.table.deepclone
+Recursively clones a table to ensure no table references remain.
+
```lua
-lib.table.deepclone(table)
+lib.table.deepclone(tbl)
```
-* table: `table`
+- tbl: `table`
+
+Return:
+- clonedTable: `table`
## lib.table.merge
+Merges two tables together. Duplicate keys will be added together if they are numbers, otherwise `tableTwo`'s value will be used.
+
```lua
lib.table.merge(tableOne, tableTwo)
```
-* tableOne: `table`
-* tableTwo: `table`
+- tableOne: `table`
+- tableTwo: `table`
+
+Return:
+- tableOne: `table`
+
+## lib.table.freeze
+
+Makes a table read-only, preventing further modification. Unfrozen tables stored within `table` are still mutable.
+
+```lua
+lib.table.freeze(tbl)
+```
+
+- tbl: `table`
+
+Return:
+- frozenTable: `table`
+
+## lib.table.isFrozen
+
+Returns true if `tbl` is set as read-only.
+
+```lua
+lib.table.isFrozen(tbl)
+```
+
+- tbl: `table`
+
+Return:
+- isFrozen: `boolean`
diff --git a/pages/ox_lib/Modules/VehicleProperties/Client.mdx b/pages/ox_lib/Modules/VehicleProperties/Client.mdx
index 85b60de3..61e93273 100644
--- a/pages/ox_lib/Modules/VehicleProperties/Client.mdx
+++ b/pages/ox_lib/Modules/VehicleProperties/Client.mdx
@@ -9,7 +9,9 @@ import { Tabs, Tab } from 'nextra-theme-docs';
lib.getVehicleProperties(vehicle)
```
-* vehicle: `entity`
+- vehicle: `number`
+ - vehicle handle of the vehicle to get the properties for
+
@@ -38,8 +40,8 @@ Requires the vehicle to belong to the client. _Do not use NetworkRequestControlO
lib.setVehicleProperties(vehicle, props)
```
-* vehicle: `entity`
-* props: `table` (`object`)
+- vehicle: `entity`
+- props: `table` (`object`)
@@ -64,10 +66,94 @@ onNet('ox_lib:setVehicleProperties', (netid, data) => {
-#### Recommended usage
+#### Recommended Usage
The server should tell the owner of the entity to set properties, using the following trigger.
```lua
TriggerClientEvent('ox_lib:setVehicleProperties', entityOwner, vehNetId, data)
```
+
+### Vehicle Properties
+
+- model?: `number`
+- plate?: `string`
+- plateIndex?: `number`
+- bodyHealth?: `number`
+- engineHealth?: `number`
+- tankHealth?: `number`
+- fuelLevel?: `number`
+- oilLevel?: `number`
+- dirtLevel?: `number`
+- color1?: `number` or `number[]`
+- color2?: `number` or `number[]`
+- pearlescentColor?: `number`
+- interiorColor?: `number`
+- dashboardColor?: `number`
+- wheelColor?: `number`
+- wheelWidth?: `number`
+- wheelSize?: `number`
+- wheels?: `number`
+- windowTint?: `number`
+- xenonColor?: `number`
+- neonEnabled?: `boolean[]`
+- neonColor?: `number` or `number[]`
+- extras?: `table`
+- tyreSmokeColor?: `number` or `number[]`
+- modSpoilers?: `number`
+- modFrontBumper?: `number`
+- modRearBumper?: `number`
+- modSideSkirt?: `number`
+- modExhaust?: `number`
+- modFrame?: `number`
+- modGrille?: `number`
+- modHood?: `number`
+- modFender?: `number`
+- modRightFender?: `number`
+- modRoof?: `number`
+- modEngine?: `number`
+- modBrakes?: `number`
+- modTransmission?: `number`
+- modHorns?: `number`
+- modSuspension?: `number`
+- modArmor?: `number`
+- modNitrous?: `number`
+- modTurbo?: `number`
+- modSubwoofer?: `boolean`
+- modSmokeEnabled?: `boolean`
+- modHydraulics?: `boolean`
+- modXenon?: `boolean`
+- modFrontWheels?: `number`
+- modBackWheels?: `number`
+- modCustomTiresF?: `boolean`
+- modCustomTiresR?: `boolean`
+- modPlateHolder?: `number`
+- modVanityPlate?: `number`
+- modTrimA?: `number`
+- modOrnaments?: `number`
+- modDashboard?: `number`
+- modDial?: `number`
+- modDoorSpeaker?: `number`
+- modSeats?: `number`
+- modSteeringWheel?: `number`
+- modShifterLeavers?: `number`
+- modAPlate?: `number`
+- modSpeakers?: `number`
+- modTrunk?: `number`
+- modHydrolic?: `number`
+- modEngineBlock?: `number`
+- modAirFilter?: `number`
+- modStruts?: `number`
+- modArchCover?: `number`
+- modAerials?: `number`
+- modTrimB?: `number`
+- modTank?: `number`
+- modWindows?: `number`
+- modDoorR?: `number`
+- modLivery?: `number`
+- modRoofLivery?: `number`
+- modLightbar?: `number`
+- windows?: `number[]`
+- doors?: `number[]`
+- tyres?: `table`
+- bulletProofTyres?: `boolean`
diff --git a/pages/ox_lib/Modules/Version/Server.mdx b/pages/ox_lib/Modules/Version/Server.mdx
index b11799c5..75d82180 100644
--- a/pages/ox_lib/Modules/Version/Server.mdx
+++ b/pages/ox_lib/Modules/Version/Server.mdx
@@ -8,7 +8,7 @@ import { Tabs, Tab } from 'nextra-theme-docs';
lib.versionCheck(repository)
```
-* repository: `string`
+- repository: `string`
diff --git a/pages/ox_lib/Modules/Version/Shared.mdx b/pages/ox_lib/Modules/Version/Shared.mdx
index 8096f0e6..aadea7ec 100644
--- a/pages/ox_lib/Modules/Version/Shared.mdx
+++ b/pages/ox_lib/Modules/Version/Shared.mdx
@@ -8,8 +8,8 @@ import { Tabs, Tab } from 'nextra-theme-docs';
lib.checkDependency(resource, version)
```
-* resource: `string`
-* version: `string`
+- resource: `string`
+- version: `string`
diff --git a/pages/ox_lib/Modules/Zones/Shared.mdx b/pages/ox_lib/Modules/Zones/Shared.mdx
index ba188dca..0cffed9e 100644
--- a/pages/ox_lib/Modules/Zones/Shared.mdx
+++ b/pages/ox_lib/Modules/Zones/Shared.mdx
@@ -1,7 +1,14 @@
import { Tabs, Tab } from 'nextra-theme-docs';
+import { Callout } from 'nextra/components';
Faster alternative to PolyZone utilising [glm.polygon](https://github.com/citizenfx/lua/blob/luaglm-dev/cfx/EXTENDED.md).
+
+
+Currently zones only have basic support on the server side. Some features will not work such as `onEnter`, `onExit`, and `inside`.
+
+
+
## lib.zones.poly
```lua
@@ -13,9 +20,9 @@ lib.zones.poly(data)
- All z values must match
- thickness?: `number`
- Default: `4`
- - onEnter: `function`(self: `table`)
- - onExit: `function`(self: `table`)
- - inside: `function`(self: `table`)
+ - onEnter: `function(self: table)`
+ - onExit: `function(self: table)`
+ - inside: `function(self: table)`
- debug?: `boolean`
## lib.zones.box
@@ -30,9 +37,9 @@ lib.zones.box(data)
- Default: `vec3(4, 4, 4)`
- rotation?: `number`
- Angle in degrees
- - onEnter: `function`(self: `table`)
- - onExit: `function`(self: `table`)
- - inside: `function`(self: `table`)
+ - onEnter: `function(self: table)`
+ - onExit: `function(self: table)`
+ - inside: `function(self: table)`
- debug?: `boolean`
## lib.zones.sphere
@@ -140,6 +147,7 @@ Zones will be saved to `ox_lib/created_zones.lua` with your chosen format.
+
```lua
local poly = lib.zones.poly({
name = poly,
@@ -150,11 +158,13 @@ Zones will be saved to `ox_lib/created_zones.lua` with your chosen format.
vec(447.2, -995.6, 25.8),
vec(446.3, -997.9, 25.8),
},
- thickness = 2,
+ thickness = 2,
})
```
+
+
```lua
{
name = poly,
@@ -165,11 +175,12 @@ Zones will be saved to `ox_lib/created_zones.lua` with your chosen format.
vec(447.2, -995.6, 25.8),
vec(446.3, -997.9, 25.8),
},
- thickness = 2,
+ thickness = 2,
},
```
+
```lua
exports.ox_target:addPolyZone({
name = poly,
@@ -180,8 +191,9 @@ Zones will be saved to `ox_lib/created_zones.lua` with your chosen format.
vec(447.2, -995.6, 25.8),
vec(446.3, -997.9, 25.8),
},
- thickness = 2,
+ thickness = 2,
})
```
+
diff --git a/pages/oxmysql/Functions/prepare.mdx b/pages/oxmysql/Functions/prepare.mdx
index 4673fe46..40f016a5 100644
--- a/pages/oxmysql/Functions/prepare.mdx
+++ b/pages/oxmysql/Functions/prepare.mdx
@@ -10,7 +10,7 @@ Prepare can be used to execute frequently called queries faster and accepts mult
- TINYINT 1 and BIT will not return a boolean
- You can only use ? value placeholders, ?? column placeholders and named placeholders will throw an error
-Unlike [rawExecute](../rawExecute), the SELECT statement will return a column, row, or array of rows depending on the number of columns and rows selected.
+Unlike [rawExecute](./rawExecute), the SELECT statement will return a column, row, or array of rows depending on the number of columns and rows selected.
## Promise
diff --git a/pages/oxmysql/Functions/rawExecute.mdx b/pages/oxmysql/Functions/rawExecute.mdx
index f0236718..554d0e3f 100644
--- a/pages/oxmysql/Functions/rawExecute.mdx
+++ b/pages/oxmysql/Functions/rawExecute.mdx
@@ -1,3 +1,7 @@
+---
+title: rawExecute
+---
+
import { Tab, Tabs } from 'nextra-theme-docs';
rawExecute can be used to execute frequently called queries faster and accepts multiple sets of parameters to be used with a single query.
@@ -6,7 +10,7 @@ rawExecute can be used to execute frequently called queries faster and accepts m
- TINYINT 1 and BIT will not return a boolean
- You can only use ? value placeholders, ?? column placeholders and named placeholders will throw an error
-Unlike [prepare](../prepare), the SELECT statement will always return an array of rows.
+Unlike [prepare](./prepare), the SELECT statement will always return an array of rows.
When using SELECT, the return value will match `query`, `single`, or `scalar` depending on the number of columns and rows selected.
## Promise
diff --git a/pages/oxmysql/issues.mdx b/pages/oxmysql/issues.mdx
index 99b6033f..7c7e5a14 100644
--- a/pages/oxmysql/issues.mdx
+++ b/pages/oxmysql/issues.mdx
@@ -1,5 +1,5 @@
---
-title: Common issues
+title: Common Issues
---
import { Callout } from 'nextra/components';
diff --git a/pages/oxmysql/ui.mdx b/pages/oxmysql/ui.mdx
index 3a295800..bafccf01 100644
--- a/pages/oxmysql/ui.mdx
+++ b/pages/oxmysql/ui.mdx
@@ -1,5 +1,5 @@
---
-title: Using the debug UI
+title: Using the Debug UI
---
import { Callout } from 'nextra/components';