diff --git a/components/button.tsx b/components/button.tsx
index beb14b34..1b34fc68 100644
--- a/components/button.tsx
+++ b/components/button.tsx
@@ -6,6 +6,7 @@ interface Props {
children?: React.ReactNode;
side?: 'left' | 'right';
link?: string;
+ label?: string;
}
const Button: React.FC = ({ side = 'left', children, icon, link }: Props) => {
@@ -27,7 +28,7 @@ export default Button;
export function GhButton(props: Props) {
return (
} side={props.side} link={props.link}>
- GitHub
+ {props.label || "Github"}
);
}
@@ -35,7 +36,7 @@ export function GhButton(props: Props) {
export function DocButton(props: Props) {
return (
} side={props.side} link={props.link}>
- Documentation
+ {props.label || "Documentation"}
);
}
@@ -43,7 +44,7 @@ export function DocButton(props: Props) {
export function DownloadButton(props: Props) {
return (
} side={props.side} link={props.link}>
- Download
+ {props.label || "Download"}
);
}
@@ -51,7 +52,7 @@ export function DownloadButton(props: Props) {
export function ReleaseButton(props: Props) {
return (
} side={props.side} link={props.link}>
- Releases
+ {props.label || "Releases"}
);
}
@@ -59,7 +60,7 @@ export function ReleaseButton(props: Props) {
export function NpmButton(props: Props) {
return (
} side={props.side} link={props.link}>
- Package
+ {props.label || "Package"}
);
}
diff --git a/pages/guides/git.mdx b/pages/guides/git.mdx
index 4c616cd2..a3af7140 100644
--- a/pages/guides/git.mdx
+++ b/pages/guides/git.mdx
@@ -1,3 +1,5 @@
+# Git
+
Git is a version control system, allowing changes to be effectively tracked, merged, and reverted.
As our resources are hosted on GitHub, it can be incredibly useful to learn how to create your own repository to track changes and keep up-to-date. If you plan on making your own changes to our resources, this will allow you to keep your own changes and prevent loss of data.
diff --git a/pages/guides/nodejs.mdx b/pages/guides/nodejs.mdx
index 7789136d..35391adc 100644
--- a/pages/guides/nodejs.mdx
+++ b/pages/guides/nodejs.mdx
@@ -2,6 +2,8 @@
title: Node.js
---
+# Node.js
+
Node.js is a JavaScript runtime and is used for building applications. In the context of FiveM it is necessary to bundle resources into a single package that can be ran on both the server and client.
- [Download](https://nodejs.org) and install the LTS version of Node.js.
diff --git a/pages/guides/pnpm.mdx b/pages/guides/pnpm.mdx
index ea23f935..1763805a 100644
--- a/pages/guides/pnpm.mdx
+++ b/pages/guides/pnpm.mdx
@@ -2,6 +2,8 @@
title: pnpm
---
+# pnpm
+
pnpm is a fast and disk space efficient package manager, serving as an alternative to npm and yarn.
- Ensure you have [installed Node.js](./nodejs).
diff --git a/pages/guides/vscode.mdx b/pages/guides/vscode.mdx
index 2adfc0ae..d3f2aee7 100644
--- a/pages/guides/vscode.mdx
+++ b/pages/guides/vscode.mdx
@@ -4,6 +4,8 @@ title: VS Code
import { DownloadButton, GhButton, DocButton } from '@components/button';
+# VS Code
+
Visual Studio Code is our recommended editor when working with Lua.
diff --git a/pages/index.mdx b/pages/index.mdx
index 7384ab01..66372d5d 100644
--- a/pages/index.mdx
+++ b/pages/index.mdx
@@ -4,6 +4,8 @@ title: Introduction
import DonateLink from '@components/DonateLink';
+# Introduction
+
Here you can find all of the official documentation for resources developed by the Overextended team.
If you feel like the documentation is lacking in some department then feel free to go onto that page and click the "Edit this page" at the bottom and submit a Pull Request.
diff --git a/pages/ox_core.mdx b/pages/ox_core.mdx
index 1694a8ac..dc2472e2 100644
--- a/pages/ox_core.mdx
+++ b/pages/ox_core.mdx
@@ -3,6 +3,8 @@ import { Callout } from 'nextra/components';
import ResourceLinks from '@components/resource-links';
import { NpmButton } from '@components/button';
+# Ox Core
+
An experimental framework for FiveM. Limited support and breaking changes guaranteed.
diff --git a/pages/ox_core/Player/Client.mdx b/pages/ox_core/Player/Client.mdx
index fcf0eda3..f60b103f 100644
--- a/pages/ox_core/Player/Client.mdx
+++ b/pages/ox_core/Player/Client.mdx
@@ -1,3 +1,5 @@
+# Client
+
When ox_core is imported into a resource it will create the `player` global.
If `player` is nil, then the client has not yet selected a character and spawned.
diff --git a/pages/ox_core/Player/Client/callbacks.mdx b/pages/ox_core/Player/Client/callbacks.mdx
index 83a52c9c..c9c5f7b3 100644
--- a/pages/ox_core/Player/Client/callbacks.mdx
+++ b/pages/ox_core/Player/Client/callbacks.mdx
@@ -2,6 +2,8 @@
title: Callbacks
---
+# Callbacks
+
### ox:getStatus
```lua
diff --git a/pages/ox_core/Player/Client/events.mdx b/pages/ox_core/Player/Client/events.mdx
index 374cd9a3..c37a1a34 100644
--- a/pages/ox_core/Player/Client/events.mdx
+++ b/pages/ox_core/Player/Client/events.mdx
@@ -2,6 +2,8 @@
title: Events
---
+# Events
+
## Client events
### ox:playerLoaded
diff --git a/pages/ox_core/Player/Server.mdx b/pages/ox_core/Player/Server.mdx
index 045ed399..64b5909b 100644
--- a/pages/ox_core/Player/Server.mdx
+++ b/pages/ox_core/Player/Server.mdx
@@ -1,5 +1,7 @@
import { Tabs, Tab } from 'nextra-theme-docs';
+# Server
+
## Ox.GetPlayer
Return an instance of OxPlayer for the given player source.
diff --git a/pages/ox_core/Player/Server/events.mdx b/pages/ox_core/Player/Server/events.mdx
index 543c274e..be29065a 100644
--- a/pages/ox_core/Player/Server/events.mdx
+++ b/pages/ox_core/Player/Server/events.mdx
@@ -2,6 +2,8 @@
title: Events
---
+# Events
+
## Server events
### ox:playerLoaded
diff --git a/pages/ox_core/Player/Server/methods.mdx b/pages/ox_core/Player/Server/methods.mdx
index 75821e3b..03fb2e2f 100644
--- a/pages/ox_core/Player/Server/methods.mdx
+++ b/pages/ox_core/Player/Server/methods.mdx
@@ -4,6 +4,8 @@ title: Methods
import { Tabs, Tab } from 'nextra-theme-docs';
+# Methods
+
These functions are inherited from the [Player class](../Server/).
## player.set
diff --git a/pages/ox_core/Vehicle/Server.mdx b/pages/ox_core/Vehicle/Server.mdx
index 33c81404..c6930a44 100644
--- a/pages/ox_core/Vehicle/Server.mdx
+++ b/pages/ox_core/Vehicle/Server.mdx
@@ -3,6 +3,8 @@ title: Server
sidebar_position: 1
---
+# Server
+
## Ox.GetVehicle
Return an instance of OxVehicle for the given entity.
diff --git a/pages/ox_core/Vehicle/Server/callbacks.mdx b/pages/ox_core/Vehicle/Server/callbacks.mdx
index ed98269b..12d10131 100644
--- a/pages/ox_core/Vehicle/Server/callbacks.mdx
+++ b/pages/ox_core/Vehicle/Server/callbacks.mdx
@@ -2,6 +2,8 @@
title: Callbacks
---
+# Callbacks
+
### ox:getNearbyVehicles
Get all vehicles within range of the target player.
diff --git a/pages/ox_core/Vehicle/Server/methods.mdx b/pages/ox_core/Vehicle/Server/methods.mdx
index 057afbeb..5898e28a 100644
--- a/pages/ox_core/Vehicle/Server/methods.mdx
+++ b/pages/ox_core/Vehicle/Server/methods.mdx
@@ -2,6 +2,8 @@
title: Methods
---
+# Methods
+
These functions are inherited from the [Vehicle class](../Server/).
## vehicle.set
diff --git a/pages/ox_doorlock.mdx b/pages/ox_doorlock.mdx
index 50a80506..9cba4448 100644
--- a/pages/ox_doorlock.mdx
+++ b/pages/ox_doorlock.mdx
@@ -2,6 +2,8 @@ import { Steps } from 'nextra-theme-docs';
import { Callout } from 'nextra/components';
import ResourceLinks from '@components/resource-links';
+# Ox Doorlock
+
A door management resource that can be used standalone or alongside ox_core, qb-core, and es_extended.
diff --git a/pages/ox_doorlock/Client/functions.mdx b/pages/ox_doorlock/Client/functions.mdx
index 75d6cf7a..dfad5eb8 100644
--- a/pages/ox_doorlock/Client/functions.mdx
+++ b/pages/ox_doorlock/Client/functions.mdx
@@ -1,3 +1,5 @@
+# Functions
+
## pickClosestDoor
Attempt to pick the lock of the closest door. Dependant on server-side checks and may fail.
diff --git a/pages/ox_doorlock/Server/events.mdx b/pages/ox_doorlock/Server/events.mdx
index 07c554d1..4d495340 100644
--- a/pages/ox_doorlock/Server/events.mdx
+++ b/pages/ox_doorlock/Server/events.mdx
@@ -1,8 +1,10 @@
-# Triggers
+# Events
+
+## Triggers
These events are safe to trigger and handle in other scripts.
-## ox_doorlock:setState
+### ox_doorlock:setState
Can be triggered to lock or unlock a door.
@@ -13,11 +15,11 @@ TriggerEvent('ox_doorlock:setState', doorId, state)
- doorId: `number`
- state: `0` or `1`
-# Handlers
+## Handlers
These events shouldn't be triggered by any other scripts.
-## ox_doorlock:stateChanged
+### ox_doorlock:stateChanged
Triggered when a doors state is updated.
diff --git a/pages/ox_doorlock/Server/functions.mdx b/pages/ox_doorlock/Server/functions.mdx
index 1489debc..4f67d34a 100644
--- a/pages/ox_doorlock/Server/functions.mdx
+++ b/pages/ox_doorlock/Server/functions.mdx
@@ -1,3 +1,5 @@
+# Functions
+
Gets data for a door with the given id, matching the id for the database entry.
## getDoor
diff --git a/pages/ox_doorlock/settings.mdx b/pages/ox_doorlock/settings.mdx
index 1d14a57b..3668d4c0 100644
--- a/pages/ox_doorlock/settings.mdx
+++ b/pages/ox_doorlock/settings.mdx
@@ -1,7 +1,9 @@
---
-title: Door settings
+title: Door Settings
---
+# Door Settings
+
## General
- Door name
diff --git a/pages/ox_fuel.mdx b/pages/ox_fuel.mdx
index 66d8ccd8..d82cfdf8 100644
--- a/pages/ox_fuel.mdx
+++ b/pages/ox_fuel.mdx
@@ -1,6 +1,8 @@
import { Steps } from 'nextra-theme-docs';
import ResourceLinks from '@components/resource-links';
+# Ox Fuel
+
A simple fuel resource meant to replace LegacyFuel or serve as a showcase for using petrol cans as an item.
diff --git a/pages/ox_fuel/Client/functions.mdx b/pages/ox_fuel/Client/functions.mdx
index 4c4f5a76..93939ce2 100644
--- a/pages/ox_fuel/Client/functions.mdx
+++ b/pages/ox_fuel/Client/functions.mdx
@@ -1,3 +1,5 @@
+# Functions
+
## setMoneyCheck
Override the built-in money check.
diff --git a/pages/ox_fuel/Server/functions.mdx b/pages/ox_fuel/Server/functions.mdx
index 1cafec64..01d346a6 100644
--- a/pages/ox_fuel/Server/functions.mdx
+++ b/pages/ox_fuel/Server/functions.mdx
@@ -1,3 +1,5 @@
+# Functions
+
## setPaymentMethod
Override the built-in payment method.
diff --git a/pages/ox_inventory.mdx b/pages/ox_inventory.mdx
index 99e24d36..cc287e9c 100644
--- a/pages/ox_inventory.mdx
+++ b/pages/ox_inventory.mdx
@@ -2,6 +2,8 @@ import ResourceLinks from '@components/resource-links';
import { Steps, Tabs, Tab } from 'nextra-theme-docs';
import { Callout } from 'nextra/components';
+# Ox Inventory
+
A slot-based inventory with item metadata for "item uniqueness".
diff --git a/pages/ox_inventory/Events/Client.mdx b/pages/ox_inventory/Events/Client.mdx
index e32f6782..b2ab1908 100644
--- a/pages/ox_inventory/Events/Client.mdx
+++ b/pages/ox_inventory/Events/Client.mdx
@@ -1,10 +1,14 @@
-# Client events
+import { Callout } from 'nextra/components';
+
+# Client
This is not a comprehensive list of events and is missing events intended for internal use only.
-## Triggers
+## Event Triggers
-These events are safe to trigger and handle in other scripts.
+
+ These events **are safe** to trigger and handle in other scripts.
+
### ox_inventory:disarm
@@ -14,14 +18,20 @@ Can be triggered to force the player to disarm.
TriggerClientEvent('ox_inventory:disarm', playerId, noAnim)
```
-## Handlers
+- playerId: `number`
+- noAnim: `boolean`
+ - If `true`, disarm animation will be skipped
-These events shouldn't be triggered by any other scripts.
+## Event Handlers
+
+
+ These events **should not** be triggered by any other scripts.
+
### ox_inventory:updateInventory
Triggered after inventory slots have been updated, included on load.
-Changes is a table containing all updated slot data indexed by slotId. Empty slots are "false".
+Changes is a table containing all updated slot data indexed by slotId. Empty slots are `false`.
```lua
AddEventHandler('ox_inventory:updateInventory', function(changes) end)
@@ -47,3 +57,6 @@ _Note: Not available for ESX, use esx:addInventoryItem or esx:removeInventoryIte
```lua
AddEventHandler('ox_inventory:itemCount', function(itemName, totalCount) end)
```
+
+- itemName: `string`
+- totalCount: `number`
diff --git a/pages/ox_inventory/Events/Server.mdx b/pages/ox_inventory/Events/Server.mdx
index ebbf5506..8bceb83e 100644
--- a/pages/ox_inventory/Events/Server.mdx
+++ b/pages/ox_inventory/Events/Server.mdx
@@ -1,10 +1,14 @@
-# Server events
+import { Callout } from 'nextra/components';
+
+# Server
This is not a comprehensive list of events and is missing events intended for internal use only.
## Handlers
-These events shouldn't be triggered by any other scripts.
+
+ These events **should not** be triggered by any other scripts.
+
### ox_inventory:openedInventory
@@ -22,5 +26,5 @@ AddEventHandler('ox_inventory:openedInventory', function(playerId, inventoryId)
Triggered after an inventory is closed by a player.
```lua
-AddEventHandler('ox_inventory:closeInventory', function(playerId, inventoryId) end)
+AddEventHandler('ox_inventory:closeInventory', function() end)
```
diff --git a/pages/ox_inventory/Frameworks/esx.mdx b/pages/ox_inventory/Frameworks/esx.mdx
index bbdb0953..4caa36ad 100644
--- a/pages/ox_inventory/Frameworks/esx.mdx
+++ b/pages/ox_inventory/Frameworks/esx.mdx
@@ -4,6 +4,8 @@ title: ESX
import { Tabs, Tab } from 'nextra-theme-docs';
+# ESX
+
## Compatibility
Ox Inventory is a complete replacement for existing item, inventory, and weapon systems; it is inherently incompatible with ESX and any resources that rely on default behaviour.
@@ -31,7 +33,7 @@ start ox_inventory
- Optionally, type `convertinventory esxproperty` into the server console.
- Restart the server once conversion is complete.
-## Optional optimisation
+## Optional Optimisation
All item related functions from xPlayer, such as `xPlayer.getInventoryItem`, have been modified for compatibility purposes; however they are considered deprecated.
@@ -40,35 +42,31 @@ The reasoning is fairly simple - there's now additional function references and
You should read through the functions section for further information, but the following should give you a decent idea.
-
+
+ ```lua
+ if xPlayer.getInventoryItem('acetone').count > 2 and xPlayer.getInventoryItem('antifreeze').count > 4 and xPlayer.getInventoryItem('sudo').count > 9 then
+ xPlayer.removeInventoryItem("acetone", 3)
+ xPlayer.removeInventoryItem("antifreeze", 5)
+ xPlayer.removeInventoryItem("sudo", 10)
+ end
+ ```
+
+
+ Add the following code somewhere in your resource to cache the exports metatable.
-```lua
-if xPlayer.getInventoryItem('acetone').count > 2 and xPlayer.getInventoryItem('antifreeze').count > 4 and xPlayer.getInventoryItem('sudo').count > 9 then
- xPlayer.removeInventoryItem("acetone", 3)
- xPlayer.removeInventoryItem("antifreeze", 5)
- xPlayer.removeInventoryItem("sudo", 10)
-end
-```
+ ```lua
+ local ox_inventory = exports.ox_inventory
+ ```
-
-
+ You will be able to reference any functions exposed through the export.
-Add the following code somewhere in your resource to cache the exports metatable.
-
-```lua
-local ox_inventory = exports.ox_inventory
-```
-
-You will be able to reference any functions exposed through the export.
-
-```lua
-local items = ox_inventory:Search(source, 'count', {'acetone', 'antifreeze', 'sudo'})
-if items and items.acetone > 2 and items.antifreeze > 4 and items.sudo > 9 then
- ox_inventory:RemoveItem(source, 'acetone', 3)
- ox_inventory:RemoveItem(source, 'antifreeze', 5)
- ox_inventory:RemoveItem(source, 'sudo', 10)
-end
-```
-
-
+ ```lua
+ local items = ox_inventory:Search(source, 'count', {'acetone', 'antifreeze', 'sudo'})
+ if items and items.acetone > 2 and items.antifreeze > 4 and items.sudo > 9 then
+ ox_inventory:RemoveItem(source, 'acetone', 3)
+ ox_inventory:RemoveItem(source, 'antifreeze', 5)
+ ox_inventory:RemoveItem(source, 'sudo', 10)
+ end
+ ```
+
diff --git a/pages/ox_inventory/Frameworks/qb.mdx b/pages/ox_inventory/Frameworks/qb.mdx
index 08baf42f..791821dc 100644
--- a/pages/ox_inventory/Frameworks/qb.mdx
+++ b/pages/ox_inventory/Frameworks/qb.mdx
@@ -5,10 +5,10 @@ title: QBCore
import { Callout } from 'nextra/components';
import { Tabs, Tab } from 'nextra-theme-docs';
+# QBCore
+
-
-QBCore support is experimental and cannot work as a "drag and drop" solution due to many incompatibilities.
-
+ QBCore support is experimental and cannot work as a "drag and drop" solution due to many incompatibilities.
## Compatibility
@@ -43,7 +43,7 @@ If you have existing player data, you will need to convert it to a compatible fo
- Start the server and type `convertinventory qb` into the server console.
- Restart the server once conversion is complete.
-## Optional optimisation
+## Optional Optimisation
All item related functions from Player, such as `Player.Functions.GetItemByName`, have been modified for compatibility purposes; however they are considered deprecated.
@@ -52,38 +52,34 @@ The reasoning is fairly simple - there's now additional function references and
You should read through the functions section for further information, but the following should give you a decent idea.
-
+
+ ```lua
+ local acetone = Player.Functions.GetItemByName('acetone')
+ local antifreeze = Player.Functions.GetItemByName('antifreeze')
+ local sudo = Player.Functions.GetItemByName('sudo')
+ if acetone?.amount > 2 and antifreeze?.amount > 4 and sudo?.amount > 9 then
+ Player.Functions.RemoveItem("acetone", 3)
+ Player.Functions.RemoveItem("antifreeze", 5)
+ Player.Functions.RemoveItem("sudo", 10)
+ end
+ ```
+
+
+ Add the following code somewhere in your resource to cache the exports metatable.
-```lua
-local acetone = Player.Functions.GetItemByName('acetone')
-local antifreeze = Player.Functions.GetItemByName('antifreeze')
-local sudo = Player.Functions.GetItemByName('sudo')
-if acetone?.amount > 2 and antifreeze?.amount > 4 and sudo?.amount > 9 then
- Player.Functions.RemoveItem("acetone", 3)
- Player.Functions.RemoveItem("antifreeze", 5)
- Player.Functions.RemoveItem("sudo", 10)
-end
-```
+ ```lua
+ local ox_inventory = exports.ox_inventory
+ ```
-
-
+ You will be able to reference any functions exposed through the export.
-Add the following code somewhere in your resource to cache the exports metatable.
-
-```lua
-local ox_inventory = exports.ox_inventory
-```
-
-You will be able to reference any functions exposed through the export.
-
-```lua
-local items = ox_inventory:Search(source, 'count', {'acetone', 'antifreeze', 'sudo'})
-if items and items.acetone > 2 and items.antifreeze > 4 and items.sudo > 9 then
- ox_inventory:RemoveItem(source, 'acetone', 3)
- ox_inventory:RemoveItem(source, 'antifreeze', 5)
- ox_inventory:RemoveItem(source, 'sudo', 10)
-end
-```
-
-
+ ```lua
+ local items = ox_inventory:Search(source, 'count', {'acetone', 'antifreeze', 'sudo'})
+ if items and items.acetone > 2 and items.antifreeze > 4 and items.sudo > 9 then
+ ox_inventory:RemoveItem(source, 'acetone', 3)
+ ox_inventory:RemoveItem(source, 'antifreeze', 5)
+ ox_inventory:RemoveItem(source, 'sudo', 10)
+ end
+ ```
+
diff --git a/pages/ox_inventory/Functions/Client.mdx b/pages/ox_inventory/Functions/Client.mdx
index 6586be68..93d61276 100644
--- a/pages/ox_inventory/Functions/Client.mdx
+++ b/pages/ox_inventory/Functions/Client.mdx
@@ -1,5 +1,7 @@
import { Tabs, Tab } from 'nextra-theme-docs';
+# Client
+
## openInventory
Opens an inventory using the passed data.
@@ -20,46 +22,42 @@ exports.ox_inventory:openInventory(invType, data)
- `'dumpster'`
- data: `number` or `string` or `table`
+### Examples
+
-
+
+ Open the target player's inventory.
-**Open the target player's inventory.**
+ ```lua
+ exports.ox_inventory:openInventory('player', 3)
+ ```
+
+
+ Open the fourth "General Store" [location](https://github.com/overextended/ox_inventory/blob/main/data/shops.lua#L14).
-```lua
-exports.ox_inventory:openInventory('player', 3)
-```
+ ```lua
+ exports.ox_inventory:openInventory('shop', { type = 'General', id = 4 })
+ ```
+
+
+ Open the first stash in [data/stashes](https://github.com/overextended/ox_inventory/blob/main/data/stashes.lua#L2-L19).
-
-
+ ```lua
+ exports.ox_inventory:openInventory('stash', 1)
+ ```
-**Open the fourth "General Store" [location](https://github.com/overextended/ox_inventory/blob/main/data/shops.lua#L14).**
+ Open a custom stash (created on the server with RegisterStash).
-```lua
-exports.ox_inventory:openInventory('shop', { type = 'General', id = 4 })
-```
+ ```lua
+ exports.ox_inventory:openInventory('stash', 'society_police')
+ ```
-
-
+ Open a stash with a specific owner.
-**Open the first stash in [data/stashes](https://github.com/overextended/ox_inventory/blob/main/data/stashes.lua#L2-L19).**
-
-```lua
-exports.ox_inventory:openInventory('stash', 1)
-```
-
-**Open a custom stash (created on the server with RegisterStash).**
-
-```lua
-exports.ox_inventory:openInventory('stash', 'society_police')
-```
-
-**Open a stash with a specific owner.**
-
-```lua
-exports.ox_inventory:openInventory('stash', { id = 'police_locker', owner = 'license:xxxxxxxx' })
-```
-
-
+ ```lua
+ exports.ox_inventory:openInventory('stash', { id = 'police_locker', owner = 'license:xxxxxxxx' })
+ ```
+
## openNearbyInventory
@@ -157,7 +155,7 @@ exports.ox_inventory:setStashTarget(id, owner)
- Stash id.
- owner?: `string` or `number`
-**Example:**
+### Example
```lua
exports.ox_inventory:setStashTarget('motel5', 'bobsmith')
@@ -208,7 +206,7 @@ exports.ox_inventory:displayMetadata(metadata, value)
- value?: `string`
- Label for the string metadata property to be displayed.
-**Example:**
+### Example
```lua
exports.ox_inventory:displayMetadata('mustard', 'Mustard')
@@ -250,68 +248,64 @@ exports.ox_inventory:Search(search, item, metadata)
- metadata?: `table` or `string`
- If metadata is provided as a string it will search the item's `metadata.type` property.
-**Count**
+### Count
-
+
+ ```lua
+ local count = exports.ox_inventory:Search('count', 'water')
+ print('You have '..count.. ' water')
+ ```
+
+
+ ```lua
+ local inventory = exports.ox_inventory:Search('count', {'meat', 'skin'}, {grade="1"})
-```lua
-local count = exports.ox_inventory:Search('count', 'water')
-print('You have '..count.. ' water')
-```
-
-
-
-
-```lua
-local inventory = exports.ox_inventory:Search('count', {'meat', 'skin'}, {grade="1"})
-
-if inventory then
- for name, count in pairs(inventory) do
- print('You have '..count..' '..name)
+ if inventory then
+ for name, count in pairs(inventory) do
+ print('You have '..count..' '..name)
+ end
end
-end
-```
-
-
+ ```
+
-**Slots**
+### Slots
-
+
+ ```lua
+ local water = exports.ox_inventory:Search('slots', 'water')
+ local count = 0
-```lua
-local water = exports.ox_inventory:Search('slots', 'water')
-local count = 0
-for _, v in pairs(water) do
- print(v.slot..' contains '..v.count..' water '..json.encode(v.metadata))
- count = count + v.count
-end
-print('You have '..count..' water')
-```
-
-
-
-
-```lua
-local items = exports.ox_inventory:Search('slots', {'meat', 'skin'}, 'deer')
-
-if items then
- for name, data in pairs(items) do
- local count = 0
- for _, v in pairs(data) do
- if v.slot then
- print(v.slot..' contains '..v.count..' '..name..' '..json.encode(v.metadata))
- count = count + v.count
- end
- end
- print('You have '..count..' '..name)
+ for _, v in pairs(water) do
+ print(v.slot..' contains '..v.count..' water '..json.encode(v.metadata))
+ count = count + v.count
end
-end
-```
-
+ print('You have '..count..' water')
+ ```
+
+
+ ```lua
+ local items = exports.ox_inventory:Search('slots', {'meat', 'skin'}, 'deer')
+
+ if items then
+ for name, data in pairs(items) do
+ local count = 0
+
+ for _, v in pairs(data) do
+ if v.slot then
+ print(v.slot..' contains '..v.count..' '..name..' '..json.encode(v.metadata))
+ count = count + v.count
+ end
+ end
+
+ print('You have '..count..' '..name)
+ end
+ end
+ ```
+
## GetItemCount
@@ -327,7 +321,8 @@ exports.ox_inventory:GetItemCount(itemName, metadata, strict)
- strict?: `boolean`
- Strictly match metadata properties, otherwise use partial matching.
-**Returns:** `number`
+Return:
+- count: `number`
## GetPlayerItems
@@ -337,7 +332,8 @@ Get all items in the player's inventory.
exports.ox_inventory:GetPlayerItems()
```
-**Returns:** `table`
+Return:
+- items: `table`
## GetPlayerWeight
@@ -347,7 +343,8 @@ Get the total weight of all items in the player's inventory.
exports.ox_inventory:GetPlayerWeight()
```
-**Returns:** `number`
+Return:
+- totalWeight: `number`
## GetPlayerMaxWeight
@@ -357,7 +354,8 @@ Get the maximum carry weight of the player's inventory.
exports.ox_inventory:GetPlayerMaxWeight()
```
-**Returns:** `number`
+Return:
+- maxWeight: `number`
## GetSlotIdWithItem
@@ -372,7 +370,8 @@ exports.ox_inventory:GetSlotIdWithItem(itemName, metadata, strict)
- strict?: `boolean`
- Strictly match metadata properties, otherwise use partial matching.
-**Returns:** `number?`
+Return:
+- slotId: `number?`
## GetSlotsIdWithItem
@@ -387,7 +386,8 @@ exports.ox_inventory:GetSlotIdsWithItem(itemName, metadata, strict)
- strict?: `boolean`
- Strictly match metadata properties, otherwise use partial matching.
-**Returns:** `number[]?`
+Return:
+- slotIds: `number[]?`
## GetSlotWithItem
@@ -402,7 +402,8 @@ exports.ox_inventory:GetSlotWithItem(itemName, metadata, strict)
- strict?: `boolean`
- Strictly match metadata properties, otherwise use partial matching.
-**Returns:** `table?`
+Return:
+- slotData: `table?`
## GetSlotsWithItem
@@ -417,7 +418,8 @@ exports.ox_inventory:GetSlotsWithItem(itemName, metadata, strict)
- strict?: `boolean`
- Strictly match metadata properties, otherwise use partial matching.
-**Returns:** `table[]?`
+Return:
+- slotsData: `table[]?`
## Statebags
@@ -438,7 +440,7 @@ else
end
```
-**Disable opening inventory**
+#### Disable opening inventory
```lua
LocalPlayer.state.invBusy = true
diff --git a/pages/ox_inventory/Functions/Server.mdx b/pages/ox_inventory/Functions/Server.mdx
index 133aa262..96bae410 100644
--- a/pages/ox_inventory/Functions/Server.mdx
+++ b/pages/ox_inventory/Functions/Server.mdx
@@ -1,6 +1,8 @@
import { Tabs, Tab } from 'nextra-theme-docs';
import { Callout } from 'nextra/components';
+# Server
+
## setPlayerInventory
Creates and sets the player's inventory.
@@ -40,44 +42,35 @@ exports.ox_inventory:forceOpenInventory(playerId, invType, data)
- data: `number` or `string` or `table`
-
+
+ Open the target player's inventory.
-**Open the target player's inventory.**
+ ```lua
+ exports.ox_inventory:forceOpenInventory(1, 'player', 3)
+ ```
-```lua
-exports.ox_inventory:forceOpenInventory(1, 'player', 3)
-```
+ Admin command to open a player's inventory.
-**Admin command to open a player's inventory.**
+ ```lua
+ RegisterCommand('openplayerinv', function(source, args)
+ exports.ox_inventory:forceOpenInventory(source, 'player', tonumber(args[1]))
+ end, true)
+ ```
+
+
-```lua
-RegisterCommand('openplayerinv', function(source, args)
- exports.ox_inventory:forceOpenInventory(source, 'player', tonumber(args[1]))
-end, true)
-```
+ Open a custom stash (created on the server with RegisterStash).
-
-
+ ```lua
+ exports.ox_inventory:forceOpenInventory(1, 'stash', 'society_police')
+ ```
-**Open the first stash in [data/stashes](https://github.com/overextended/ox_inventory/blob/main/data/stashes.lua#L2-L19).**
+ Open a stash with a specific owner.
-```lua
-exports.ox_inventory:forceOpenInventory(1, 'stash', 'apartment420')
-```
-
-**Open a custom stash (created on the server with RegisterStash).**
-
-```lua
-exports.ox_inventory:forceOpenInventory(1, 'stash', 'society_police')
-```
-
-**Open a stash with a specific owner.**
-
-```lua
-exports.ox_inventory:forceOpenInventory(1, 'stash', { id = 'police_locker', owner = 'license:xxxxxxxx' })
-```
-
-
+ ```lua
+ exports.ox_inventory:forceOpenInventory(1, 'stash', { id = 'police_locker', owner = 'license:xxxxxxxx' })
+ ```
+
## UpdateVehicle
@@ -103,6 +96,7 @@ The following snippet can be used in crafting resources such as okokCrafting or
```lua
local itemNames
+
ESX.RegisterServerCallback('crafting:itemNames', function(source, cb)
if not itemNames then
itemNames = {}
@@ -118,7 +112,7 @@ end)
Adds an item into the specified inventory.
-Should be used alongside [CanCarryItem](./CanCarryItem.md) otherwise, the maximum weight may be exceeded.
+Should be used alongside [CanCarryItem](#cancarryitem) otherwise, the maximum weight may be exceeded.
```lua
exports.ox_inventory:AddItem(inv, item, count, metadata, slot, cb)
@@ -143,7 +137,13 @@ If used for glovebox, trunk or stash you must first check the inventory is loade
Returns `success, response` if cb is undefined, otherwise they are used in the callback only.
-**Example:**
+**Possible value of the "response" argument, on failure:**
+
+- "invalid_item": the item doesn't exist
+- "invalid_inventory": the inventory doesn't exist
+- "inventory_full": no free slots
+
+### Example
```lua
local success, response = exports.ox_inventory:AddItem('gloveVGH283', 'bread', 4)
@@ -168,12 +168,6 @@ print(json.encode(response, {indent=true}))
]]
```
-**Possible value of the "response" argument, on failure:**
-
-- "invalid_item": the item doesn't exist
-- "invalid_inventory": the inventory doesn't exist
-- "inventory_full": no free slots
-
## RemoveItem
Removes the specified item from the specified inventory.
@@ -205,7 +199,7 @@ Returns success: `boolean`, response: `string?`.
- "invalid_inventory": the inventory doesn't exist
- "not_enough_items": inventory did not contain enough of the given item
-**Example:**
+### Example
```lua
-- Removes 2 water from the glovebox for the given plate.
@@ -232,7 +226,7 @@ how many times the item was found.
Otherwise returns the data related to the item _and_ its total count found in the inventory.
-**Example**:
+### Example
```lua
local item = ox_inventory:GetItem(source, 'water', nil, false)
@@ -287,7 +281,7 @@ exports.ox_inventory:CanCarryItem(inv, item, count, metadata)
- metadata?: `table` or `string`
- If metadata is passed as string then `metadata.type` will be checked.
-**Example:**
+### Example
```lua
-- Checks if the player calling the event can carry 3 water items
@@ -310,7 +304,7 @@ exports.ox_inventory:CanCarryAmount(inv, item)
- item: `table` or `string`
- Can be array to check multiple items.
-Example:
+### Example
```lua
-- Checks how much you can carry
@@ -359,7 +353,7 @@ exports.ox_inventory:SetMaxWeight(inv, maxWeight)
- inv: `table` or `string` or `number`
- maxWeight: `number`
-**Example:**
+### Example
```lua
local ox_inventory = exports.ox_inventory
@@ -396,7 +390,8 @@ exports.ox_inventory:GetItemCount(inv, itemName, metadata, strict)
- strict?: `boolean`
- Strictly match metadata properties, otherwise use partial matching.
-**Returns:** `number`
+Return:
+- itemCount: `number`
## GetItemSlots
@@ -422,7 +417,7 @@ exports.ox_inventory:GetSlot(inv, slot)
- inv: `table` or `string` or `number`
- slot: `number`
-**Example:**
+### Example
```lua
local slot = exports.ox_inventory:GetSlot(source, 1)
@@ -454,11 +449,12 @@ exports.ox_inventory:GetSlotForItem(inv, itemName, metadata)
- itemName: `string`
- metadata: `table?`
-**Returns:** `number?`
+Return:
+- slotId: `number?`
## GetSlotIdWithItem
-Get a slot id in an inventory matching the given name and metadata.
+Get a slot id in an inventory matching the given item name and metadata.
```lua
exports.ox_inventory:GetSlotIdWithItem(inv, itemName, metadata, strict)
@@ -470,7 +466,8 @@ exports.ox_inventory:GetSlotIdWithItem(inv, itemName, metadata, strict)
- strict?: `boolean`
- Strictly match metadata properties, otherwise use partial matching.
-**Returns:** `number?`
+Return:
+- slotId: `number?`
## GetSlotIdsWithItem
@@ -486,7 +483,8 @@ exports.ox_inventory:GetSlotIdsWithItem(inv, itemName, metadata, strict)
- strict?: `boolean`
- Strictly match metadata properties, otherwise use partial matching.
-**Returns:** `number[]?`
+Return:
+- slotIds: `number[]?`
## GetSlotWithItem
@@ -502,7 +500,8 @@ exports.ox_inventory:GetSlotWithItem(inv, itemName, metadata, strict)
- strict?: `boolean`
- Strictly match metadata properties, otherwise use partial matching.
-**Returns:** `table?`
+Return:
+- slotData: `table?`
## GetSlotsWithItem
@@ -518,7 +517,8 @@ exports.ox_inventory:GetSlotsWithItem(inv, itemName, metadata, strict)
- strict?: `boolean`
- Strictly match metadata properties, otherwise use partial matching.
-**Returns:** `table[]?`
+Return:
+- slotsData: `table[]?`
## GetEmptySlot
@@ -530,7 +530,8 @@ exports.ox_inventory:GetEmptySlot(inv)
- inv: `table` or `string` or `number`
-**Returns:** `number?`
+Return:
+- slotId: `number?`
## GetContainerFromSlot
@@ -543,7 +544,8 @@ exports.ox_inventory:GetContainerFromSlot(inv, slotId)
- inv: `table` or `string` or `number`
- slotId: `number`
-**Returns:** `table?`
+Return:
+- containerData: `table?`
## SetSlotCount
@@ -556,7 +558,7 @@ exports.ox_inventory:SetSlotCount(inv, slots)
- inv: `table` or `string` or `number`
- slots: `number`
-**Example:**
+### Example
```lua
local ox_inventory = exports.ox_inventory
@@ -576,7 +578,7 @@ exports.ox_inventory:GetInventory(inv, owner)
- inv: `number` or `table`
- owner?: `string` or `boolean`
-**Example:**
+### Example
```lua
local inventory = exports.ox_inventory:GetInventory('example_stash', false)
@@ -606,7 +608,7 @@ exports.ox_inventory:GetInventoryItems(inv, owner)
- inv: `number` or `table`
- owner?: `string` or `boolean`
-**Example:**
+### Example
```lua
local playerItems = exports.ox_inventory:GetInventoryItems(source)
@@ -616,7 +618,7 @@ local playerItems = exports.ox_inventory:GetInventoryItems(source)
Clears a player's inventory and saves it to a stash.
-Use [ReturnInventory](./Server/#returninventory) to return the confiscated inventory back to
+Use [ReturnInventory](#returninventory) to return the confiscated inventory back to
the player.
```lua
@@ -629,7 +631,7 @@ exports.ox_inventory:ConfiscateInventory(source)
Returns the confiscated inventory back to the player.
-Use it alongside [ConfiscateInventory](./Server/#confiscateinventory.md).
+Use it alongside [ConfiscateInventory](#confiscateinventory).
```lua
exports.ox_inventory:ReturnInventory(source)
@@ -702,14 +704,12 @@ exports.ox_inventory:RegisterStash(id, label, slots, maxWeight, owner, groups, c
- coords?: `vector3` or `vector3[]`
-
-This function needs to be triggered before a player can open the stash.
-
+ This function needs to be triggered before a player can open the stash.
-**Example:**
+### Example
-For a use case example on this function check out the written [Guide](../../../Guides/stashes.md) for it.
+For a use case example on this function check out the written [Guide](../Guides/stashes) for it.
## CreateTemporaryStash
@@ -736,10 +736,9 @@ exports.ox_inventory:CreateTemporaryStash(properties)
- An array of tables, containing a sequence of itemName, count, metadata.
Return:
-
- inventoryId: `string`
-**Example**
+### Example
```lua
local mystash = exports.ox_inventory:CreateTemporaryStash({
@@ -800,10 +799,9 @@ exports.ox_inventory:CreateDropFromPlayer(playerId)
- playerId: `number`
Return:
-
- dropId: `string`
-**Example**
+### Example
```lua
local dropId = exports.ox_inventory:CreateDropFromPlayer(1)
@@ -834,7 +832,7 @@ exports.ox_inventory:SetDurability(inv, slot, durability)
- slot: `number`
- durability: `number`
-**Example:**
+### Example
```lua
local ox_inventory = exports.ox_inventory
@@ -862,7 +860,7 @@ ox_inventory:SetMetadata(inv, slot, metadata)
- slot: `number`
- metadata: `table`
-**Example:**
+### Example
```lua
local ox_inventory = exports.ox_inventory
diff --git a/pages/ox_inventory/Functions/Server/Hooks.mdx b/pages/ox_inventory/Functions/Server/Hooks.mdx
index 0ae842a5..712844c4 100644
--- a/pages/ox_inventory/Functions/Server/Hooks.mdx
+++ b/pages/ox_inventory/Functions/Server/Hooks.mdx
@@ -1,4 +1,4 @@
-# Event Hooks
+# Hooks
Event hooks allow 3rd party resources to define new behaviour without modifying the inventory code directly.
@@ -29,19 +29,20 @@ Return:
Triggered when moving any item from one slot to another, or when "giving" an item.
By returning `false`, you can cancel the action and revert the inventory state.
-**Payload:**
+- Payload: `table`
+ - source: `number`
+ - action: `'move'` or `'stack'` or `'swap'` or `'give'`
+ - fromInventory: `table` or `string` or `number`
+ - toInventory: `table` or `string` or `number`
+ - fromType: `string`
+ - toType: `string`
+ - fromSlot: `table`
+ - toSlot?: `table` or `number`
+ - count: `number`
-- source: `number`
-- action: `'move'` or `'stack'` or `'swap'` or `'give'`
-- fromInventory: `table` or `string` or `number`
-- toInventory: `table` or `string` or `number`
-- fromType: `string`
-- toType: `string`
-- fromSlot: `table`
-- toSlot?: `table` or `number`
-- count: `number`
+**Example**
-**Example:**
+Blacklists "water" from being moved into or from gloveboxes and trunks.
```lua
local hookId = exports.ox_inventory:registerHook('swapItems', function(payload)
@@ -59,20 +60,19 @@ end, {
})
```
-Blacklists "water" from being moved into or from gloveboxes and trunks.
+openInventory
-### openInventory
-
-**Payload:**
-
-- source: `number`
-- inventoryId: `number` or `string`
-- inventoryType: `string`
+- Payload: `table`
+ - source: `number`
+ - inventoryId: `number` or `string`
+ - inventoryType: `string`
Triggered when a player tries to open a secondary inventory.
By returning `false`, you can cancel the action and keep the player's inventory closed.
-**Example:**
+**Example**
+
+Disables gloveboxes and trunks.
```lua
local hookId = exports.ox_inventory:registerHook('openInventory', function(payload)
@@ -87,21 +87,20 @@ end, {
})
```
-Disables gloveboxes and trunks.
-
### createItem
-**Payload:**
-
-- inventoryId?: `number` or `string`
-- metadata: `table`
-- item: `table`
-- count: `number`
+- Payload: `table`
+ - inventoryId?: `number` or `string`
+ - metadata: `table`
+ - item: `table`
+ - count: `number`
Triggered when an item is created, either by buying it, using AddItem, or when converting inventory data.
By returning a table you can modify or replace the metadata given to an item.
-**Example:**
+**Example**
+
+Sets the label for "water" to "Mineral Water".
```lua
local hookId = exports.ox_inventory:registerHook('createItem', function(payload)
@@ -117,26 +116,26 @@ end, {
})
```
-Sets the label for "water" to "Mineral Water".
-
### buyItem
-**Payload:**
-- source: `number`
-- shopType: `string`
-- shopId: `number`
-- toInventory: `number`
-- toSlot: `number`
-- itemName: `string`
-- metadata: `table`
-- count: `number`
-- price: `number`
-- totalPrice: `number`
-- currency?: `string`
+- Payload: `table`
+ - source: `number`
+ - shopType: `string`
+ - shopId: `number`
+ - toInventory: `number`
+ - toSlot: `number`
+ - itemName: `string`
+ - metadata: `table`
+ - count: `number`
+ - price: `number`
+ - totalPrice: `number`
+ - currency?: `string`
Triggered when an item is about to be purchased and can return `false` to prevent the transaction.
-**Example:**
+**Example**
+
+Prevents players from purchasing items at General stores.
```lua
local hookId = exports.ox_inventory:registerHook('buyItem', function(payload)
@@ -151,26 +150,25 @@ end, {
```
-Prevents players from purchasing items at General stores.
-
### craftItem
-**Payload:**
+- Payload: `table`
+ - source: `number`
+ - benchId: `number`
+ - benchIndex: `number`
+ - recipe: `table`
+ - count: `number`
+ - duration: `number`
+ - ingredients: `table`
+ - name: `string`
+ - slot: `number`
+ - weight: `number`
+ - toInventory: `number`
+ - toSlot: `number`
-- source: `number`
-- benchId: `number`
-- benchIndex: `number`
-- recipe: `table`
- - count: `number`
- - duration: `number`
- - ingredients: `table`
- - name: `string`
- - slot: `number`
- - weight: `number`
-- toInventory: `number`
-- toSlot: `number`
+**Example**
-**Example:**
+Prevent lockpicks from being crafted by players.
```lua
local hookId = exports.ox_inventory:registerHook('craftItem', function(payload)
@@ -185,15 +183,13 @@ end, {
```
-Prevent lockpicks from being crafted by players.
-
## removeHooks
+Removes a hook created by the invoking resource with the the specified id.
+If no id is specified then all hooks registered by the resource are removed.
+
```lua
exports.ox_inventory:removeHooks(id)
```
- id?: `number`
-
-Removes a hook created by the invoking resource with the the specified id.
-If no id is specified then all hooks registered by the resource are removed.
diff --git a/pages/ox_inventory/Guides/crafting.mdx b/pages/ox_inventory/Guides/crafting.mdx
index e9199a33..d06be97f 100644
--- a/pages/ox_inventory/Guides/crafting.mdx
+++ b/pages/ox_inventory/Guides/crafting.mdx
@@ -2,6 +2,8 @@
title: Crafting
---
+# Crafting
+
Crafting locations, items and their ingredients are defined in [data/crafting.lua](https://github.com/overextended/ox_inventory/blob/main/data/crafting.lua).
## Crafting definition
diff --git a/pages/ox_inventory/Guides/creatingItems.mdx b/pages/ox_inventory/Guides/creatingItems.mdx
index fac7051b..62998a43 100644
--- a/pages/ox_inventory/Guides/creatingItems.mdx
+++ b/pages/ox_inventory/Guides/creatingItems.mdx
@@ -1,152 +1,147 @@
---
-title: Creating items
+title: Creating Items
---
import { Tabs, Tab } from 'nextra-theme-docs';
+# Creating Items
+
## Defining item data
Before being able to see or use an item in game it **must** first be defined.
-All of the items are defined in the `/data/items.lua` file with key, value pairs.
+All of the items are defined in the [/data/items.lua](https://github.com/overextended/ox_inventory/blob/main/data/items.lua) file with key, value pairs.
Key is the name (not the label) of an item and the value is a table containing the
options for the item.
-**Item options:**
-
-- label: `string`
-- weight?: `number`
-- stack?: `boolean`
- - If set to false will not allow the item to be stacked.
-- degrade?: `number`
- - Amount of time in minutes the item will degrade after.
-- decay?: `boolean`
- - If true the item will be deleted when durability reaches 0 (not instant for degraded items).
-- close?: `boolean`
- - If set to false does not close the inventory on item use.
-- description?: `string`
- - Item description that will be shown in the tooltip
-- consume?: `number`
- - Item count needed and removed use.
- - Default: 1
- - If set to a decimal will consume durability instead (0.2 = 20%).
-- allowArmed?: `boolean`
- - If set to true will allow use of item while armed with a weapon.
-- server?: `table`
- - export?: `string`
-- client?: `table`
- - export?: `string`
- - Export to be triggered after item use.
- - event?: `string`
- - Event to be triggered after item use.
- - status?: `table`
- - Adjust esx_status values after use.
- - anim?: `table`
- - Animation that will be played during the progress bar.
- - dict: `string`
- - clip: `string`
- - prop?: `table`
- - Attached prop that will be displayed during the progress bar.
- - model: `string` or `hash`
- - pos: `table` (x, y, z)
- - rot: `table` (x, y, z)
- - disable?: `table`
- - Actions to be disabled during the progress bar
- - move?: `boolean`
- - car?: `boolean`
- - combat?: `boolean`
- - mouse?: `boolean`
- - usetime?: `number`
- - cancel?: `boolean`
- - If set to true the player canc cancel item use.
- - add?: `function`(total: `number`)
- - Function that triggers when receiving an item
- - Returns total item count as `total`
- - remove?: `function`(total: `number`)
- - Function that triggers when removing an item
- - Returns total item count as `total`
-- buttons?: `table`
+- Item options: `table`
- label: `string`
- - action: `function`(slot: `number`)
- - Callback function when button is clicked in context menu, returns item slot.
+ - weight?: `number`
+ - stack?: `boolean`
+ - If set to false will not allow the item to be stacked.
+ - degrade?: `number`
+ - Amount of time in minutes the item will degrade after.
+ - decay?: `boolean`
+ - If true the item will be deleted when durability reaches 0 (not instant for degraded items).
+ - close?: `boolean`
+ - If set to false does not close the inventory on item use.
+ - description?: `string`
+ - Item description that will be shown in the tooltip
+ - consume?: `number`
+ - Item count needed and removed use.
+ - Default: 1
+ - If set to a decimal will consume durability instead (0.2 = 20%).
+ - allowArmed?: `boolean`
+ - If set to true will allow use of item while armed with a weapon.
+ - server?: `table`
+ - export?: `string`
+ - client?: `table`
+ - export?: `string`
+ - Export to be triggered after item use.
+ - event?: `string`
+ - Event to be triggered after item use.
+ - status?: `table`
+ - Adjust esx_status values after use.
+ - anim?: `table`
+ - Animation that will be played during the progress bar.
+ - dict: `string`
+ - clip: `string`
+ - prop?: `table`
+ - Attached prop that will be displayed during the progress bar.
+ - model: `string` or `hash`
+ - pos: `table` (x, y, z)
+ - rot: `table` (x, y, z)
+ - disable?: `table`
+ - Actions to be disabled during the progress bar
+ - move?: `boolean`
+ - car?: `boolean`
+ - combat?: `boolean`
+ - mouse?: `boolean`
+ - usetime?: `number`
+ - cancel?: `boolean`
+ - If set to true the player canc cancel item use.
+ - add?: `function`(total: `number`)
+ - Function that triggers when receiving an item
+ - Returns total item count as `total`
+ - remove?: `function`(total: `number`)
+ - Function that triggers when removing an item
+ - Returns total item count as `total`
+ - buttons?: `table`
+ - label: `string`
+ - action: `function`(slot: `number`)
+ - Callback function when button is clicked in context menu, returns item slot.
-**Examples:**
+### Examples
-
-
-```lua
-['burger'] = {
- label = 'Burger',
- weight = 220,
- stack = true,
- close = true,
- client = {
- status = { hunger = 200000 },
- anim = { dict = 'mp_player_inteat@burger', clip = 'mp_player_int_eat_burger_fp' },
- prop = {
- model = 'prop_cs_burger_01',
- pos = { x = 0.02, y = 0.02, y = -0.02},
- rot = { x = 0.0, y = 0.0, y = 0.0}
- },
- usetime = 2500,
+
+ ```lua
+ ['burger'] = {
+ label = 'Burger',
+ weight = 220,
+ stack = true,
+ close = true,
+ client = {
+ status = { hunger = 200000 },
+ anim = { dict = 'mp_player_inteat@burger', clip = 'mp_player_int_eat_burger_fp' },
+ prop = {
+ model = 'prop_cs_burger_01',
+ pos = { x = 0.02, y = 0.02, y = -0.02},
+ rot = { x = 0.0, y = 0.0, y = 0.0}
+ },
+ usetime = 2500,
+ }
}
-}
-```
+ ```
+
+
+ A modified burger item which includes a description.
-
-
-
-A modified burger item which includes a description.
-
-```lua
-['burger'] = {
- label = 'Burger',
- description = 'Just what is the secret formula?'
- weight = 220,
- stack = true,
- close = true,
- client = {
- status = { hunger = 200000 },
- anim = { dict = 'mp_player_inteat@burger', clip = 'mp_player_int_eat_burger_fp' },
- prop = {
- model = 'prop_cs_burger_01',
- pos = { x = 0.02, y = 0.02, y = -0.02},
- rot = { x = 0.0, y = 0.0, y = 0.0}
- },
- usetime = 2500,
+ ```lua
+ ['burger'] = {
+ label = 'Burger',
+ description = 'Just what is the secret formula?'
+ weight = 220,
+ stack = true,
+ close = true,
+ client = {
+ status = { hunger = 200000 },
+ anim = { dict = 'mp_player_inteat@burger', clip = 'mp_player_int_eat_burger_fp' },
+ prop = {
+ model = 'prop_cs_burger_01',
+ pos = { x = 0.02, y = 0.02, y = -0.02},
+ rot = { x = 0.0, y = 0.0, y = 0.0}
+ },
+ usetime = 2500,
+ }
}
-}
-```
+ ```
+
+
+ A modified burger item, which gives you notifications on add and remove arguments.
-
-
+ ```lua
+ ['burger'] = {
+ label = 'Burger',
+ weight = 220,
+ stack = true,
+ consume = 0,
+ client = {
+ add = function(total)
+ if total > 0 then
+ lib.notify({description = 'Nice burger you got there!'})
+ end
+ end,
-A modified burger item, which gives you notifications on add and remove arguments.
-
-```lua
-['burger'] = {
- label = 'Burger',
- weight = 220,
- stack = true,
- consume = 0,
- client = {
- add = function(total)
- if total > 0 then
- lib.notify({description = 'Nice burger you got there!'})
+ remove = function(total)
+ if total < 1 then
+ lib.notify({description = 'You lost all of your burgers!'})
+ end
end
- end,
-
- remove = function(total)
- if total < 1 then
- lib.notify({description = 'You lost all of your burgers!'})
- end
- end
+ }
}
-}
-```
-
-
+ ```
+
## Making the item usable
@@ -229,18 +224,6 @@ end)
Like with other items the item must first be registered.
-**Example:**
-
-```lua
-['paperbag'] = {
- label = 'Paper Bag',
- weight = 1,
- stack = false,
- close = false,
- consume = 0
-},
-```
-
When registered you can define the item as a container in `/modules/items/containers.lua`
The key for the container is the `name` you gave it when registering the item.
You can also define the number of slots, the maximum weight, blacklist and whitelist items.
@@ -257,9 +240,19 @@ You can also define the number of slots, the maximum weight, blacklist and white
- Supports single and multiple items
- `{ 'testburger', 'testburger2' }`
-**Example:**
+### Example
-```lua
+```lua filename="Register Example"
+['paperbag'] = {
+ label = 'Paper Bag',
+ weight = 1,
+ stack = false,
+ close = false,
+ consume = 0
+},
+```
+
+```lua filename="Properties Example"
setContainerProperties('paperbag', {
slots = 5,
maxWeight = 1000,
diff --git a/pages/ox_inventory/Guides/shops.mdx b/pages/ox_inventory/Guides/shops.mdx
index 7b9d0405..bc9dc6e3 100644
--- a/pages/ox_inventory/Guides/shops.mdx
+++ b/pages/ox_inventory/Guides/shops.mdx
@@ -1,7 +1,9 @@
---
-title: Creating shops
+title: Creating Shops
---
+# Creating Shops
+
Builtin shops are defined in [data/shops.lua](https://github.com/overextended/ox_inventory/blob/main/data/shops.lua), and more can be added here to benefit from the built-in markers or zones support.
## Shop definition
@@ -84,7 +86,7 @@ Shops can be added using `exports.ox_inventory:RegisterShop` on the server, howe
- Blips, markers, and zones will not be created.
- Must use "locations" and not "targets" to define each shop using the archetype.
-**Example:**
+### Example
```lua
exports.ox_inventory:RegisterShop('TestShop', {
diff --git a/pages/ox_inventory/Guides/stashes.mdx b/pages/ox_inventory/Guides/stashes.mdx
index bd310756..054fa536 100644
--- a/pages/ox_inventory/Guides/stashes.mdx
+++ b/pages/ox_inventory/Guides/stashes.mdx
@@ -1,14 +1,16 @@
---
-title: Custom stashes
+title: Custom Stashes
---
import { GhButton } from '@components/button';
+# Custom Stashes
+
We can set up custom stashes from outside the resource utilising the exported RegisterStash function.
Firstly, we need to define the stashes properties.
-### Stash properties
+## Stash properties
- id: `string`
- Unique name to identify the stash in the database.
@@ -81,8 +83,8 @@ if ox_inventory:openInventory('stash', property.id) == false then
end
```
-## Example resource
+## Example Resource
We put together an example resource showcasing how to properly utilise the stash API:
-
+
diff --git a/pages/ox_inventory/issues.mdx b/pages/ox_inventory/issues.mdx
index 7f5f845e..5e89e581 100644
--- a/pages/ox_inventory/issues.mdx
+++ b/pages/ox_inventory/issues.mdx
@@ -1,7 +1,9 @@
---
-title: Common issues
+title: Common Issues
---
+# Common Issues
+
## UI has not been built
Because the UI for inventory is written in React it can't run natively under FiveM so it must first be bundled into html/css/js.
diff --git a/pages/ox_lib.mdx b/pages/ox_lib.mdx
index 2bb41303..bf091471 100644
--- a/pages/ox_lib.mdx
+++ b/pages/ox_lib.mdx
@@ -2,6 +2,8 @@ import { Callout } from 'nextra/components';
import { Tabs, Tab, Steps } from 'nextra-theme-docs';
import ResourceLinks from '@components/resource-links';
+# Ox Lib
+
A standalone library for providing easily reusable code as importable modules and exports.
diff --git a/pages/ox_lib/Modules/ACL/Server.mdx b/pages/ox_lib/Modules/ACL/Server.mdx
index c21d9d62..eb05776d 100644
--- a/pages/ox_lib/Modules/ACL/Server.mdx
+++ b/pages/ox_lib/Modules/ACL/Server.mdx
@@ -1,126 +1,112 @@
+import { Tabs, Tab } from 'nextra-theme-docs';
+
+# Server
+
Wrapper around the built-in ACL system. Handles lib.addCommand and ox_groups permissions.
Refer to [Basic Aces & Principals overview/guide](https://forum.cfx.re/t/basic-aces-principals-overview-guide/90917) for more information.
-import { Tabs, Tab } from 'nextra-theme-docs';
-
-### lib.addAce
+## lib.addAce
Assigns the ace permission to a principal. Third parameter defaults to 'allow', while passing `false` sets the permission to 'deny'.
-
+
+ ```lua
+ lib.addAce(principal, ace, allow)
-```lua
-lib.addAce(principal, ace, allow)
+ lib.addAce('group.admin', 'command.say')
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/server'
-lib.addAce('group.admin', 'command.say')
-```
+ lib.addAce(principal, ace, allow)
-
-
-
-```ts
-import lib from '@overextended/ox_lib/server'
-
-lib.addAce(principal, ace, allow)
-
-lib.addAce('group.admin', 'command.say')
-```
-
-
+ lib.addAce('group.admin', 'command.say')
+ ```
+
-* principal: `string`
-* ace: `string`
-* allow: `boolean`
+- principal: `string`
+- ace: `string`
+- allow: `boolean`
-### lib.removeAce
+## lib.removeAce
Removes the ace permission from a principal. Third parameter defaults to 'allow', while passing `false` sets the permission to 'deny'.
-
+
+ ```lua
+ lib.removeAce(principal, ace, allow)
-```lua
-lib.removeAce(principal, ace, allow)
+ lib.removeAce('group.admin', 'command.say')
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/server'
-lib.removeAce('group.admin', 'command.say')
-```
+ lib.removeAce(principal, ace, allow)
-
-
-
-```ts
-import lib from '@overextended/ox_lib/server'
-
-lib.removeAce(principal, ace, allow)
-
-lib.removeAce('group.admin', 'command.say')
-```
-
-
+ lib.removeAce('group.admin', 'command.say')
+ ```
+
-* principal: `string`
-* ace: `string`
-* allow: `boolean`
+- principal: `string`
+- ace: `string`
+- allow: `boolean`
-### lib.addPrincipal
+## lib.addPrincipal
Assigns a principal to a parent principal. Children inherit permissions from the parent.
-
+
+ ```lua
+ lib.addPrincipal(child, parent)
-```lua
-lib.addPrincipal(child, parent)
+ lib.addPrincipal('player.1', 'group.moderator')
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/server'
-lib.addPrincipal('player.1', 'group.moderator')
-```
+ lib.addPrincipal(child, parent)
-
-
-
-```ts
-import lib from '@overextended/ox_lib/server'
-
-lib.addPrincipal(child, parent)
-
-lib.addPrincipal('player.1', 'group.moderator')
-```
-
-
+ lib.addPrincipal('player.1', 'group.moderator')
+ ```
+
-* child: `string`
-* parent: `string`
+- child: `string`
+- parent: `string`
-### lib.removePrincipal
+## lib.removePrincipal
Removes a principal from a parent principal.
-
+
+ ```lua
+ lib.removePrincipal(child, parent)
-```lua
-lib.removePrincipal(child, parent)
+ lib.removePrincipal('player.1', 'group.moderator')
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/server'
-lib.removePrincipal('player.1', 'group.moderator')
-```
+ lib.removePrincipal(child, parent)
-
-
-
-```ts
-import lib from '@overextended/ox_lib/server'
-
-lib.removePrincipal(child, parent)
-
-lib.removePrincipal('player.1', 'group.moderator')
-```
-
-
+ lib.removePrincipal('player.1', 'group.moderator')
+ ```
+
-* child: `string`
-* parent: `string`
+- child: `string`
+- parent: `string`
diff --git a/pages/ox_lib/Modules/AddCommand/Server.mdx b/pages/ox_lib/Modules/AddCommand/Server.mdx
index adb83ad2..45bac41c 100644
--- a/pages/ox_lib/Modules/AddCommand/Server.mdx
+++ b/pages/ox_lib/Modules/AddCommand/Server.mdx
@@ -1,3 +1,5 @@
+# Server
+
Registers commands and simplifies argument validation, permissions, and chat suggestions.
```lua
diff --git a/pages/ox_lib/Modules/AddKeybind/Client.mdx b/pages/ox_lib/Modules/AddKeybind/Client.mdx
index 1d5d7efd..122f783b 100644
--- a/pages/ox_lib/Modules/AddKeybind/Client.mdx
+++ b/pages/ox_lib/Modules/AddKeybind/Client.mdx
@@ -1,6 +1,8 @@
+# Client
+
Registers keybinds and simplifies interactions of the keybinds.
-### CKeybind
+## CKeybind Class
A table representing a keybind with the following properties.
@@ -24,7 +26,7 @@ A table representing a keybind with the following properties.
- onReleased?: `function(self: CKeybind)`
- User-defined function triggered on keybind release
-### lib.addKeybind
+## lib.addKeybind
```lua
lib.addKeybind(data)
diff --git a/pages/ox_lib/Modules/Cache/Client.mdx b/pages/ox_lib/Modules/Cache/Client.mdx
index 6c8e94dd..5fdeb290 100644
--- a/pages/ox_lib/Modules/Cache/Client.mdx
+++ b/pages/ox_lib/Modules/Cache/Client.mdx
@@ -1,9 +1,11 @@
import { Tabs, Tab } from 'nextra-theme-docs';
+# Client
+
Caches data related to the player.
An interval runs every 100ms to update data that cannot be checked via handlers.
-## States
+## Cache States
- ped: `number`
- player entity id
@@ -31,47 +33,48 @@ An interval runs every 100ms to update data that cannot be checked via handlers.
Register an event handler that is triggered when the cached value is updated.
-
+
+ ```lua
+ lib.onCache(key, function(value) end)
+ ```
-```lua
-lib.onCache(key, function(value) end)
-```
+ - key: `string`
+ - `ped`
+ - `vehicle`
+ - `seat`
+ - `weapon`
+ - `mount` (RedM only)
+ - value: `any`
-- key: `string`
- - `ped`
- - `vehicle`
- - `seat`
- - `weapon`
- - `mount` (RedM only)
-- value: `any`
+ ```lua
+ lib.onCache('vehicle', function(value)
+ print('old vehicle:', cache.vehicle)
+ print('new vehicle:', value)
+ end)
+ ```
+
+
+ ```ts
+ import { onCache } from '@overextended/ox_lib/client';
-```lua
-lib.onCache('vehicle', function(value)
- print('old vehicle:', cache.vehicle)
- print('new vehicle:', value)
-end)
-```
+ onCache(key, (value) => {});
+ ```
-
-
+ - key: `string`
+ - `ped`
+ - `vehicle`
+ - `seat`
+ - `weapon`
+ - `mount` (RedM only)
+ - value: `any`
-```ts
-import { onCache } from '@overextended/ox_lib/client';
+ ```ts
+ import { cache, onCache } from '@overextended/ox_lib/client';
-onCache(key, (value) => {});
-```
-
-- key: `string`
-- value: `any`
-
-```ts
-import { cache, onCache } from '@overextended/ox_lib/client';
-
-lib.onCache('vehicle', (value) => {
- console.log('old vehicle:', cache.vehicle);
- console.log('new vehicle:', value);
-});
-```
-
-
+ lib.onCache('vehicle', (value) => {
+ console.log('old vehicle:', cache.vehicle);
+ console.log('new vehicle:', value);
+ });
+ ```
+
diff --git a/pages/ox_lib/Modules/Callback/JavaScript/Client.mdx b/pages/ox_lib/Modules/Callback/JavaScript/Client.mdx
index b1ff7f7d..359e400a 100644
--- a/pages/ox_lib/Modules/Callback/JavaScript/Client.mdx
+++ b/pages/ox_lib/Modules/Callback/JavaScript/Client.mdx
@@ -1,3 +1,5 @@
+# Client
+
## Trigger Server Callback
### triggerServerCallback
diff --git a/pages/ox_lib/Modules/Callback/JavaScript/Server.mdx b/pages/ox_lib/Modules/Callback/JavaScript/Server.mdx
index f43177a8..824fc067 100644
--- a/pages/ox_lib/Modules/Callback/JavaScript/Server.mdx
+++ b/pages/ox_lib/Modules/Callback/JavaScript/Server.mdx
@@ -1,3 +1,5 @@
+# Server
+
## Trigger Client Callback
### triggerClientCallback
diff --git a/pages/ox_lib/Modules/Callback/Lua/Client.mdx b/pages/ox_lib/Modules/Callback/Lua/Client.mdx
index 66747c01..13926025 100644
--- a/pages/ox_lib/Modules/Callback/Lua/Client.mdx
+++ b/pages/ox_lib/Modules/Callback/Lua/Client.mdx
@@ -1,3 +1,5 @@
+# Client
+
## Trigger Server Callback
### lib.callback
diff --git a/pages/ox_lib/Modules/Callback/Lua/Server.mdx b/pages/ox_lib/Modules/Callback/Lua/Server.mdx
index 44d2cb81..e8388928 100644
--- a/pages/ox_lib/Modules/Callback/Lua/Server.mdx
+++ b/pages/ox_lib/Modules/Callback/Lua/Server.mdx
@@ -1,3 +1,5 @@
+# Server
+
## Trigger Client Callback
### lib.callback
diff --git a/pages/ox_lib/Modules/Cron/Server.mdx b/pages/ox_lib/Modules/Cron/Server.mdx
index b2fcc618..a92f22f9 100644
--- a/pages/ox_lib/Modules/Cron/Server.mdx
+++ b/pages/ox_lib/Modules/Cron/Server.mdx
@@ -1,4 +1,4 @@
-# Cron
+# Server
A Lua implementation of cron, allowing tasks to be scheduled to run periodically at fixed times, dates, and intervals.
@@ -44,4 +44,6 @@ lib.cron.new(expression, job, options)
- options?: `table`
- debug?: `boolean`
-**returns**: OxTask
+Return:
+
+- task: `OxTask`
diff --git a/pages/ox_lib/Modules/DisableControls/Client.mdx b/pages/ox_lib/Modules/DisableControls/Client.mdx
index 2f5adc87..95fd8daf 100644
--- a/pages/ox_lib/Modules/DisableControls/Client.mdx
+++ b/pages/ox_lib/Modules/DisableControls/Client.mdx
@@ -1,6 +1,8 @@
+# Client
+
A centralized way to track and disable controls.
-### lib.disableControls
+## lib.disableControls
Call on frame to disable all stored controls.
@@ -8,7 +10,7 @@ Call on frame to disable all stored controls.
lib.disableControls()
```
-### lib.disableControls:Add
+## 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.
@@ -20,7 +22,7 @@ lib.disableControls:Add(...)
- vararg: `number` or `table`
- Control(s) to add a stored count of
-### lib.disableControls:Remove
+## 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.
@@ -32,7 +34,7 @@ lib.disableControls:Remove(...)
- vararg: `number` or `table`
- Control(s) to remove a stored count of
-### lib.disableControls:Clear
+## lib.disableControls:Clear
Clears the stored counter(s) for the specified control(s).
diff --git a/pages/ox_lib/Modules/GetClosestObject/Client.mdx b/pages/ox_lib/Modules/GetClosestObject/Client.mdx
index 0e7a2b57..855353cf 100644
--- a/pages/ox_lib/Modules/GetClosestObject/Client.mdx
+++ b/pages/ox_lib/Modules/GetClosestObject/Client.mdx
@@ -1,4 +1,6 @@
-### lib.getClosestObject
+# Client
+
+## lib.getClosestObject
Get the object handle and coords of the closest object to a set of coordinates.
diff --git a/pages/ox_lib/Modules/GetClosestPed/Client.mdx b/pages/ox_lib/Modules/GetClosestPed/Client.mdx
index be990c89..eee708a1 100644
--- a/pages/ox_lib/Modules/GetClosestPed/Client.mdx
+++ b/pages/ox_lib/Modules/GetClosestPed/Client.mdx
@@ -1,4 +1,6 @@
-### lib.getClosestPed
+# Client
+
+## lib.getClosestPed
Get the ped handle and coords of the closest ped to a set of coordinates.
diff --git a/pages/ox_lib/Modules/GetClosestPlayer/Client.mdx b/pages/ox_lib/Modules/GetClosestPlayer/Client.mdx
index 886e0903..9e15f53b 100644
--- a/pages/ox_lib/Modules/GetClosestPlayer/Client.mdx
+++ b/pages/ox_lib/Modules/GetClosestPlayer/Client.mdx
@@ -1,4 +1,6 @@
-### lib.getClosestPlayer
+# Client
+
+## lib.getClosestPlayer
Get the player id, ped handle, and coords of the closest player to a set of coordinates.
diff --git a/pages/ox_lib/Modules/GetClosestVehicle/Client.mdx b/pages/ox_lib/Modules/GetClosestVehicle/Client.mdx
index de9f950e..d86c8cd6 100644
--- a/pages/ox_lib/Modules/GetClosestVehicle/Client.mdx
+++ b/pages/ox_lib/Modules/GetClosestVehicle/Client.mdx
@@ -1,4 +1,6 @@
-### lib.getClosestVehicle
+# Client
+
+## lib.getClosestVehicle
Get the vehicle handle and coords of the closest vehicle to a set of coordinates.
diff --git a/pages/ox_lib/Modules/GetNearbyObjects/Client.mdx b/pages/ox_lib/Modules/GetNearbyObjects/Client.mdx
index a6321175..cc610ac1 100644
--- a/pages/ox_lib/Modules/GetNearbyObjects/Client.mdx
+++ b/pages/ox_lib/Modules/GetNearbyObjects/Client.mdx
@@ -1,4 +1,6 @@
-### lib.getNearbyObjects
+# Client
+
+## lib.getNearbyObjects
Get the object handle and coords of all objects within range of a set of coordinates.
diff --git a/pages/ox_lib/Modules/GetNearbyPeds/Client.mdx b/pages/ox_lib/Modules/GetNearbyPeds/Client.mdx
index ba2292e9..b81b24aa 100644
--- a/pages/ox_lib/Modules/GetNearbyPeds/Client.mdx
+++ b/pages/ox_lib/Modules/GetNearbyPeds/Client.mdx
@@ -1,4 +1,6 @@
-### lib.getNearbyPeds
+# Client
+
+## lib.getNearbyPeds
Get the ped handle and coords of all peds within range of a set of coordinates.
diff --git a/pages/ox_lib/Modules/GetNearbyPlayers/Client.mdx b/pages/ox_lib/Modules/GetNearbyPlayers/Client.mdx
index 6515b4fb..f1262bef 100644
--- a/pages/ox_lib/Modules/GetNearbyPlayers/Client.mdx
+++ b/pages/ox_lib/Modules/GetNearbyPlayers/Client.mdx
@@ -1,4 +1,6 @@
-### lib.getNearbyPlayers
+# Client
+
+## lib.getNearbyPlayers
Get the player id, ped handle, and coords of all players within range of a set of coordinates.
diff --git a/pages/ox_lib/Modules/GetNearbyVehicles/Client.mdx b/pages/ox_lib/Modules/GetNearbyVehicles/Client.mdx
index c2414d8c..b95ab941 100644
--- a/pages/ox_lib/Modules/GetNearbyVehicles/Client.mdx
+++ b/pages/ox_lib/Modules/GetNearbyVehicles/Client.mdx
@@ -1,4 +1,6 @@
-### lib.getNearbyVehicles
+# Client
+
+## lib.getNearbyVehicles
Get the vehicle handle and coords of all vehicles within range of a set of coordinates.
diff --git a/pages/ox_lib/Modules/Interface.mdx b/pages/ox_lib/Modules/Interface.mdx
index 53bb1858..0d0b3904 100644
--- a/pages/ox_lib/Modules/Interface.mdx
+++ b/pages/ox_lib/Modules/Interface.mdx
@@ -2,6 +2,8 @@
title: Interface
---
+# Interface
+
If you wish to change the primary colour for the UI to better match your server's theme you can do so easily through the available convars.
They don't require you to build the UI, just restart the resource.
diff --git a/pages/ox_lib/Modules/Interface/Client/alert.mdx b/pages/ox_lib/Modules/Interface/Client/alert.mdx
index cd1b7e8c..cf38d435 100644
--- a/pages/ox_lib/Modules/Interface/Client/alert.mdx
+++ b/pages/ox_lib/Modules/Interface/Client/alert.mdx
@@ -5,45 +5,39 @@ title: Alert Dialog
import { Tabs, Tab } from 'nextra-theme-docs';
import { Callout } from 'nextra/components';
+# Alert Dialog
+
Simple alert dialog that can display a message to the player.
Returns whether the player pressed the confirm button or canceled the dialog.
-### lib.alertDialog
+## lib.alertDialog
-
+
+
+
+ ```lua
+ lib.alertDialog(data)
+ ```
+
+
+ ```lua
+ TriggerClientEvent('ox_lib:alertDialog', source, data)
+ ```
+
+
+
+
+
+ This function is **asynchronous** requiring you to do a `.then` callback on the promise or make your function `async`.
+
-
-
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.alertDialog(data)
-```
-
-
-
-
-```lua
-TriggerClientEvent('ox_lib:alertDialog', source, data)
-```
-
-
-
-
-
-
-
-
- This function is **asynchronous** requiring you to do a `.then` callback on the promise or make your function `async`.
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.alertDialog(data);
-```
-
-
+ lib.alertDialog(data);
+ ```
+
- data: `table` (`object`)
@@ -65,62 +59,54 @@ lib.alertDialog(data);
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
+## lib.closeAlertDialog
Force closes the active alert dialog and sets its return data as `nil`
-
+
+ ```lua
+ lib.closeAlertDialog()
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.closeAlertDialog()
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.closeAlertDialog();
-```
-
-
+ lib.closeAlertDialog();
+ ```
+
-**Example:**
+## Example
-
+
+ ```lua
+ local alert = lib.alertDialog({
+ header = 'Hello there',
+ content = 'General Kenobi \n Markdown support!',
+ centered = true,
+ cancel = true
+ })
-```lua
-local alert = lib.alertDialog({
- header = 'Hello there',
- content = 'General Kenobi \n Markdown support!',
- centered = true,
- cancel = true
-})
+ print(alert)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-print(alert)
-```
+ const alert = await lib.alertDialog({
+ header: 'Hello there',
+ content: 'General Kenobi \n Markdown support!',
+ centered: true,
+ cancel: true,
+ });
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-const alert = await lib.alertDialog({
- header: 'Hello there',
- content: 'General Kenobi \n Markdown support!',
- centered: true,
- cancel: true,
-});
-
-console.log(alert);
-```
-
-
+ console.log(alert);
+ ```
+

diff --git a/pages/ox_lib/Modules/Interface/Client/clipboard.mdx b/pages/ox_lib/Modules/Interface/Client/clipboard.mdx
index 06bfbb75..5c3ae2df 100644
--- a/pages/ox_lib/Modules/Interface/Client/clipboard.mdx
+++ b/pages/ox_lib/Modules/Interface/Client/clipboard.mdx
@@ -5,39 +5,33 @@ title: Clipboard
import { Tabs, Tab } from 'nextra-theme-docs';
import { Callout } from 'nextra/components';
-### lib.setClipboard
+# Clipboard
+
+## lib.setClipboard
Sets the player's clipboard to the specified string value.
-
-Will not work if focus is already taken by some NUI component.
-
+ Will not work if focus is already taken by some NUI component.
-
-To create a new line use `\t\n` not just `\n` in your string.
-
+ To create a new line use `\t\n` not just `\n` in your string.
-
+
+ ```lua
+ lib.setClipboard(value)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.setClipboard(value)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.setClipboard(value);
-```
-
-
+ lib.setClipboard(value);
+ ```
+
- value: `string`
diff --git a/pages/ox_lib/Modules/Interface/Client/context.mdx b/pages/ox_lib/Modules/Interface/Client/context.mdx
index bce98f7e..4a7ad23a 100644
--- a/pages/ox_lib/Modules/Interface/Client/context.mdx
+++ b/pages/ox_lib/Modules/Interface/Client/context.mdx
@@ -5,27 +5,25 @@ title: Context Menu
import { Tabs, Tab } from 'nextra-theme-docs';
import { Callout } from 'nextra/components';
-### lib.registerContext
+# Context Menu
+
+## lib.registerContext
Used for registering a context menu.
-
+
+ ```lua
+ lib.registerContext(context)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.registerContext(context)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.registerContext(context);
-```
-
-
+ lib.registerContext(context);
+ ```
+
- id: `string`
@@ -86,83 +84,71 @@ as you'd like.
The menu can be either in the order you write it in, or sorted alphabetically.
To sort the menu alphabetically the buttons (and/or metadata) need to be defined as keys, otherwise not using keys and instead using tables will make the menu be in the order you define it as.
-### lib.showContext
+## lib.showContext
Opens a registered context menu by its id.
-
+
+ ```lua
+ lib.showContext(id)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.showContext(id)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.showContext(id);
-```
-
-
+ lib.showContext(id);
+ ```
+
- id: `string`
-### lib.hideContext
+## lib.hideContext
Hides any currently visible context menu.
-
+
+ ```lua
+ lib.hideContext(onExit)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.hideContext(onExit)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.hideContext(onExit);
-```
-
-
+ lib.hideContext(onExit);
+ ```
+
- onExit: `boolean`
- Defines whether the onExit function for the menu should be ran or not.
-### lib.getOpenContextMenu
+## lib.getOpenContextMenu
Returns the id of the currently open context menu.
If no context menu is open returns `nil`.
-
+
+ ```lua
+ lib.getOpenContextMenu()
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.getOpenContextMenu()
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.getOpenContextMenu();
-```
-
-
+ lib.getOpenContextMenu();
+ ```
+
-### Usage Example
+## Usage Example
First we register the menu with our specified options then we call the show function in the command.
@@ -171,219 +157,201 @@ First we register the menu with our specified options then we call the show func
-
-
-```lua
-lib.registerContext({
- id = 'some_menu',
- title = 'Some context menu',
- options = {
- {
- title = 'Empty button',
- },
- {
- title = 'Disabled button',
- description = 'This button is disabled',
- icon = 'hand',
- disabled = true
- },
- {
- title = 'Example button',
- description = 'Example button description',
- icon = 'circle',
- onSelect = function()
- print("Pressed the button!")
- end,
- metadata = {
- {label = 'Value 1', value = 'Some value'},
- {label = 'Value 2', value = 300}
- },
- },
- {
- title = 'Menu button',
- description = 'Takes you to another menu!',
- menu = 'other_menu',
- icon = 'bars'
- },
- {
- title = 'Event button',
- description = 'Open a menu from the event and send event data',
- icon = 'check',
- event = 'test_event',
- arrow = true,
- args = {
- someValue = 500
+
+ ```lua
+ lib.registerContext({
+ id = 'some_menu',
+ title = 'Some context menu',
+ options = {
+ {
+ title = 'Empty button',
+ },
+ {
+ title = 'Disabled button',
+ description = 'This button is disabled',
+ icon = 'hand',
+ disabled = true
+ },
+ {
+ title = 'Example button',
+ description = 'Example button description',
+ icon = 'circle',
+ onSelect = function()
+ print("Pressed the button!")
+ end,
+ metadata = {
+ {label = 'Value 1', value = 'Some value'},
+ {label = 'Value 2', value = 300}
+ },
+ },
+ {
+ title = 'Menu button',
+ description = 'Takes you to another menu!',
+ menu = 'other_menu',
+ icon = 'bars'
+ },
+ {
+ title = 'Event button',
+ description = 'Open a menu from the event and send event data',
+ icon = 'check',
+ event = 'test_event',
+ arrow = true,
+ args = {
+ someValue = 500
+ }
+ }
}
- }
- }
-})
-```
+ })
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.registerContext({
- id: 'some_menu',
- title: 'Some context menu',
- options: [
- {
- title: 'Empty button',
- },
- {
- title: 'Disabled button',
- description: 'This button is disabled',
- icon: 'hand',
- disabled: true,
- },
- {
- title: 'Example button',
- description: 'Example button description',
- icon: 'circle',
- onSelect: () => {
- console.log('Pressed the button!');
- },
- metadata: [
- { label: 'Value 1', value: 'Some value' },
- { label: 'Value 2', value: 300 },
+ lib.registerContext({
+ id: 'some_menu',
+ title: 'Some context menu',
+ options: [
+ {
+ title: 'Empty button',
+ },
+ {
+ title: 'Disabled button',
+ description: 'This button is disabled',
+ icon: 'hand',
+ disabled: true,
+ },
+ {
+ title: 'Example button',
+ description: 'Example button description',
+ icon: 'circle',
+ onSelect: () => {
+ console.log('Pressed the button!');
+ },
+ metadata: [
+ { label: 'Value 1', value: 'Some value' },
+ { label: 'Value 2', value: 300 },
+ ],
+ },
+ {
+ title: 'Menu button',
+ description: 'Takes you to another menu!',
+ menu: 'other_menu',
+ icon: 'bars',
+ },
+ {
+ title: 'Event button',
+ description: 'Open a menu from the event and send event data',
+ icon: 'check',
+ event: 'test_event',
+ arrow: true,
+ args: {
+ someValue: 500,
+ },
+ },
],
- },
- {
- title: 'Menu button',
- description: 'Takes you to another menu!',
- menu: 'other_menu',
- icon: 'bars',
- },
- {
- title: 'Event button',
- description: 'Open a menu from the event and send event data',
- icon: 'check',
- event: 'test_event',
- arrow: true,
- args: {
- someValue: 500,
- },
- },
- ],
-});
-```
-
-
+ });
+ ```
+
Then we can also register our second menu called `other_menu`
-
-
-```lua
-lib.registerContext({
- id = 'other_menu',
- title = 'Other context menu',
- menu = 'some_menu',
- onBack = function()
- print('Went back!')
- end,
- options = {
- {
- title = 'Nothing here'
- }
- }
-})
-```
-
-
-
-
-```ts
-lib.registerContext({
- id: 'other_menu',
- title: 'Other context menu',
- menu: 'some_menu',
- onBack: () => {
- console.log('Went back!');
- },
- options: [
- {
- title: 'Nothing here',
- },
- ],
-});
-```
-
-
+
+ ```lua
+ lib.registerContext({
+ id = 'other_menu',
+ title = 'Other context menu',
+ menu = 'some_menu',
+ onBack = function()
+ print('Went back!')
+ end,
+ options = {
+ {
+ title = 'Nothing here'
+ }
+ }
+ })
+ ```
+
+
+ ```ts
+ lib.registerContext({
+ id: 'other_menu',
+ title: 'Other context menu',
+ menu: 'some_menu',
+ onBack: () => {
+ console.log('Went back!');
+ },
+ options: [
+ {
+ title: 'Nothing here',
+ },
+ ],
+ });
+ ```
+
And the event that we are going to run from the `some_menu` menu, which is going to open another menu.
-
+
+ ```lua
+ RegisterNetEvent('test_event', function(args)
+ lib.registerContext({
+ id = 'event_menu',
+ title = 'Event menu',
+ menu = 'some_menu',
+ options = {
+ {
+ title = 'Event value: '..args.someValue,
+ }
+ }
+ })
-```lua
-RegisterNetEvent('test_event', function(args)
- lib.registerContext({
- id = 'event_menu',
- title = 'Event menu',
- menu = 'some_menu',
- options = {
- {
- title = 'Event value: '..args.someValue,
- }
- }
- })
+ lib.showContext('event_menu')
+ end)
+ ```
+
+
+ ```ts
+ onNet('test_event', (args: { someValue: number }) => {
+ lib.registerContext({
+ id: 'event_menu',
+ title: 'Event menu',
+ menu: 'some_menu',
+ options: [
+ {
+ title: `Event value: ${args.someValue}`,
+ },
+ ],
+ });
- lib.showContext('event_menu')
-end)
-```
-
-
-
-
-
-```ts
-onNet('test_event', (args: { someValue: number }) => {
- lib.registerContext({
- id: 'event_menu',
- title: 'Event menu',
- menu: 'some_menu',
- options: [
- {
- title: `Event value: ${args.someValue}`,
- },
- ],
- });
-
- lib.showContext('event_menu');
-});
-```
-
-
+ lib.showContext('event_menu');
+ });
+ ```
+
Lastly we register a test command to show the `some_menu` menu.
-
-
-```lua
-RegisterCommand('testcontext', function()
- lib.showContext('some_menu')
-end)
-```
-
-
-
-
-```ts
-RegisterCommand('testcontext', () => {
- lib.showContext('some_menu');
-});
-```
-
-
+
+ ```lua
+ RegisterCommand('testcontext', function()
+ lib.showContext('some_menu')
+ end)
+ ```
+
+
+ ```ts
+ RegisterCommand('testcontext', () => {
+ lib.showContext('some_menu');
+ });
+ ```
+
The data from the `args` table in the menu is passed as a first argument to the event you register.
diff --git a/pages/ox_lib/Modules/Interface/Client/input.mdx b/pages/ox_lib/Modules/Interface/Client/input.mdx
index 5bb4d561..c7290e5e 100644
--- a/pages/ox_lib/Modules/Interface/Client/input.mdx
+++ b/pages/ox_lib/Modules/Interface/Client/input.mdx
@@ -5,28 +5,25 @@ title: Input Dialog
import { Tabs, Tab } from 'nextra-theme-docs';
import { Callout } from 'nextra/components';
-The input dialog window allows you to take data from the user
-by setting input fields.
+# Input Dialog
-### lib.inputDialog
+The input dialog window allows you to take data from the user by setting input fields.
+
+## lib.inputDialog
-
+
+ ```lua
+ lib.inputDialog(heading, rows, options)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.inputDialog(heading, rows, options)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.inputDialog(heading, rows, options);
-```
-
-
+ lib.inputDialog(heading, rows, options);
+ ```
+
- heading: `string`
@@ -36,7 +33,7 @@ lib.inputDialog(heading, rows, options);
- allowCancel: `boolean`
- If true the user will not be able to cancel and close the input dialog until submitted.
-Available properties per field type:
+### Field Type Properties
- input
@@ -168,32 +165,26 @@ The callback data is promise based meaning that the thread will not continue exe
The data returned will be a table (array), indexes represent the rows sent to the dialog, so if we want data from the first field that would be index `1` (`0`), if we want data from the third field, that would be index `3` (`2`), etc...
-
-Field types such as `date`, `date-range` and `time` return a unix timestamp on the set value.
-
+ Field types such as `date`, `date-range` and `time` return a unix timestamp on the set value.
-### lib.closeInputDialog
+## lib.closeInputDialog
-Force closes the active input dialog and sets its return data as `nil`
+Force closes the active input dialog and sets its return data as `nil`.
-
+
+ ```lua
+ lib.closeInputDialog()
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.closeInputDialog()
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.closeInputDialog();
-```
-
-
+ lib.closeInputDialog();
+ ```
+
## Usage Example
@@ -201,32 +192,26 @@ lib.closeInputDialog();
### Basic
-
+
+ ```lua
+ local input = lib.inputDialog('Basic dialog', {'First row', 'Second row'})
-```lua
-local input = lib.inputDialog('Basic dialog', {'First row', 'Second row'})
+ if not input then return end
+ print(json.encode(input), input[1], input[2])
+ ```
+
+
+
+ This function is **asynchronous** requiring you to do a `.then` callback on the promise or make your function `async`.
+
-if not input then return end
-print(json.encode(input), input[1], input[2])
-```
+ ```ts
+ const input = await lib.inputDialog('Basic dialog', ['First row', 'Second row']);
-
-
-
-
-
-This function is **asynchronous** requiring you to do a `.then` callback on the promise or make your function `async`.
-
-
-
-```ts
-const input = await lib.inputDialog('Basic dialog', ['First row', 'Second row']);
-
-if (!input) return;
-console.log(input, input[0], input[1]);
-```
-
-
+ if (!input) return;
+ console.log(input, input[0], input[1]);
+ ```
+

@@ -234,59 +219,53 @@ console.log(input, input[0], input[1]);
### Advanced
-
+
+ ```lua
+ local input = lib.inputDialog('Dialog title', {
+ {type = 'input', label = 'Text input', description = 'Some input description', required = true, min = 4, max = 16},
+ {type = 'number', label = 'Number input', description = 'Some number description', icon = 'hashtag'},
+ {type = 'checkbox', label = 'Simple checkbox'},
+ {type = 'color', label = 'Colour input', default = '#eb4034'},
+ {type = 'date', label = 'Date input', icon = {'far', 'calendar'}, default = true, format = "DD/MM/YYYY"}
+ })
-```lua
-local input = lib.inputDialog('Dialog title', {
- {type = 'input', label = 'Text input', description = 'Some input description', required = true, min = 4, max = 16},
- {type = 'number', label = 'Number input', description = 'Some number description', icon = 'hashtag'},
- {type = 'checkbox', label = 'Simple checkbox'},
- {type = 'color', label = 'Colour input', default = '#eb4034'},
- {type = 'date', label = 'Date input', icon = {'far', 'calendar'}, default = true, format = "DD/MM/YYYY"}
-})
+ print(json.encode(input))
-print(json.encode(input))
+ -- Getting rgb values from colour picker
+ local rgb = lib.math.torgba(input[4])
--- 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)
+ local timestamp = math.floor(input[5] / 1000)
+ local date = os.date('%Y-%m-%d %H:%M:%S', timestamp)
+ ```
+
+
+
+ This function is **asynchronous** requiring you to do a `.then` callback on the promise or make your function `async`.
+
--- Transforming date timestamp to a readable format with Lua's os library (server-only)
-local timestamp = math.floor(input[5] / 1000)
-local date = os.date('%Y-%m-%d %H:%M:%S', timestamp)
-```
+ ```ts
+ const input = await lib.inputDialog('Police locker', [
+ { type: 'input', label: 'Text input', description: 'Some input description', required: true, min: 3, max: 16 },
+ { type: 'number', label: 'Number input', description: 'Some number description', icon: 'hashtag' },
+ { type: 'checkbox', label: 'Simple checkbox' },
+ { type: 'color', label: 'Colour input', default: '#eb4034' },
+ { type: 'date', label: 'Date input', icon: ['far', 'calendar'], default: true, format: 'DD/MM/YYYY' },
+ ]);
-
-
+ console.log(JSON.stringify(input, null, 2));
-
+ // Getting r, g and b values from colour picker
+ const regExp = /rgb\((\d+),\s*(\d+),\s*(\d+)\)/;
+ const colourInput = input[3];
-This function is **asynchronous** requiring you to do a `.then` callback on the promise or make your function `async`.
+ const color = regExp.exec(colourInput);
-
+ if (!color) return;
-```ts
-const input = await lib.inputDialog('Police locker', [
- { type: 'input', label: 'Text input', description: 'Some input description', required: true, min: 3, max: 16 },
- { type: 'number', label: 'Number input', description: 'Some number description', icon: 'hashtag' },
- { type: 'checkbox', label: 'Simple checkbox' },
- { type: 'color', label: 'Colour input', default: '#eb4034' },
- { type: 'date', label: 'Date input', icon: ['far', 'calendar'], default: true, format: 'DD/MM/YYYY' },
-]);
-
-console.log(JSON.stringify(input, null, 2));
-
-// Getting r, g and b values from colour picker
-const regExp = /rgb\((\d+),\s*(\d+),\s*(\d+)\)/;
-const colourInput = input[3];
-
-const color = regExp.exec(colourInput);
-
-if (!color) return;
-
-console.log(+color[1], +color[2], +color[3]);
-```
-
-
+ console.log(+color[1], +color[2], +color[3]);
+ ```
+

diff --git a/pages/ox_lib/Modules/Interface/Client/menu.mdx b/pages/ox_lib/Modules/Interface/Client/menu.mdx
index 08c611d7..c75b74ea 100644
--- a/pages/ox_lib/Modules/Interface/Client/menu.mdx
+++ b/pages/ox_lib/Modules/Interface/Client/menu.mdx
@@ -5,29 +5,27 @@ title: Menu
import { Tabs, Tab } from 'nextra-theme-docs';
import { Callout } from 'nextra/components';
+# Menu
+
Keyboard navigation menu with specific event functions.
-### lib.registerMenu
+## lib.registerMenu
Registers and caches a menu under the specified id.
-
+
+ ```lua
+ lib.registerMenu(data, cb)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.registerMenu(data, cb)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.registerMenu(data, cb);
-```
-
-
+ lib.registerMenu(data, cb);
+ ```
+
- data: `table` (`object`)
@@ -74,97 +72,81 @@ lib.registerMenu(data, cb);
- cb: `function`(selected: `number`, scrollIndex: `number`, args: `{[string]: any}`)
- Callback function when the menu item is pressed.
-### lib.showMenu
+## lib.showMenu
Displays the menu with the provided id.
-
+
+ ```lua
+ lib.showMenu(id)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.showMenu(id)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.showMenu(id);
-```
-
-
+ lib.showMenu(id);
+ ```
+
- id: `string`
-### lib.hideMenu
+## lib.hideMenu
-
+
+ ```lua
+ lib.hideMenu(onExit)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.hideMenu(onExit)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.hideMenu(onExit);
-```
-
-
+ lib.hideMenu(onExit);
+ ```
+
- onExit?: `boolean`
- If true runs the menu's `onClose` function.
-### lib.getOpenMenu
+## lib.getOpenMenu
Returns the id of the currently open menu.
-
+
+ ```lua
+ lib.getOpenMenu()
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.getOpenMenu()
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.getOpenMenu();
-```
-
-
+ lib.getOpenMenu();
+ ```
+
-### lib.setMenuOptions
+## lib.setMenuOptions
-
+
+ ```lua
+ lib.setMenuOptions(id, options, index)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.setMenuOptions(id, options, index)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.setMenuOptions(id, options, index);
-```
-
-
+ lib.setMenuOptions(id, options, index);
+ ```
+
- id: `string`
@@ -172,30 +154,26 @@ lib.setMenuOptions(id, options, index);
- index?: `number`
- If specified only sets the options table on the specified options index.
-**Example:**
+### Example
Replaces the 3rd index option of the specified menu
-
+
+ ```lua
+ lib.setMenuOptions('some_menu_id', {label = 'New option', icon = 'plus'}, 3)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.setMenuOptions('some_menu_id', {label = 'New option', icon = 'plus'}, 3)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.setMenuOptions('some_menu_id', { label: 'New option', icon: 'plus' }, 3);
-```
-
-
+ lib.setMenuOptions('some_menu_id', { label: 'New option', icon: 'plus' }, 3);
+ ```
+
-### Usage Example
+## Usage Example
First we register the menu with our specified options then we call the show function in the command.
@@ -204,127 +182,123 @@ First we register the menu with our specified options then we call the show func
-
+
+ ```lua
+ lib.registerMenu({
+ id = 'some_menu_id',
+ title = 'Menu title',
+ position = 'top-right',
+ onSideScroll = function(selected, scrollIndex, args)
+ print("Scroll: ", selected, scrollIndex, args)
+ end,
+ onSelected = function(selected, secondary, args)
+ if not secondary then
+ print("Normal button")
+ else
+ if args.isCheck then
+ print("Check button")
+ end
-```lua
-lib.registerMenu({
- id = 'some_menu_id',
- title = 'Menu title',
- position = 'top-right',
- onSideScroll = function(selected, scrollIndex, args)
- print("Scroll: ", selected, scrollIndex, args)
- end,
- onSelected = function(selected, secondary, args)
- if not secondary then
- print("Normal button")
- else
- if args.isCheck then
- print("Check button")
+ if args.isScroll then
+ print("Scroll button")
+ end
end
-
- if args.isScroll then
- print("Scroll button")
+ print(selected, secondary, json.encode(args, {indent=true}))
+ end,
+ onCheck = function(selected, checked, args)
+ print("Check: ", selected, checked, args)
+ end,
+ onClose = function(keyPressed)
+ print('Menu closed')
+ if keyPressed then
+ print(('Pressed %s to close the menu'):format(keyPressed))
end
- end
- print(selected, secondary, json.encode(args, {indent=true}))
- end,
- onCheck = function(selected, checked, args)
- print("Check: ", selected, checked, args)
- end,
- onClose = function(keyPressed)
- print('Menu closed')
- if keyPressed then
- print(('Pressed %s to close the menu'):format(keyPressed))
- end
- end,
- options = {
- {label = 'Simple button', description = 'It has a description!'},
- {label = 'Checkbox button', checked = true},
- {label = 'Scroll button with icon', icon = 'arrows-up-down-left-right', values={'hello', 'there'}},
- {label = 'Button with args', args = {someArg = 'nice_button'}},
- {label = 'List button', values = {'You', 'can', 'side', 'scroll', 'this'}, description = 'It also has a description!'},
- {label = 'List button with default index', values = {'You', 'can', 'side', 'scroll', 'this'}, defaultIndex = 5},
- {label = 'List button with args', values = {'You', 'can', 'side', 'scroll', 'this'}, args = {someValue = 3, otherValue = 'value'}},
- }
-}, function(selected, scrollIndex, args)
- print(selected, scrollIndex, args)
-end)
-
-RegisterCommand('testmenu', function()
- lib.showMenu('some_menu_id')
-end)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.registerMenu(
- {
- id: 'some_menu_id',
- title: 'Menu title',
- position: 'top-right',
- onSideScroll: (selected, scrollIndex, args) => {
- console.log('Scroll: ', selected, scrollIndex, args);
- },
- onSelected: (selected, secondary, args) => {
- if (!secondary) {
- console.log('Normal button');
- } else {
- if (args.isCheck) {
- console.log('Check button');
+ end,
+ options = {
+ {label = 'Simple button', description = 'It has a description!'},
+ {label = 'Checkbox button', checked = true},
+ {label = 'Scroll button with icon', icon = 'arrows-up-down-left-right', values={'hello', 'there'}},
+ {label = 'Button with args', args = {someArg = 'nice_button'}},
+ {label = 'List button', values = {'You', 'can', 'side', 'scroll', 'this'}, description = 'It also has a description!'},
+ {label = 'List button with default index', values = {'You', 'can', 'side', 'scroll', 'this'}, defaultIndex = 5},
+ {label = 'List button with args', values = {'You', 'can', 'side', 'scroll', 'this'}, args = {someValue = 3, otherValue = 'value'}},
}
+ }, function(selected, scrollIndex, args)
+ print(selected, scrollIndex, args)
+ end)
- if (args.isScroll) {
- console.log('Scroll button');
- }
- }
- console.log(selected, secondary, JSON.stringify(args, null, 2));
- },
- onCheck: (selected, checked, args) => {
- console.log('Check: ', selected, checked, args);
- },
- onClose: (keyPressed) => {
- console.log('Menu closed');
- if (keyPressed) {
- console.log(`Pressed ${keyPressed} to close the menu`);
- }
- },
- options: [
- { label: 'Simple button', description: 'It has a description!' },
- { label: 'Checkbox button', checked: true },
- { label: 'Scroll button with icon', icon: 'arrows-up-down-left-right', values: ['hello', 'there'] },
- { label: 'Button with args', args: { someArg: 'nice_button' } },
+ RegisterCommand('testmenu', function()
+ lib.showMenu('some_menu_id')
+ end)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
+
+ lib.registerMenu(
{
- label: 'List button',
- values: ['You', 'can', 'side', 'scroll', 'this'],
- description: 'It also has a description!',
- },
- { label: 'List button with default index', values: ['You', 'can', 'side', 'scroll', 'this'], defaultIndex: 5 },
- {
- label: 'List button with args',
- values: ['You', 'can', 'side', 'scroll', 'this'],
- args: { someValue: 3, otherValue: 'value' },
- },
- ],
- },
- (selected, scrollIndex, args) => {
- console.log(selected, scrollIndex, args);
- }
-);
+ id: 'some_menu_id',
+ title: 'Menu title',
+ position: 'top-right',
+ onSideScroll: (selected, scrollIndex, args) => {
+ console.log('Scroll: ', selected, scrollIndex, args);
+ },
+ onSelected: (selected, secondary, args) => {
+ if (!secondary) {
+ console.log('Normal button');
+ } else {
+ if (args.isCheck) {
+ console.log('Check button');
+ }
-RegisterCommand(
- 'testmenu',
- () => {
- lib.showMenu('some_menu_id');
- },
- false
-);
-```
+ if (args.isScroll) {
+ console.log('Scroll button');
+ }
+ }
+ console.log(selected, secondary, JSON.stringify(args, null, 2));
+ },
+ onCheck: (selected, checked, args) => {
+ console.log('Check: ', selected, checked, args);
+ },
+ onClose: (keyPressed) => {
+ console.log('Menu closed');
+ if (keyPressed) {
+ console.log(`Pressed ${keyPressed} to close the menu`);
+ }
+ },
+ options: [
+ { label: 'Simple button', description: 'It has a description!' },
+ { label: 'Checkbox button', checked: true },
+ { label: 'Scroll button with icon', icon: 'arrows-up-down-left-right', values: ['hello', 'there'] },
+ { label: 'Button with args', args: { someArg: 'nice_button' } },
+ {
+ label: 'List button',
+ values: ['You', 'can', 'side', 'scroll', 'this'],
+ description: 'It also has a description!',
+ },
+ { label: 'List button with default index', values: ['You', 'can', 'side', 'scroll', 'this'], defaultIndex: 5 },
+ {
+ label: 'List button with args',
+ values: ['You', 'can', 'side', 'scroll', 'this'],
+ args: { someValue: 3, otherValue: 'value' },
+ },
+ ],
+ },
+ (selected, scrollIndex, args) => {
+ console.log(selected, scrollIndex, args);
+ }
+ );
-
+ RegisterCommand(
+ 'testmenu',
+ () => {
+ lib.showMenu('some_menu_id');
+ },
+ false
+ );
+ ```
+

diff --git a/pages/ox_lib/Modules/Interface/Client/notify.mdx b/pages/ox_lib/Modules/Interface/Client/notify.mdx
index 9a1c9375..b850b5c8 100644
--- a/pages/ox_lib/Modules/Interface/Client/notify.mdx
+++ b/pages/ox_lib/Modules/Interface/Client/notify.mdx
@@ -5,40 +5,34 @@ title: Notifications
import { Tabs, Tab } from 'nextra-theme-docs';
import { Callout } from 'nextra/components';
-### lib.notify
+# Notifications
+
+## lib.notify
Custom notifications with a lot of styling options.
-
+
+
+
+ ```lua
+ lib.notify(data)
+ ```
+
+
+ ```lua
+ TriggerClientEvent('ox_lib:notify', source, data)
+ ```
+
+
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-
-
-
-```lua
-lib.notify(data)
-```
-
-
-
-
-```lua
-TriggerClientEvent('ox_lib:notify', source, data)
-```
-
-
-
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.notify(data);
-```
-
-
+ lib.notify(data);
+ ```
+
- id?: `string`
@@ -57,94 +51,84 @@ lib.notify(data);
- React CSS styling format
- icon?: `string`
- Font Awesome 6 icon name
-- iconColor: `string`
+- iconColor?: `string`
-
-Setting `iconColor` will get rid of the contrasted icon colour and it's circular background.
-
+ Setting `iconColor` will get rid of the contrasted icon colour and it's circular background.
-### Usage Example
+## Usage Example
-#### Standard
+### Standard
-
+
+ ```lua
+ lib.notify({
+ title = 'Notification title',
+ description = 'Notification description',
+ type = 'success'
+ })
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.notify({
- title = 'Notification title',
- description = 'Notification description',
- type = 'success'
-})
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.notify({
- title: 'Notification title',
- description: 'Notification description',
- type: 'success',
-});
-```
-
-
+ lib.notify({
+ title: 'Notification title',
+ description: 'Notification description',
+ type: 'success',
+ });
+ ```
+

-#### Custom
+### Custom
-
+
+ ```lua
+ lib.notify({
+ id = 'some_identifier',
+ title = 'Notification title',
+ description = 'Notification description',
+ position = 'top',
+ style = {
+ backgroundColor = '#141517',
+ color = '#C1C2C5',
+ ['.description'] = {
+ color = '#909296'
+ }
+ },
+ icon = 'ban',
+ iconColor = '#C53030'
+ })
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.notify({
- id = 'some_identifier',
- title = 'Notification title',
- description = 'Notification description',
- position = 'top',
- style = {
- backgroundColor = '#141517',
- color = '#C1C2C5',
- ['.description'] = {
- color = '#909296'
- }
- },
- icon = 'ban',
- iconColor = '#C53030'
-})
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.notify({
- id: 'some_identifier',
- title: 'Notification title',
- description: 'Notification description',
- position: 'top',
- style: {
- backgroundColor: '#141517',
- color: '#C1C2C5',
- '.decription': {
- color: '#909296',
- },
- },
- icon: 'ban',
- iconColor: '#C53030',
-});
-```
-
-
+ lib.notify({
+ id: 'some_identifier',
+ title: 'Notification title',
+ description: 'Notification description',
+ position: 'top',
+ style: {
+ backgroundColor: '#141517',
+ color: '#C1C2C5',
+ '.decription': {
+ color: '#909296',
+ },
+ },
+ icon: 'ban',
+ iconColor: '#C53030',
+ });
+ ```
+

diff --git a/pages/ox_lib/Modules/Interface/Client/progress.mdx b/pages/ox_lib/Modules/Interface/Client/progress.mdx
index 6ba09864..fffda3c6 100644
--- a/pages/ox_lib/Modules/Interface/Client/progress.mdx
+++ b/pages/ox_lib/Modules/Interface/Client/progress.mdx
@@ -5,134 +5,128 @@ title: Progress
import { Tabs, Tab } from 'nextra-theme-docs';
import { Callout } from 'nextra/components';
+# Progress
+
## lib.progressBar
Displays a running progress bar.
-
+
+ ```lua
+ lib.progressBar(data)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client'
-```lua
-lib.progressBar(data)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client'
-
-lib.progressBar(data)
-```
-
-
+ lib.progressBar(data)
+ ```
+
-* duration: `number`
-* label: `string`
-* useWhileDead?: `boolean`
-* allowRagdoll?: `boolean`
-* allowCuffed?: `boolean`
-* allowFalling?: `boolean`
-* canCancel?: `boolean`
-* anim?: `table` (`object`)
- * dict?: `string`
- * Must specify either scenario or dict
- * clip: `string`
- * flag?: `number`
- * Default: `49`
- * blendIn?: `float`
- * Default: `3.0`
- * blendOut?: `float`
- * Default: `1.0`
- * duration?: `number`
- Default: `-1`
- * playbackRate?: `number`
- Default: `0`
- * lockX?: `boolean`
- * lockY?: `boolean`
- * lockZ?: `boolean`
- * scenario?: `string`
- * Must specify either scenario or dict
- * playEnter?: `boolean`
- * Default: `true`
-* prop?: `table` (`object` or `array`)
- * [ If you want to define multiple props, you can pass them as individual tables (array of objects) ]
- * model: `hash`
- * bone?: `number`
- * Default: `60309`
- * pos: `table`
- * x: `number`
- * y: `number`
- * z: `number`
- * rot: `table` (`object`)
- * x: `number`
- * y: `number`
- * z: `number`
-* disable?: `table` (`object`)
- * move?: `boolean`
- * car?: `boolean`
- * combat?: `boolean`
- * mouse?: `boolean`
+- duration: `number`
+- label: `string`
+- useWhileDead?: `boolean`
+- allowRagdoll?: `boolean`
+- allowCuffed?: `boolean`
+- allowFalling?: `boolean`
+- canCancel?: `boolean`
+- anim?: `table` (`object`)
+ - dict?: `string`
+ - Must specify either scenario or dict
+ - clip: `string`
+ - flag?: `number`
+ - Default: `49`
+ - blendIn?: `float`
+ - Default: `3.0`
+ - blendOut?: `float`
+ - Default: `1.0`
+ - duration?: `number`
+ - Default: `-1`
+ - playbackRate?: `number`
+ - Default: `0`
+ - lockX?: `boolean`
+ - lockY?: `boolean`
+ - lockZ?: `boolean`
+ - scenario?: `string`
+ - Must specify either scenario or dict
+ - playEnter?: `boolean`
+ - Default: `true`
+- prop?: `table` (`object` or `array`)
+ - [ If you want to define multiple props, you can pass them as individual tables (array of objects) ]
+ - model: `hash`
+ - bone?: `number`
+ - Default: `60309`
+ - pos: `table`
+ - x: `number`
+ - y: `number`
+ - z: `number`
+ - rot: `table` (`object`)
+ - x: `number`
+ - y: `number`
+ - z: `number`
+- disable?: `table` (`object`)
+ - move?: `boolean`
+ - car?: `boolean`
+ - combat?: `boolean`
+ - mouse?: `boolean`
### Usage Example
-
+
+ ```lua
+ if lib.progressBar({
+ duration = 2000,
+ label = 'Drinking water',
+ useWhileDead = false,
+ canCancel = true,
+ disable = {
+ car = true,
+ },
+ anim = {
+ dict = 'mp_player_intdrink',
+ clip = 'loop_bottle'
+ },
+ prop = {
+ model = `prop_ld_flow_bottle`,
+ pos = vec3(0.03, 0.03, 0.02),
+ rot = vec3(0.0, 0.0, -1.5)
+ },
+ }) then print('Do stuff when complete') else print('Do stuff when cancelled') end
+ ```
+
+
+
+ This function is **asynchronous** requiring you to do a `.then` callback on the promise or make your function `async`.
+
-```lua
-if lib.progressBar({
- duration = 2000,
- label = 'Drinking water',
- useWhileDead = false,
- canCancel = true,
- disable = {
- car = true,
- },
- anim = {
- dict = 'mp_player_intdrink',
- clip = 'loop_bottle'
- },
- prop = {
- model = `prop_ld_flow_bottle`,
- pos = vec3(0.03, 0.03, 0.02),
- rot = vec3(0.0, 0.0, -1.5)
- },
-}) then print('Do stuff when complete') else print('Do stuff when cancelled') end
-```
+ ```ts
+ import lib from '@overextended/ox_lib/client'
-
-
-
-
-This function is **asynchronous** requiring you to do a `.then` callback on the promise or make your function `async`.
-
-
-```ts
-import lib from '@overextended/ox_lib/client'
-
-if (await lib.progressBar({
- duration: 2000,
- label: 'Drinking water',
- useWhileDead: false,
- canCancel: true,
- disable: {
- car: true,
- },
- anim: {
- dict: 'mp_player_intdrink',
- clip: 'loop_bottle'
- },
- prop: {
- model: `prop_ld_flow_bottle`,
- pos: {x: 0.03, y: 0.03, z: 0.02},
- rot: {x: 0.0, y: 0.0, z: -1.5}
- },
-})) console.log('Do stuff when complete');
-else console.log('Do stuff when cancelled')
-```
-
-
+ if (await lib.progressBar({
+ duration: 2000,
+ label: 'Drinking water',
+ useWhileDead: false,
+ canCancel: true,
+ disable: {
+ car: true,
+ },
+ anim: {
+ dict: 'mp_player_intdrink',
+ clip: 'loop_bottle'
+ },
+ prop: {
+ model: `prop_ld_flow_bottle`,
+ pos: {x: 0.03, y: 0.03, z: 0.02},
+ rot: {x: 0.0, y: 0.0, z: -1.5}
+ },
+ })) console.log('Do stuff when complete');
+ else console.log('Do stuff when cancelled')
+ ```
+

@@ -142,131 +136,123 @@ else console.log('Do stuff when cancelled')
Similar to `lib.progressBar` except it displays a circle and you can define a position.
-
+
+ ```lua
+ lib.progressCircle(data)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client'
-```lua
-lib.progressCircle(data)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client'
-
-lib.progressCircle(data)
-```
-
-
+ lib.progressCircle(data)
+ ```
+
-* duration: `number`
-* label?: `string`
-* position?: `'middle'` or `'bottom'`
- * Default: `'middle'`
-* useWhileDead?: `boolean`
-* allowRagdoll?: `boolean`
-* allowCuffed?: `boolean`
-* allowFalling?: `boolean`
-* canCancel?: `boolean`
-* anim?: `table` (`object`)
- * dict?: `string`
- * Must specify either scenario or dict
- * clip: `string`
- * flag?: `number`
- * Default: `49`
- * blendIn?: `float`
- * Default: `3.0`
- * blendOut?: `float`
- * Default: `1.0`
- * duration?: `number`
- Default: `-1`
- * playbackRate?: `number`
- Default: `0`
- * lockX?: `boolean`
- * lockY?: `boolean`
- * lockZ?: `boolean`
- * scenario?: `string`
- * Must specify either scenario or dict
- * playEnter?: `boolean`
- * Default: `true`
-* prop?: `table` (`object` or `array`)
- * [ If you want to define multiple props, you can pass them as individual tables (array of objects) ]
- * model: `hash`
- * bone?: `number`
- * Default: `60309`
- * pos: `table`
- * x: `number`
- * y: `number`
- * z: `number`
- * rot: `table` (`object`)
- * x: `number`
- * y: `number`
- * z: `number`
-* disable?: `table` (`object`)
- * move?: `boolean`
- * car?: `boolean`
- * combat?: `boolean`
- * mouse?: `boolean`
+- duration: `number`
+- label?: `string`
+- position?: `'middle'` or `'bottom'`
+ - Default: `'middle'`
+- useWhileDead?: `boolean`
+- allowRagdoll?: `boolean`
+- allowCuffed?: `boolean`
+- allowFalling?: `boolean`
+- canCancel?: `boolean`
+- anim?: `table` (`object`)
+ - dict?: `string`
+ - Must specify either scenario or dict
+ - clip: `string`
+ - flag?: `number`
+ - Default: `49`
+ - blendIn?: `float`
+ - Default: `3.0`
+ - blendOut?: `float`
+ - Default: `1.0`
+ - duration?: `number`
+ - Default: `-1`
+ - playbackRate?: `number`
+ - Default: `0`
+ - lockX?: `boolean`
+ - lockY?: `boolean`
+ - lockZ?: `boolean`
+ - scenario?: `string`
+ - Must specify either scenario or dict
+ - playEnter?: `boolean`
+ - Default: `true`
+- prop?: `table` (`object` or `array`)
+ - [ If you want to define multiple props, you can pass them as individual tables (array of objects) ]
+ - model: `hash`
+ - bone?: `number`
+ - Default: `60309`
+ - pos: `table`
+ - x: `number`
+ - y: `number`
+ - z: `number`
+ - rot: `table` (`object`)
+ - x: `number`
+ - y: `number`
+ - z: `number`
+- disable?: `table` (`object`)
+ - move?: `boolean`
+ - car?: `boolean`
+ - combat?: `boolean`
+ - mouse?: `boolean`
### Usage Example
-
+
+ ```lua
+ if lib.progressCircle({
+ duration = 2000,
+ position = 'bottom',
+ useWhileDead = false,
+ canCancel = true,
+ disable = {
+ car = true,
+ },
+ anim = {
+ dict = 'mp_player_intdrink',
+ clip = 'loop_bottle'
+ },
+ prop = {
+ model = `prop_ld_flow_bottle`,
+ pos = vec3(0.03, 0.03, 0.02),
+ rot = vec3(0.0, 0.0, -1.5)
+ },
+ }) then print('Do stuff when complete') else print('Do stuff when cancelled') end
+ ```
+
+
+
+ This function is **asynchronous** requiring you to do a `.then` callback on the promise or make your function `async`.
+
-```lua
-if lib.progressCircle({
- duration = 2000,
- position = 'bottom',
- useWhileDead = false,
- canCancel = true,
- disable = {
- car = true,
- },
- anim = {
- dict = 'mp_player_intdrink',
- clip = 'loop_bottle'
- },
- prop = {
- model = `prop_ld_flow_bottle`,
- pos = vec3(0.03, 0.03, 0.02),
- rot = vec3(0.0, 0.0, -1.5)
- },
-}) then print('Do stuff when complete') else print('Do stuff when cancelled') end
-```
+ ```ts
+ import lib from '@overextended/ox_lib/client'
-
-
-
-
-This function is **asynchronous** requiring you to do a `.then` callback on the promise or make your function `async`.
-
-
-```ts
-import lib from '@overextended/ox_lib/client'
-
-if (await lib.progressCircle({
- duration: 2000,
- position: 'bottom',
- useWhileDead: false,
- canCancel: true,
- disable: {
- car: true,
- },
- anim: {
- dict: 'mp_player_intdrink',
- clip: 'loop_bottle'
- },
- prop: {
- model: `prop_ld_flow_bottle`,
- pos: {x: 0.03, y: 0.03, z: 0.02},
- rot: {x: 0.0, y: 0.0, z: -1.5}
- },
-})) console.log('Do stuff when complete')
-else console.log('Do stuff when cancelled')
-```
-
-
+ if (await lib.progressCircle({
+ duration: 2000,
+ position: 'bottom',
+ useWhileDead: false,
+ canCancel: true,
+ disable: {
+ car: true,
+ },
+ anim: {
+ dict: 'mp_player_intdrink',
+ clip: 'loop_bottle'
+ },
+ prop: {
+ model: `prop_ld_flow_bottle`,
+ pos: {x: 0.03, y: 0.03, z: 0.02},
+ rot: {x: 0.0, y: 0.0, z: -1.5}
+ },
+ })) console.log('Do stuff when complete')
+ else console.log('Do stuff when cancelled')
+ ```
+

@@ -276,22 +262,18 @@ else console.log('Do stuff when cancelled')
Returns true if a progress bar is currently active.
-
+
+ ```lua
+ lib.progressActive()
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client'
-```lua
-lib.progressActive()
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client'
-
-lib.progressActive()
-```
-
-
+ lib.progressActive()
+ ```
+
## lib.cancelProgress
@@ -300,20 +282,16 @@ If there is a progress bar active and the
progress bar can be cancelled then it cancels it.
-
+
+ ```lua
+ lib.cancelProgress()
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client'
-```lua
-lib.cancelProgress()
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client'
-
-lib.cancelProgress()
-```
-
-
+ lib.cancelProgress()
+ ```
+
diff --git a/pages/ox_lib/Modules/Interface/Client/radial.mdx b/pages/ox_lib/Modules/Interface/Client/radial.mdx
index 572d36af..c74b296f 100644
--- a/pages/ox_lib/Modules/Interface/Client/radial.mdx
+++ b/pages/ox_lib/Modules/Interface/Client/radial.mdx
@@ -5,31 +5,29 @@ title: Radial Menu
import { Tabs, Tab } from 'nextra-theme-docs';
import { Callout } from 'nextra/components';
+# Radial Menu
+
- Radial menu has a global menu that's by default accessed with `z` and only displays when there is at least one item.
- You can add and remove items from the global menu using `lib.addRadialItem` and `lib.removeRadialItem`.
- Use `lib.registerRadial` for creating sub menus and use the `menu` property on the items to open those sub menus.
-### lib.addRadialItem
+## lib.addRadialItem
Item or array of items added to the global radial menu.
-
+
+ ```lua
+ lib.addRadialItem(items)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.addRadialItem(items)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.addRadialItem(items);
-```
-
-
+ lib.addRadialItem(items);
+ ```
+
- items: `table` (`object` or `array`)
@@ -44,75 +42,63 @@ lib.addRadialItem(items);
- Function that's ran when a user clicks the item.
- keepOpen?: `boolean`
-### lib.removeRadialItem
+## lib.removeRadialItem
Id of an item to be removed from the global menu.
-
+
+ ```lua
+ lib.removeRadialItem(item)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.removeRadialItem(item)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.removeRadialItem(item);
-```
-
-
+ lib.removeRadialItem(item);
+ ```
+
- id: `string`
-### lib.clearRadialItems
+## lib.clearRadialItems
Removes all items from the radial menu.
-
+
+ ```lua
+ lib.clearRadialItems()
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.clearRadialItems()
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.clearRadialItems();
-```
-
-
+ lib.clearRadialItems();
+ ```
+
-### lib.registerRadial
+## lib.registerRadial
Registers a radial sub menu with predefined options.
-
+
+ ```lua
+ lib.registerRadial(radial)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.registerRadial(radial)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.registerRadial(radial);
-```
-
-
+ lib.registerRadial(radial);
+ ```
+
- radial: `table` (`object`)
@@ -127,236 +113,216 @@ lib.registerRadial(radial);
- onSelect?: `function(currentMenu: string | nil, itemIndex: number)` | `string`
- Function that's ran when a user clicks the item.
-### lib.hideRadial
+## lib.hideRadial
Hides the radial menu if one is open.
-
+
+ ```lua
+ lib.hideRadial()
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.hideRadial()
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.hideRadial();
-```
-
-
+ lib.hideRadial();
+ ```
+
-### lib.disableRadial
+## lib.disableRadial
Disallow players from opening the radial menu.
-
+
+ ```lua
+ lib.disableRadial(state)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.disableRadial(state)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.disableRadial(state);
-```
-
-
+ lib.disableRadial(state);
+ ```
+
- state: `boolean`
- Whether or not radial menu should be disabled
-### lib.getCurrentRadialId
+## lib.getCurrentRadialId
Returns the id of the currently open radial menu.
-
+
+ ```lua
+ local id = lib.getCurrentRadialId()
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-local id = lib.getCurrentRadialId()
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-let id = lib.getCurrentRadialId();
-```
-
-
+ let id = lib.getCurrentRadialId();
+ ```
+
-### Usage Example
+## 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 its density.
-
+ 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 its density.
Here's a use case example with some global options and an option utilising the lib's points system.
-
+
+ ```lua
+ exports('myMenuHandler', function(menu, item)
+ print(menu, item)
-```lua
-exports('myMenuHandler', function(menu, item)
- print(menu, item)
+ if menu == 'police_menu' and item == 1 then
+ print('Handcuffs')
+ end
+ end)
- if menu == 'police_menu' and item == 1 then
- print('Handcuffs')
- end
-end)
-
-lib.registerRadial({
- id = 'police_menu',
- items = {
- {
- label = 'Handcuff',
- icon = 'handcuffs',
- onSelect = 'myMenuHandler'
- },
- {
- label = 'Frisk',
- icon = 'hand'
- },
- {
- label = 'Fingerprint',
- icon = 'fingerprint'
- },
- {
- label = 'Jail',
- icon = 'bus'
- },
- {
- label = 'Search',
- icon = 'magnifying-glass',
- onSelect = function()
- print('Search')
- end
- }
- }
-})
-
-lib.addRadialItem({
- {
- id = 'police',
- label = 'Police',
- icon = 'shield-halved',
- menu = 'police_menu'
- },
- {
- id = 'business_stuff',
- label = 'Business',
- icon = 'briefcase',
- onSelect = function()
- print("Business")
- end
- }
-})
-
-local coords = GetEntityCoords(cache.ped)
-local point = lib.points.new(coords, 5)
-
-function point:onEnter()
- lib.addRadialItem({
- id = 'garage_access',
- icon = 'warehouse',
- label = 'Garage',
- onSelect = function()
- print('Garage')
- end
- })
-end
-
-function point:onExit()
- lib.removeRadialItem('garage_access')
-end
-```
-
-
-
-
-
-
-Points system in the lib isn't available for the npm package.
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client'
-
-exports('myMenuHandler', (menu, item) => {
- console.log(menu, item)
-
- if (menu === 'police_menu' and item === 1) {
- console.log('Handcuffs')
- }
-})
-
-lib.registerRadial({
- id: 'police_menu',
- items: [
- {
- label: 'Handcuff',
- icon: 'handcuffs',
- onSelect: 'myMenuHandler'
- },
- {
- label: 'Frisk',
- icon: 'hand'
- },
- {
- label: 'Fingerprint',
- icon: 'fingerprint'
- },
- {
- label: 'Jail',
- icon: 'bus'
- },
- {
- label: 'Search',
- icon: 'magnifying-glass',
- onSelect: () => {
- console.log('Search')
+ lib.registerRadial({
+ id = 'police_menu',
+ items = {
+ {
+ label = 'Handcuff',
+ icon = 'handcuffs',
+ onSelect = 'myMenuHandler'
+ },
+ {
+ label = 'Frisk',
+ icon = 'hand'
+ },
+ {
+ label = 'Fingerprint',
+ icon = 'fingerprint'
+ },
+ {
+ label = 'Jail',
+ icon = 'bus'
+ },
+ {
+ label = 'Search',
+ icon = 'magnifying-glass',
+ onSelect = function()
+ print('Search')
+ end
+ }
}
- }
- ]
-})
+ })
-lib.addRadialItem([
- {
- id: 'police',
- label: 'Police',
- icon: 'shield-halved',
- menu: 'police_menu'
- },
- {
- id: 'business_stuff',
- label: 'Business',
- icon: 'briefcase',
- onSelect: () => {
- console.log('Business')
- }
- }
-])
-```
+ lib.addRadialItem({
+ {
+ id = 'police',
+ label = 'Police',
+ icon = 'shield-halved',
+ menu = 'police_menu'
+ },
+ {
+ id = 'business_stuff',
+ label = 'Business',
+ icon = 'briefcase',
+ onSelect = function()
+ print("Business")
+ end
+ }
+ })
-
+ local coords = GetEntityCoords(cache.ped)
+ local point = lib.points.new(coords, 5)
+
+ function point:onEnter()
+ lib.addRadialItem({
+ id = 'garage_access',
+ icon = 'warehouse',
+ label = 'Garage',
+ onSelect = function()
+ print('Garage')
+ end
+ })
+ end
+
+ function point:onExit()
+ lib.removeRadialItem('garage_access')
+ end
+ ```
+
+
+
+ Points system in the lib isn't available for the npm package.
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client'
+
+ exports('myMenuHandler', (menu, item) => {
+ console.log(menu, item)
+
+ if (menu === 'police_menu' and item === 1) {
+ console.log('Handcuffs')
+ }
+ })
+
+ lib.registerRadial({
+ id: 'police_menu',
+ items: [
+ {
+ label: 'Handcuff',
+ icon: 'handcuffs',
+ onSelect: 'myMenuHandler'
+ },
+ {
+ label: 'Frisk',
+ icon: 'hand'
+ },
+ {
+ label: 'Fingerprint',
+ icon: 'fingerprint'
+ },
+ {
+ label: 'Jail',
+ icon: 'bus'
+ },
+ {
+ label: 'Search',
+ icon: 'magnifying-glass',
+ onSelect: () => {
+ console.log('Search')
+ }
+ }
+ ]
+ })
+
+ lib.addRadialItem([
+ {
+ id: 'police',
+ label: 'Police',
+ icon: 'shield-halved',
+ menu: 'police_menu'
+ },
+ {
+ id: 'business_stuff',
+ label: 'Business',
+ icon: 'briefcase',
+ onSelect: () => {
+ console.log('Business')
+ }
+ }
+ ])
+ ```
+

diff --git a/pages/ox_lib/Modules/Interface/Client/skillcheck.mdx b/pages/ox_lib/Modules/Interface/Client/skillcheck.mdx
index c8f0068b..4291e28d 100644
--- a/pages/ox_lib/Modules/Interface/Client/skillcheck.mdx
+++ b/pages/ox_lib/Modules/Interface/Client/skillcheck.mdx
@@ -4,27 +4,25 @@ title: Skill Check
import { Tabs, Tab } from 'nextra-theme-docs';
-### lib.skillCheck
+# Skill Check
+
+## lib.skillCheck
Runs a skill check with the defined difficulty.
-
+
+ ```lua
+ lib.skillCheck(difficulty, inputs)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.skillCheck(difficulty, inputs)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.skillCheck(difficulty, inputs);
-```
-
-
+ lib.skillCheck(difficulty, inputs);
+ ```
+
- difficulty: `'easy'` or `'medium'` or `'hard'` or `table`
@@ -41,28 +39,24 @@ lib.skillCheck(difficulty, inputs);
- 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
+## Usage Example
-
+
+ ```lua
+ local success = lib.skillCheck({'easy', 'easy', {areaSize = 60, speedMultiplier = 2}, 'hard'}, {'w', 'a', 's', 'd'})
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-local success = lib.skillCheck({'easy', 'easy', {areaSize = 60, speedMultiplier = 2}, 'hard'}, {'w', 'a', 's', 'd'})
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-const success = await lib.skillCheck(
- ['easy', 'easy', { areaSize: 60, speedMultiplier: 2 }, 'hard'],
- ['w', 'a', 's', 'd']
-);
-```
-
-
+ const success = await lib.skillCheck(
+ ['easy', 'easy', { areaSize: 60, speedMultiplier: 2 }, 'hard'],
+ ['w', 'a', 's', 'd']
+ );
+ ```
+

diff --git a/pages/ox_lib/Modules/Interface/Client/textui.mdx b/pages/ox_lib/Modules/Interface/Client/textui.mdx
index 51014765..8f4409d2 100644
--- a/pages/ox_lib/Modules/Interface/Client/textui.mdx
+++ b/pages/ox_lib/Modules/Interface/Client/textui.mdx
@@ -5,33 +5,29 @@ title: TextUI
import { Tabs, Tab } from 'nextra-theme-docs';
import { Callout } from 'nextra/components';
-### lib.showTextUI
+# TextUI
+
+## lib.showTextUI
Show the TextUI window.
-
-**DO NOT** run this function every tick, it's intended to be used as a toggle.
-
+ **DO NOT** run this function every tick, it's intended to be used as a toggle.
-
+
+ ```lua
+ lib.showTextUI(text, options)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.showTextUI(text, options)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.showTextUI(text, options);
-```
-
-
+ lib.showTextUI(text, options);
+ ```
+
- text: `string`
@@ -42,113 +38,96 @@ lib.showTextUI(text, options);
- iconColor?: `string`
- style?: React.CSSProperties
-### lib.hideTextUI
+## lib.hideTextUI
Hides the currently visible TextUI window
-
+
+ ```lua
+ lib.hideTextUI()
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.hideTextUI()
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.hideTextUI();
-```
-
-
+ lib.hideTextUI();
+ ```
+
-### Usage Example
-
-#### Basic
-
-
-
-
-```lua
-lib.showTextUI('[E] - Fuel vehicle')
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.showTextUI('[E] - Fuel vehicle');
-```
-
-
-
-
-
-
-#### Custom styling
-
-
-
-
-```lua
-lib.showTextUI('[E] - Pick apple', {
- position = "top-center",
- icon = 'hand',
- style = {
- borderRadius = 0,
- backgroundColor = '#48BB78',
- color = 'white'
- }
-})
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.showTextUI('[E] - Pick apple', {
- position: 'top-center',
- icon: 'hand',
- style: {
- borderRadius: 0,
- backgroundColor: '#48BB78',
- color: 'white',
- },
-});
-```
-
-
-
-
-### lib.isTextUIOpen
+## lib.isTextUIOpen
Returns whether Text UI is opened or not
-
+
+ ```lua
+ lib.isTextUIOpen()
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
-```lua
-lib.isTextUIOpen()
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client';
-
-lib.isTextUIOpen();
-```
-
-
+ lib.isTextUIOpen();
+ ```
+
+## Usage Example
+
+### Basic
+
+
+
+ ```lua
+ lib.showTextUI('[E] - Fuel vehicle')
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
+
+ lib.showTextUI('[E] - Fuel vehicle');
+ ```
+
+
+
+
+
+### Custom styling
+
+
+
+ ```lua
+ lib.showTextUI('[E] - Pick apple', {
+ position = "top-center",
+ icon = 'hand',
+ style = {
+ borderRadius = 0,
+ backgroundColor = '#48BB78',
+ color = 'white'
+ }
+ })
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client';
+
+ lib.showTextUI('[E] - Pick apple', {
+ position: 'top-center',
+ icon: 'hand',
+ style: {
+ borderRadius: 0,
+ backgroundColor: '#48BB78',
+ color: 'white',
+ },
+ });
+ ```
+
+

diff --git a/pages/ox_lib/Modules/Locale/Shared.mdx b/pages/ox_lib/Modules/Locale/Shared.mdx
index 9240d47e..2f817ec9 100644
--- a/pages/ox_lib/Modules/Locale/Shared.mdx
+++ b/pages/ox_lib/Modules/Locale/Shared.mdx
@@ -1,3 +1,5 @@
+# Shared
+
Allows servers to set a preferred language and attempt to load locale files in any resources using the module.
Locale files should use the [ISO Language Code](http://www.lingoes.net/en/translator/langcode.htm) and be saved as `./locales/langcode.json`
diff --git a/pages/ox_lib/Modules/Logger/Server.mdx b/pages/ox_lib/Modules/Logger/Server.mdx
index 9f86dadd..899d5043 100644
--- a/pages/ox_lib/Modules/Logger/Server.mdx
+++ b/pages/ox_lib/Modules/Logger/Server.mdx
@@ -1,5 +1,7 @@
import { Steps, Tabs, Tab } from 'nextra-theme-docs';
+# Server
+
## lib.logger
```lua
@@ -25,23 +27,22 @@ lib.logger(-1, 'CreateVehicle', json.encode(vehicle))
## Datadog
-### Create your [Datadog](https://www.datadoghq.com/) account
-You will receive a free 14 day trial, otherwise refer to their [pricing](https://www.datadoghq.com/pricing/) guide.
-Free accounts are limited, however logs will still be retained for 14 days.
+ ### Create your [Datadog](https://www.datadoghq.com/) account
+ You will receive a free 14 day trial, otherwise refer to their [pricing](https://www.datadoghq.com/pricing/) guide.
+ Free accounts are limited, however logs will still be retained for 14 days.
-### Create an [API key](https://app.datadoghq.com/organization-settings/api-keys)
+ ### Create an [API key](https://app.datadoghq.com/organization-settings/api-keys)
-This is a UUID used to submit logs to your Datadog organisation.
+ This is a UUID used to submit logs to your Datadog organisation.
-### Config
+ ### Config
-Set your API key and [Datadog site](https://docs.datadoghq.com/getting_started/site/) using the following convars.
-
-```bash
-set datadog:key "yourapikey"
-set datadog:site "datadoghq.com"
-```
+ Set your API key and [Datadog site](https://docs.datadoghq.com/getting_started/site/) using the following convars.
+ ```bash
+ set datadog:key "yourapikey"
+ set datadog:site "datadoghq.com"
+ ```
## Grafana Loki
@@ -51,21 +52,18 @@ It is designed to be very cost effective and easy to operate.
-
- Has free tier with some restrictions
- Easy to manage
- Easier to setup
- Mostly managed by Grafana
- ### Create your [Grafana](https://grafana.com/) account
- ### Head to [My Account](https://grafana.com/auth/sign-in/?plcmt=top-nav&cta=myaccount)
- ### Setup Loki
- Find the Loki section in your account panel, and click "Details".
- Generate a password and save the API key, as well as your `user` and `url`.
-
+ ### Create your [Grafana](https://grafana.com/) account
+ ### Head to [My Account](https://grafana.com/auth/sign-in/?plcmt=top-nav&cta=myaccount)
+ ### Setup Loki
+ Find the Loki section in your account panel, and click "Details".
+ Generate a password and save the API key, as well as your `user` and `url`.
-
To setup a grafana instance you'll need docker, and knowledge on containers or kubernetes.
@@ -74,19 +72,15 @@ It is designed to be very cost effective and easy to operate.
Once done, setup authentication and use the username and password securing your endpoint.
- By default self-hosted loki instances do not provide any authentication layers and will require an external authentication layer such as NGINX basic auth or Cloudflare Access.
-
-
- ### Config
- Use the following convars to set your logging service, endpoint, and authentication details.
+ ### Config
+ Use the following convars to set your logging service, endpoint, and authentication details.
- ```bash
- set ox:logger "loki"
- set loki:user ""
- set loki:password ""
- set loki:endpoint ""
- ```
-
-
+ ```bash
+ set ox:logger "loki"
+ set loki:user ""
+ set loki:password ""
+ set loki:endpoint ""
+ ```
diff --git a/pages/ox_lib/Modules/Math/Shared.mdx b/pages/ox_lib/Modules/Math/Shared.mdx
index 77c04278..661c9ae8 100644
--- a/pages/ox_lib/Modules/Math/Shared.mdx
+++ b/pages/ox_lib/Modules/Math/Shared.mdx
@@ -1,3 +1,5 @@
+# Shared
+
## lib.math
Extends the standard Lua math table with extra functions.
diff --git a/pages/ox_lib/Modules/Points/JavaScript/Client.mdx b/pages/ox_lib/Modules/Points/JavaScript/Client.mdx
index 2fd741eb..19a9daba 100644
--- a/pages/ox_lib/Modules/Points/JavaScript/Client.mdx
+++ b/pages/ox_lib/Modules/Points/JavaScript/Client.mdx
@@ -1,4 +1,6 @@
-# Points
+# Client
+
+## Points
Simple and centralised distance checking, supporting callbacks when entering, leaving, and standing in-range of set coordinates.
diff --git a/pages/ox_lib/Modules/Points/Lua/Client.mdx b/pages/ox_lib/Modules/Points/Lua/Client.mdx
index 85d6eec0..a71f9794 100644
--- a/pages/ox_lib/Modules/Points/Lua/Client.mdx
+++ b/pages/ox_lib/Modules/Points/Lua/Client.mdx
@@ -1,8 +1,8 @@
-# Points
+# Client
Simple and centralised distance checking, supporting callbacks when entering, leaving, and standing in-range of set coordinates.
-### CPoint
+## CPoint Class
A table representing a point with the following properties.
@@ -22,7 +22,7 @@ A table representing a point with the following properties.
- nearby?: `function(self: CPoint)`
- Function triggered on frame when within `distance` of the point
-### lib.points.new
+## lib.points.new
```lua
lib.points.new(data)
@@ -36,7 +36,7 @@ Returns:
- point: `CPoint`
-#### Example
+### Example
```lua
local point = lib.points.new({
coords = GetEntityCoords(cache.ped),
@@ -61,7 +61,7 @@ function point:nearby()
end
```
-### lib.points.getAllPoints
+## lib.points.getAllPoints
Get a table of all points created in the resource.
@@ -73,7 +73,7 @@ Return:
- points: `CPoint[]`
-### lib.points.getNearbyPoints
+## lib.points.getNearbyPoints
Get an array of all points in range of the player.
@@ -85,7 +85,7 @@ Return:
- nearbyPoints: `CPoint[]`
-### lib.points.getClosestPoint
+## lib.points.getClosestPoint
Get the data for the closest point to the player.
diff --git a/pages/ox_lib/Modules/Raycast/Client.mdx b/pages/ox_lib/Modules/Raycast/Client.mdx
index 9c971bc9..067ec031 100644
--- a/pages/ox_lib/Modules/Raycast/Client.mdx
+++ b/pages/ox_lib/Modules/Raycast/Client.mdx
@@ -1,4 +1,6 @@
-### lib.raycast.cam
+# Client
+
+## lib.raycast.cam
Starts a shapetest originating from the camera, extending to ~10m by default.
diff --git a/pages/ox_lib/Modules/Streaming/Client.mdx b/pages/ox_lib/Modules/Streaming/Client.mdx
index 1fe6765f..e6383c42 100644
--- a/pages/ox_lib/Modules/Streaming/Client.mdx
+++ b/pages/ox_lib/Modules/Streaming/Client.mdx
@@ -1,27 +1,25 @@
+import { Tabs, Tab } from 'nextra-theme-docs';
+
+# Client
+
Check if assets exist, such as models, and loads them into memory.
Throws errors for invalid assets and returns true if the asset is loaded.
-import { Tabs, Tab } from 'nextra-theme-docs';
-
-### lib.requestAnimDict
+## lib.requestAnimDict
-
+
+ ```lua
+ lib.requestAnimDict(dict, timeout)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client'
-```lua
-lib.requestAnimDict(dict, timeout)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client'
-
-lib.requestAnimDict(dict, timeout)
-```
-
-
+ lib.requestAnimDict(dict, timeout)
+ ```
+
- dict: `string`
@@ -29,25 +27,21 @@ lib.requestAnimDict(dict, timeout)
- Number of ticks to wait for the asset to load.
- Default: `500`
-### lib.requestAnimSet
+## lib.requestAnimSet
-
+
+ ```lua
+ lib.requestAnimSet(set, timeout)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client'
-```lua
-lib.requestAnimSet(set, timeout)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client'
-
-lib.requestAnimSet(set, timeout)
-```
-
-
+ lib.requestAnimSet(set, timeout)
+ ```
+
- set: `string`
@@ -55,25 +49,21 @@ lib.requestAnimSet(set, timeout)
- Number of ticks to wait for the asset to load.
- Default: `500`
-### lib.requestModel
+## lib.requestModel
-
+
+ ```lua
+ lib.requestModel(model, timeout)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client'
-```lua
-lib.requestModel(model, timeout)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client'
-
-lib.requestModel(model, timeout)
-```
-
-
+ lib.requestModel(model, timeout)
+ ```
+
- model: `string`
@@ -81,25 +71,21 @@ lib.requestModel(model, timeout)
- Number of ticks to wait for the asset to load.
- Default: `500`
-### lib.requestStreamedTextureDict
+## lib.requestStreamedTextureDict
-
+
+ ```lua
+ lib.requestStreamedTextureDict(dict, timeout)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client'
-```lua
-lib.requestStreamedTextureDict(dict, timeout)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client'
-
-lib.requestStreamedTextureDict(dict, timeout)
-```
-
-
+ lib.requestStreamedTextureDict(dict, timeout)
+ ```
+
- dict: `string`
@@ -107,25 +93,21 @@ lib.requestStreamedTextureDict(dict, timeout)
- Number of ticks to wait for the asset to load.
- Default: `500`
-### lib.requestNamedPtfxAsset
+## lib.requestNamedPtfxAsset
-
+
+ ```lua
+ lib.requestNamedPtfxAsset(ptFxName, timeout)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client'
-```lua
-lib.requestNamedPtfxAsset(ptFxName, timeout)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client'
-
-lib.requestNamedPtfxAsset(ptFxName, timeout)
-```
-
-
+ lib.requestNamedPtfxAsset(ptFxName, timeout)
+ ```
+
- ptFxName: `string`
@@ -133,25 +115,21 @@ lib.requestNamedPtfxAsset(ptFxName, timeout)
- Number of ticks to wait for the asset to load.
- Default: `500`
-### lib.requestScaleformMovie
+## lib.requestScaleformMovie
-
+
+ ```lua
+ lib.requestScaleformMovie(scaleformName, timeout)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client'
-```lua
-lib.requestScaleformMovie(scaleformName, timeout)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client'
-
-lib.requestScaleformMovie(scaleformName, timeout)
-```
-
-
+ lib.requestScaleformMovie(scaleformName, timeout)
+ ```
+
- scaleformName: `string`
@@ -159,25 +137,21 @@ lib.requestScaleformMovie(scaleformName, timeout)
- Number of ticks to wait for the asset to load.
- Default: `500`
-### lib.requestWeaponAsset
+## lib.requestWeaponAsset
-
+
+ ```lua
+ lib.requestWeaponAsset(weaponType, timeout, weaponResourceFlags, extraWeaponComponentFlags)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client'
-```lua
-lib.requestWeaponAsset(weaponType, timeout, weaponResourceFlags, extraWeaponComponentFlags)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client'
-
-lib.requestWeaponAsset(weaponType, timeout, weaponResourceFlags, extraWeaponComponentFlags)
-```
-
-
+ lib.requestWeaponAsset(weaponType, timeout, weaponResourceFlags, extraWeaponComponentFlags)
+ ```
+
- weaponType: `string | number`
@@ -189,7 +163,7 @@ lib.requestWeaponAsset(weaponType, timeout, weaponResourceFlags, extraWeaponComp
- extraWeaponComponentFlags?: `ExtraWeaponComponentFlags`
- Default: `0`
-#### WeaponResourceFlags
+### WeaponResourceFlags
```
1 WRF_REQUEST_BASE_ANIMS
@@ -201,7 +175,7 @@ lib.requestWeaponAsset(weaponType, timeout, weaponResourceFlags, extraWeaponComp
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 19e72ed0..e0db434a 100644
--- a/pages/ox_lib/Modules/Table/Shared.mdx
+++ b/pages/ox_lib/Modules/Table/Shared.mdx
@@ -1,13 +1,15 @@
-Adds additional functions alongside the standard table library
+# Shared
+
+Adds additional functions alongside the standard table library.
## lib.table.contains
+Checks if `table` contains the given `value`. Only intended for simple values and unnested tables.
+
```lua
lib.table.contains(tbl, value)
```
-Checks if `table` contains the given `value`. Only intended for simple values and unnested tables.
-
- tbl: `table`
- value: `any`
@@ -16,12 +18,12 @@ Return:
## lib.table.matches
+Compares if two values are equal, iterating over tables and matching both keys and values.
+
```lua
lib.table.matches(tableOne, tableTwo)
```
-Compares if two values are equal, iterating over tables and matching both keys and values.
-
- tableOne: `table`
- tableTwo: `table`
diff --git a/pages/ox_lib/Modules/VehicleProperties/Client.mdx b/pages/ox_lib/Modules/VehicleProperties/Client.mdx
index 61e93273..d12f4801 100644
--- a/pages/ox_lib/Modules/VehicleProperties/Client.mdx
+++ b/pages/ox_lib/Modules/VehicleProperties/Client.mdx
@@ -1,9 +1,11 @@
+# Client
+
Mostly follows the format used by ESX and QBCore, with extra data such as damaged/missing props.
-https://github.com/overextended/ox_lib/blob/master/resource/vehicleProperties/client.lua#L5
+https://github.com/overextended/ox_lib/blob/master/resource/vehicleProperties/client.lua#L3
import { Tabs, Tab } from 'nextra-theme-docs';
-### lib.getVehicleProperties
+## lib.getVehicleProperties
```ts
lib.getVehicleProperties(vehicle)
@@ -14,25 +16,21 @@ lib.getVehicleProperties(vehicle)
-
+
+ ```lua
+ lib.getVehicleProperties(GetVehiclePedIsUsing(PlayerPedId()))
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client'
-```lua
-lib.getVehicleProperties(GetVehiclePedIsUsing(PlayerPedId()))
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client'
-
-lib.getVehicleProperties(GetVehiclePedIsUsing(PlayerPedId()))
-```
-
-
+ lib.getVehicleProperties(GetVehiclePedIsUsing(PlayerPedId()))
+ ```
+
-### lib.setVehicleProperties
+## lib.setVehicleProperties
Requires the vehicle to belong to the client. _Do not use NetworkRequestControlOfEntity_.
@@ -44,29 +42,25 @@ lib.setVehicleProperties(vehicle, props)
- props: `table` (`object`)
-
+
+ ```lua
+ RegisterNetEvent('ox_lib:setVehicleProperties', function(netid, data)
+ lib.setVehicleProperties(NetToVeh(netid), data)
+ end)
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/client'
-```lua
-RegisterNetEvent('ox_lib:setVehicleProperties', function(netid, data)
- lib.setVehicleProperties(NetToVeh(netid), data)
-end)
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/client'
-
-onNet('ox_lib:setVehicleProperties', (netid, data) => {
- lib.setVehicleProperties(NetToVeh(netid), data)
-})
-```
-
-
+ onNet('ox_lib:setVehicleProperties', (netid, data) => {
+ lib.setVehicleProperties(NetToVeh(netid), data)
+ })
+ ```
+
-#### Recommended Usage
+### Recommended Usage
The server should tell the owner of the entity to set properties, using the following trigger.
@@ -74,7 +68,7 @@ The server should tell the owner of the entity to set properties, using the foll
TriggerClientEvent('ox_lib:setVehicleProperties', entityOwner, vehNetId, data)
```
-### Vehicle Properties
+## Vehicle Properties
- model?: `number`
- plate?: `string`
diff --git a/pages/ox_lib/Modules/Version/Server.mdx b/pages/ox_lib/Modules/Version/Server.mdx
index 75d82180..7d9bbe61 100644
--- a/pages/ox_lib/Modules/Version/Server.mdx
+++ b/pages/ox_lib/Modules/Version/Server.mdx
@@ -1,9 +1,12 @@
-### lib.versionCheck
-
-Compares the resource version to the latest published release on GitHub.
-
import { Tabs, Tab } from 'nextra-theme-docs';
+# Server
+
+## lib.versionCheck
+
+Compares the resource version to the latest published release on GitHub.
+[Utilises GitHub's release API](https://docs.github.com/en/rest/reference/releases)
+
```lua
lib.versionCheck(repository)
```
@@ -11,22 +14,16 @@ lib.versionCheck(repository)
- repository: `string`
-
+
+ ```lua
+ lib.versionCheck('overextended/ox_lib')
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/server'
-```lua
-lib.versionCheck('overextended/ox_lib')
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/server'
-
-lib.versionCheck('overextended/ox_lib')
-```
-
-
+ lib.versionCheck('overextended/ox_lib')
+ ```
+
-
-[Utilises GitHub's release API](https://docs.github.com/en/rest/reference/releases)
diff --git a/pages/ox_lib/Modules/Version/Shared.mdx b/pages/ox_lib/Modules/Version/Shared.mdx
index aadea7ec..b5c20fd1 100644
--- a/pages/ox_lib/Modules/Version/Shared.mdx
+++ b/pages/ox_lib/Modules/Version/Shared.mdx
@@ -1,9 +1,11 @@
-### lib.checkDependency
+import { Tabs, Tab } from 'nextra-theme-docs';
+
+# Shared
+
+## lib.checkDependency
Check if a resource is using a specified version or higher, allowing for compatibility checks or throwing errors.
-import { Tabs, Tab } from 'nextra-theme-docs';
-
```lua
lib.checkDependency(resource, version)
```
@@ -12,21 +14,17 @@ lib.checkDependency(resource, version)
- version: `string`
-
+
+ ```lua
+ if not lib.checkDependency('ox_lib', '1.5.0') then error() end
+ ```
+
+
+ ```ts
+ import lib from '@overextended/ox_lib/shared'
+ // import { checkDependency } from '@overextended/ox_lib/shared'
-```lua
-if not lib.checkDependency('ox_lib', '1.5.0') then error() end
-```
-
-
-
-
-```ts
-import lib from '@overextended/ox_lib/shared'
-// import { checkDependency } from '@overextended/ox_lib/shared'
-
-if (!lib.checkDependency('ox_lib', '1.5.0')) error()
-```
-
-
+ if (!lib.checkDependency('ox_lib', '1.5.0')) error()
+ ```
+
diff --git a/pages/ox_lib/Modules/Zones/Shared.mdx b/pages/ox_lib/Modules/Zones/Shared.mdx
index 0cffed9e..0e7e2872 100644
--- a/pages/ox_lib/Modules/Zones/Shared.mdx
+++ b/pages/ox_lib/Modules/Zones/Shared.mdx
@@ -1,12 +1,12 @@
import { Tabs, Tab } from 'nextra-theme-docs';
import { Callout } from 'nextra/components';
+# Shared
+
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`.
-
+ Currently zones only have basic support on the server side. Some features will not work such as `onEnter`, `onExit`, and `inside`.
## lib.zones.poly
@@ -147,7 +147,6 @@ Zones will be saved to `ox_lib/created_zones.lua` with your chosen format.
-
```lua
local poly = lib.zones.poly({
name = poly,
@@ -161,10 +160,8 @@ Zones will be saved to `ox_lib/created_zones.lua` with your chosen format.
thickness = 2,
})
```
-
-
```lua
{
name = poly,
@@ -180,7 +177,6 @@ Zones will be saved to `ox_lib/created_zones.lua` with your chosen format.
```
-
```lua
exports.ox_target:addPolyZone({
name = poly,
@@ -194,6 +190,5 @@ Zones will be saved to `ox_lib/created_zones.lua` with your chosen format.
thickness = 2,
})
```
-
diff --git a/pages/ox_target.mdx b/pages/ox_target.mdx
index 340ab046..2a1d37fb 100644
--- a/pages/ox_target.mdx
+++ b/pages/ox_target.mdx
@@ -2,6 +2,8 @@ import ResourceLinks from '@components/resource-links';
import { Steps, Tabs, Tab } from 'nextra-theme-docs';
import { Callout } from 'nextra/components';
+# Ox Target
+
A performant and flexible standalone targeting resource or "third-eye", with additional functionality for ox_inventory, ox_core, qb-core, and es_extended.
diff --git a/pages/ox_target/Functions/Client.mdx b/pages/ox_target/Functions/Client.mdx
index c6db7085..9f14c9d1 100644
--- a/pages/ox_target/Functions/Client.mdx
+++ b/pages/ox_target/Functions/Client.mdx
@@ -1,3 +1,5 @@
+# Client
+
All exports with the `options` argument expect a table with the targeting properties [here](../Options).
## disableTargeting
diff --git a/pages/ox_target/Options.mdx b/pages/ox_target/Options.mdx
index 285f6550..c79db0a4 100644
--- a/pages/ox_target/Options.mdx
+++ b/pages/ox_target/Options.mdx
@@ -1,6 +1,8 @@
+# Options
+
When creating a targetable option you must send an array of options with the following properties.
-## Options
+## Option Parameters
- label: `string`
- name?: `string`
@@ -27,7 +29,7 @@ When creating a targetable option you must send an array of options with the fol
- serverEvent?: `string`
- command?: `string`
-## Option effect
+## Option Effects
When selecting an option it will trigger a single action, in order of priority:
diff --git a/pages/oxmysql.mdx b/pages/oxmysql.mdx
index 4aba71c5..43934300 100644
--- a/pages/oxmysql.mdx
+++ b/pages/oxmysql.mdx
@@ -2,6 +2,8 @@
title: OxMySQL
---
+# OxMySQL
+
import { Steps } from 'nextra-theme-docs';
import { Callout } from 'nextra/components';
import ResourceLinks from '@components/resource-links';
diff --git a/pages/oxmysql/Functions/insert.mdx b/pages/oxmysql/Functions/insert.mdx
index c3250655..358b9538 100644
--- a/pages/oxmysql/Functions/insert.mdx
+++ b/pages/oxmysql/Functions/insert.mdx
@@ -4,6 +4,8 @@ title: insert
import { Tab, Tabs } from 'nextra-theme-docs';
+# Insert
+
Inserts a new entry into the database and returns the insert id for the row, if valid.
## Promise
diff --git a/pages/oxmysql/Functions/prepare.mdx b/pages/oxmysql/Functions/prepare.mdx
index 40f016a5..4d59cdca 100644
--- a/pages/oxmysql/Functions/prepare.mdx
+++ b/pages/oxmysql/Functions/prepare.mdx
@@ -4,6 +4,8 @@ title: prepare
import { Tab, Tabs } from 'nextra-theme-docs';
+# Prepare
+
Prepare can be used to execute frequently called queries faster and accepts multiple sets of parameters to be used with a single query.
- Date will not return the datestring commonly used in FiveM
diff --git a/pages/oxmysql/Functions/query.mdx b/pages/oxmysql/Functions/query.mdx
index bc9177b5..b786f051 100644
--- a/pages/oxmysql/Functions/query.mdx
+++ b/pages/oxmysql/Functions/query.mdx
@@ -4,6 +4,8 @@ title: query
import { Tab, Tabs } from 'nextra-theme-docs';
+# Query
+
When selecting data, returns all matching rows and columns; otherwise, returns data like insertId, affectedRows, etc.
## Promise
diff --git a/pages/oxmysql/Functions/rawExecute.mdx b/pages/oxmysql/Functions/rawExecute.mdx
index 554d0e3f..974082ff 100644
--- a/pages/oxmysql/Functions/rawExecute.mdx
+++ b/pages/oxmysql/Functions/rawExecute.mdx
@@ -4,6 +4,8 @@ title: rawExecute
import { Tab, Tabs } from 'nextra-theme-docs';
+# RawExecute
+
rawExecute can be used to execute frequently called queries faster and accepts multiple sets of parameters to be used with a single query.
- Date will not return the datestring commonly used in FiveM
diff --git a/pages/oxmysql/Functions/scalar.mdx b/pages/oxmysql/Functions/scalar.mdx
index f589b907..fd648190 100644
--- a/pages/oxmysql/Functions/scalar.mdx
+++ b/pages/oxmysql/Functions/scalar.mdx
@@ -4,6 +4,8 @@ title: scalar
import { Tab, Tabs } from 'nextra-theme-docs';
+# Scalar
+
Returns the first column for a single row.
## Promise
diff --git a/pages/oxmysql/Functions/single.mdx b/pages/oxmysql/Functions/single.mdx
index d6912694..3cb0ea10 100644
--- a/pages/oxmysql/Functions/single.mdx
+++ b/pages/oxmysql/Functions/single.mdx
@@ -4,6 +4,8 @@ title: single
import { Tab, Tabs } from 'nextra-theme-docs';
+# Single
+
Returns all selected columns for a single row.
## Promise
diff --git a/pages/oxmysql/Functions/transaction.mdx b/pages/oxmysql/Functions/transaction.mdx
index d3e45570..0f2799f0 100644
--- a/pages/oxmysql/Functions/transaction.mdx
+++ b/pages/oxmysql/Functions/transaction.mdx
@@ -4,6 +4,8 @@ title: transaction
import { Tab, Tabs } from 'nextra-theme-docs';
+# Transaction
+
A transaction executes multiple queries and commits them only if all succeed.
If one fails, none of the queries are committed.
diff --git a/pages/oxmysql/Functions/update.mdx b/pages/oxmysql/Functions/update.mdx
index 5ef005dc..d3939d14 100644
--- a/pages/oxmysql/Functions/update.mdx
+++ b/pages/oxmysql/Functions/update.mdx
@@ -4,6 +4,8 @@ title: update
import { Tab, Tabs } from 'nextra-theme-docs';
+# Update
+
Returns the number of rows affected by the query.
## Promise
diff --git a/pages/oxmysql/benchmark.mdx b/pages/oxmysql/benchmark.mdx
index b82ab8fe..95c234f9 100644
--- a/pages/oxmysql/benchmark.mdx
+++ b/pages/oxmysql/benchmark.mdx
@@ -1,3 +1,5 @@
+# Benchmark
+
```lua
-- Internal benchmark
Low: 0.1222ms | Avg: 0.14188357ms | Total: 1418.8357ms (10000 queries)
diff --git a/pages/oxmysql/issues.mdx b/pages/oxmysql/issues.mdx
index 7c7e5a14..4b442b22 100644
--- a/pages/oxmysql/issues.mdx
+++ b/pages/oxmysql/issues.mdx
@@ -4,6 +4,8 @@ title: Common Issues
import { Callout } from 'nextra/components';
+# Common Issues
+
## Unable to establish a connection
This is usually the result of incorrect database settings or your password containing reserved characters.
diff --git a/pages/oxmysql/placeholders.mdx b/pages/oxmysql/placeholders.mdx
index a157f317..0109d01f 100644
--- a/pages/oxmysql/placeholders.mdx
+++ b/pages/oxmysql/placeholders.mdx
@@ -1,3 +1,5 @@
+# Placeholders
+
Placeholders allow for query parameters to be safely executed, preventing [common SQL injection methods](https://bobby-tables.com/).
Parameters can be passed an an array or map (referred to as named named parameters).
diff --git a/pages/oxmysql/ui.mdx b/pages/oxmysql/ui.mdx
index bafccf01..dad879fb 100644
--- a/pages/oxmysql/ui.mdx
+++ b/pages/oxmysql/ui.mdx
@@ -2,6 +2,8 @@
title: Using the Debug UI
---
+# Using the Debug UI
+
import { Callout } from 'nextra/components';
The debug UI lets you easily see all the queries that have been executed by resources, query response times, and per-resource statistics.