inventory type tweaks

This commit is contained in:
Linden committed 2023-04-27 12:40:25 +10:00
1 parent a3ebfc8537
commit 1afcdd80ae
16 files changed
+18 -18

No files matched your search

+2 -2
View File
@@ -33,8 +33,8 @@ By returning `false`, you can cancel the action and revert the inventory state.
- source: `number` - source: `number`
- action: `'move'` or `'stack'` or `'swap'` or `'give'` - action: `'move'` or `'stack'` or `'swap'` or `'give'`
- fromInventory: `number` or `string` - fromInventory: `table` or `string` or `number`
- toInventory: `number` or `string` - toInventory: `table` or `string` or `number`
- fromType: `string` - fromType: `string`
- toType: `string` - toType: `string`
- fromSlot: `table` - fromSlot: `table`
@@ -4,7 +4,7 @@ Returns the amount a player can hold based on available weight.
exports.ox_inventory:CanCarryAmount(inv, item) exports.ox_inventory:CanCarryAmount(inv, item)
``` ```
* inv: `string` or `number` * inv: `table` or `string` or `number`
* item: `table` or `string` * item: `table` or `string`
* Can be array to check multiple items. * Can be array to check multiple items.
@@ -6,7 +6,7 @@ The function checks for inventory weight and available slots.
exports.ox_inventory:CanCarryItem(inv, item, count, metadata) exports.ox_inventory:CanCarryItem(inv, item, count, metadata)
``` ```
* inv: `string` or `number` * inv: `table` or `string` or `number`
* item `table` or `string` * item `table` or `string`
* Can be array of items. * Can be array of items.
* count: `number` * count: `number`
@@ -4,7 +4,7 @@ Returns if inventory can carry specified weight and free inventory weight.
exports.ox_inventory:CanCarryWeight(inv, weight) exports.ox_inventory:CanCarryWeight(inv, weight)
``` ```
* inv: `string` or `number` * inv: `table` or `string` or `number`
* weight: `number` * weight: `number`
Example: Example:
@@ -4,7 +4,7 @@ Returns true if the item swap is possible based on inventory weight.
exports.ox_inventory:CanSwapItem(inv, firstItem, firstItemCount, testItem, testItemCount) exports.ox_inventory:CanSwapItem(inv, firstItem, firstItemCount, testItem, testItemCount)
``` ```
* inv: `string` or `number` * inv: `table` or `string` or `number`
* firstItem: `string` * firstItem: `string`
* firstItemCount: `number` * firstItemCount: `number`
* testItem: `string` * testItem: `string`
@@ -4,5 +4,5 @@ Clears the specified inventory. The `keep` argument is either a string or an arr
exports.ox_inventory:ClearInventory(inv, keep) exports.ox_inventory:ClearInventory(inv, keep)
``` ```
* inv: `string` or `number` * inv: `table` or `string` or `number`
* keep?: `string` or `string[]` * keep?: `string` or `string[]`
@@ -5,4 +5,4 @@ Returns the player's currently equipped weapon as a table.
exports.ox_inventory:GetCurrentWeapon(inv) exports.ox_inventory:GetCurrentWeapon(inv)
``` ```
* inv: `string` or `number` * inv: `table` or `string` or `number`
@@ -4,7 +4,7 @@ Returns the item from the specified inventory.
exports.ox_inventory:GetItem(inv, item, metadata, returnsCount) exports.ox_inventory:GetItem(inv, item, metadata, returnsCount)
``` ```
* inv: `string` or `number` * inv: `table` or `string` or `number`
* item: `table` or `string` * item: `table` or `string`
* Can be items array. * Can be items array.
* metadata?: `any` * metadata?: `any`
@@ -4,6 +4,6 @@ Returns the number of slots the specified item is in, the item's total count and
exports.ox_inventory:GetItemSlots(inv, item, metadata) exports.ox_inventory:GetItemSlots(inv, item, metadata)
``` ```
* inv: `string` or `number` * inv: `table` or `string` or `number`
* item: `table` or `string` * item: `table` or `string`
* metadata?: `table` * metadata?: `table`
@@ -5,7 +5,7 @@ Returns the specified slot data as a table.
exports.ox_inventory:GetSlot(inv, slot) exports.ox_inventory:GetSlot(inv, slot)
``` ```
* inv: `string` or `number` * inv: `table` or `string` or `number`
* slot: `number` * slot: `number`
**Example:** **Example:**
@@ -4,7 +4,7 @@ Searches an inventory for a specified item.
exports.ox_inventory:Search(inv, search, item, metadata) exports.ox_inventory:Search(inv, search, item, metadata)
``` ```
* inv: `string` or `number` * inv: `table` or `string` or `number`
* search: `string` * search: `string`
* item: `table` or `string` * item: `table` or `string`
* metadata?: `table` or `string` * metadata?: `table` or `string`
@@ -6,7 +6,7 @@ Can be used for repairing weapons.
exports.ox_inventory:SetDurability(inv, slot, durability) exports.ox_inventory:SetDurability(inv, slot, durability)
``` ```
* inv: `string` or `number` * inv: `table` or `string` or `number`
* slot: `number` * slot: `number`
* durability: `number` * durability: `number`
@@ -4,7 +4,7 @@ Sets the maximum weight available for an inventory.
exports.ox_inventory:SetMaxWeight(inv, maxWeight) exports.ox_inventory:SetMaxWeight(inv, maxWeight)
``` ```
* inv: `string` or `number` or `table` * inv: `table` or `string` or `number`
* maxWeight: `number` * maxWeight: `number`
**Example:** **Example:**
@@ -4,7 +4,7 @@ Sets metadata on the specified slot.
ox_inventory:SetMetadata(inv, slot, metadata) ox_inventory:SetMetadata(inv, slot, metadata)
``` ```
* inv: `string` or `number` * inv: `table` or `string` or `number`
* slot: `number` * slot: `number`
* metadata: `table` * metadata: `table`
@@ -4,7 +4,7 @@ Sets the number of slots available for an inventory.
exports.ox_inventory:SetSlotCount(inv, slots) exports.ox_inventory:SetSlotCount(inv, slots)
``` ```
* inv: `string` or `number` or `table` * inv: `table` or `string` or `number`
* slots: `number` * slots: `number`
**Example:** **Example:**
@@ -4,7 +4,7 @@ Swaps slots in specified inventories.
exports.ox_inventory:SwapSlots(fromInventory, toInventory, slot1, slot2) exports.ox_inventory:SwapSlots(fromInventory, toInventory, slot1, slot2)
``` ```
* fromInventory: `any` * fromInventory: `table` or `string` or `number`
* toInventory: `any` * toInventory: `table` or `string` or `number`
* slot1: `number` * slot1: `number`
* slot2: `number` * slot2: `number`