diff --git a/docs/ox_inventory/Functions/External/Client/Interface/Keyboard.md b/docs/ox_inventory/Functions/External/Client/Interface/Keyboard.md new file mode 100644 index 00000000..a509b48a --- /dev/null +++ b/docs/ox_inventory/Functions/External/Client/Interface/Keyboard.md @@ -0,0 +1,24 @@ +Opens a keyboard input dialog. + +The `rows` param takes a table of strings where each string entry will represent +a single row. + +```lua +-- header: string +-- rows: table +exports.ox_inventory:Keyboard(header, rows) +``` +Returns a table of strings where the first index is going to be the first row of the dialog, +the second index the second row and so on. + +**Example:** +```lua +local input = exports.ox_inventory:Keyboard('Money transfer', {'Player name', 'Amount'}) + +if input then + local playerName = input[1] + local amount = tonumber(input[2]) + + if not playerName or not amount then return end +end +``` \ No newline at end of file diff --git a/docs/ox_inventory/Functions/External/Client/Interface/Progress.md b/docs/ox_inventory/Functions/External/Client/Interface/Progress.md new file mode 100644 index 00000000..afc4049a --- /dev/null +++ b/docs/ox_inventory/Functions/External/Client/Interface/Progress.md @@ -0,0 +1,87 @@ +Starts a progress bar that can callback a function upon completion or cancellation. + +Prevents actions such as opening the inventory, reloading, etc. + +```lua +-- options: table +-- completed: function +exports.ox_inventory:Progress(options, completed) +``` +Options table values: +```lua +-- duration: number +-- label: string +-- useWhileDead: boolean (optional) +-- canCancel: boolean (optional) +-- anim: table (optional) + -- dict: string + -- clip: string + -- flag: number (optional - default is 49) +-- scenario: string (optional) +-- prop/propTwo: table (optional) + -- model: hash or string + -- bone: number (optional - default is 60309) + -- pos: table (optional) + -- x: number (default is 0) + -- y: number (default is 0) + -- z: numebr (default is 0) + -- rot: table (optional) + -- x: number (default is 0) + -- y: number (default is 0) + -- z: number (default is 0) +-- disable: table (optional) + -- move: boolean (optional) + -- car: boolean (optional) + -- combat: boolean (optional) + -- mouse: boolean (optional) +``` +:::danger + +If you define a scenario while you have a defined anim table the scenario will be ignored. +::: + +**Example:** +```lua +exports.ox_inventory:Progress({ + duration = 2000, + label = 'Drinking water', + useWhileDead = false, + canCancel = true, + disable = { + move = false, + car = true, + combat = true, + mouse = false + }, + anim = { + dict = 'mp_player_intdrink', + clip = 'loop_bottle', + flags = 49, + }, + prop = { + model = 'prop_ld_flow_bottle', + pos = { x = 0.03, y = 0.03, y = 0.02}, + rot = { x = 0.0, y = 0.0, y = -1.5}, + bone = 58866 + }, +}, function(cancel) + if not cancel then + print("You drank some water - that'll quench ya!") + end +end) +``` + +### CancelProgress + +Cancels the currently active progress bar. + +```lua +exports.ox_inventory:CancelProgress() +``` + +### ProgressActive +Returns true or false whether the progress bar is currently active or not + +```lua +exports.ox_inventory:ProgressActive() +``` \ No newline at end of file diff --git a/docs/ox_inventory/Functions/External/Client/Inventory/Search.md b/docs/ox_inventory/Functions/External/Client/Inventory/Search.md new file mode 100644 index 00000000..4a0ddb54 --- /dev/null +++ b/docs/ox_inventory/Functions/External/Client/Inventory/Search.md @@ -0,0 +1,13 @@ +Searches the inventory for a specified item. + +```lua +-- search: string or number ('slots' | 1, 'count' | 2) +-- item: table or string +-- metadata: table or string (optional) +expors.ox_inventory:Search(search, item, metadata) +``` +If the `search` argument is defined as `'slots'` or `1` the return will be a table +of slots where the item was found at. + +Otherwise if the `search` argument is defined as `'count'` or `2` the return value +will be the amount of the specified item in player's inventory. \ No newline at end of file diff --git a/docs/ox_inventory/Functions/External/Client/Items/ItemList.md b/docs/ox_inventory/Functions/External/Client/Items/ItemList.md new file mode 100644 index 00000000..0ea1bec4 --- /dev/null +++ b/docs/ox_inventory/Functions/External/Client/Items/ItemList.md @@ -0,0 +1,7 @@ +Returns a table of all registered items. + +Works exactly the same as [Items](./ItemsExport.md) + +```lua +exports.ox_inventory:ItemList() +``` \ No newline at end of file diff --git a/docs/ox_inventory/Functions/External/Client/Items/ItemsExport.md b/docs/ox_inventory/Functions/External/Client/Items/ItemsExport.md new file mode 100644 index 00000000..014d5014 --- /dev/null +++ b/docs/ox_inventory/Functions/External/Client/Items/ItemsExport.md @@ -0,0 +1,9 @@ +--- +title: Items +--- + +Returns a table of all registered items. + +```lua +exports.ox_inventory:Items() +``` \ No newline at end of file diff --git a/docs/ox_inventory/Functions/External/Client/Utils/notify.md b/docs/ox_inventory/Functions/External/Client/Utils/notify.md new file mode 100644 index 00000000..7b2dd858 --- /dev/null +++ b/docs/ox_inventory/Functions/External/Client/Utils/notify.md @@ -0,0 +1,30 @@ +Displays the notification used accross the inventory. + +The notifications are built using the [react-hot-teast](https://github.com/timolins/react-hot-toast) library. + +```lua +-- data: table +exports.ox_inventory:notify(data) +``` + +Values for the `data` table: +```lua +-- text: string +-- type: string (optional) + -- 'success' + -- 'info' - default + -- 'error' +-- position: string (optional) + -- 'top-left' + -- 'top-center' - default + -- 'top-right' + -- 'bottom-left' + -- 'bottom-center' + -- 'bottom-right +-- duration: number (optional - default is 4000 ms) +``` + +**Example:** +```lua +exports.ox_inventory:notify({type = 'Success', text = 'Making pancakes', duration = 2500}) +``` \ No newline at end of file diff --git a/docs/ox_inventory/Functions/External/Client/Utils/weaponWheel.md b/docs/ox_inventory/Functions/External/Client/Utils/weaponWheel.md new file mode 100644 index 00000000..56752184 --- /dev/null +++ b/docs/ox_inventory/Functions/External/Client/Utils/weaponWheel.md @@ -0,0 +1,8 @@ +Enables the weapon wheel, but disables the use of inventory items. + +Mostly used for weaponised vehicles, though could be called for "minigames" + +```lua +-- state: boolean +local exports.ox_inventory:weaponWheel(state) +``` \ No newline at end of file diff --git a/docs/ox_inventory/Functions/External/Client/openInventory.md b/docs/ox_inventory/Functions/External/Client/openInventory.md new file mode 100644 index 00000000..73293cdd --- /dev/null +++ b/docs/ox_inventory/Functions/External/Client/openInventory.md @@ -0,0 +1,7 @@ +Opens the passed inventory with passed data. + +```lua +-- inv: string +-- data: table (optional) +exports.ox_inventory:openInventory(inv, data) +``` \ No newline at end of file diff --git a/docs/ox_inventory/Functions/External/Client/openNearbyInventory.md b/docs/ox_inventory/Functions/External/Client/openNearbyInventory.md new file mode 100644 index 00000000..dc7a1caa --- /dev/null +++ b/docs/ox_inventory/Functions/External/Client/openNearbyInventory.md @@ -0,0 +1,9 @@ +If possible opens the nearby player's inventory. + +The player trying to open the invenotry must be able to open their own and +if the player does not have a police job, the target player must be fatally injured or +playing one of the death anims. + +```lua +exports.ox_inventory:openNearbyInventory() +``` \ No newline at end of file diff --git a/docs/ox_inventory/Functions/External/Client/placeholder.md b/docs/ox_inventory/Functions/External/Client/placeholder.md deleted file mode 100644 index 458256c8..00000000 --- a/docs/ox_inventory/Functions/External/Client/placeholder.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -title: Placeholder ---- \ No newline at end of file diff --git a/docs/ox_inventory/Functions/External/Client/setStashTarget.md b/docs/ox_inventory/Functions/External/Client/setStashTarget.md new file mode 100644 index 00000000..b1c9db26 --- /dev/null +++ b/docs/ox_inventory/Functions/External/Client/setStashTarget.md @@ -0,0 +1,11 @@ +--- +title: setStashTarget +--- + +Sets the stash target to open. + +```lua +-- id: string or number +-- owner: string +exports.ox_inventory:setStashTaget(id, owner) +``` \ No newline at end of file diff --git a/docs/ox_inventory/Functions/External/Client/useItem.md b/docs/ox_inventory/Functions/External/Client/useItem.md new file mode 100644 index 00000000..eadde385 --- /dev/null +++ b/docs/ox_inventory/Functions/External/Client/useItem.md @@ -0,0 +1,7 @@ +Uses the item passed as an argument. + +```lua +-- data: table +-- cb: function (optional) +exports.ox_inventory:useItem(data, cb) +``` \ No newline at end of file diff --git a/docs/ox_inventory/Functions/External/Client/useSlot.md b/docs/ox_inventory/Functions/External/Client/useSlot.md new file mode 100644 index 00000000..7ea93d6d --- /dev/null +++ b/docs/ox_inventory/Functions/External/Client/useSlot.md @@ -0,0 +1,6 @@ +Uses the item on the slot passed in as an argument. + +```lua +-- slot: number +exports.ox_inventory:useSlot(slot) +``` \ No newline at end of file