new exports and convar

This commit is contained in:
Linden committed 2023-05-06 22:59:48 +10:00
1 parent 719b401c91
commit 22edfded40
8 files changed
+73 -4

No files matched your search

@@ -1,4 +1,4 @@
Returns the item from the specified inventory.
Returns _generic_ item data from the specified inventory, with the total count.
```lua
exports.ox_inventory:GetItem(inv, item, metadata, returnsCount)
@@ -8,12 +8,13 @@ exports.ox_inventory:GetItem(inv, item, metadata, returnsCount)
* item: `table` or `string`
* Can be items array.
* metadata?: `any`
* Only returns the count of items that strictly match the given metadata.
* returnsCount?: `boolean`
If `returnsCount` is set to true, the returned value will be the `count` based on
how many times the item was found.
Otherwise returns the data related to the item _and_ it's total count found in the inventory.
Otherwise returns the data related to the item _and_ its total count found in the inventory.
**Example**:
@@ -0,0 +1,13 @@
Get the total item count for all items in an inventory with the given name and metadata.
```lua
exports.ox_inventory:GetItemCount(inv, itemName, metadata, strict)
```
- inv: `table` or `string` or `number`
- itemName: `string`
- metadata?: `table`
- strict?: `boolean`
- Strictly match metadata properties, otherwise use partial matching.
**Returns:** `number?`
@@ -0,0 +1,13 @@
Get a slot id in an inventory matching the given name and metadata.
```lua
exports.ox_inventory:GetSlotIdWithItem(inv, itemName, metadata, strict)
```
- inv: `table` or `string` or `number`
- itemName: `string`
- metadata?: `table`
- strict?: `boolean`
- Strictly match metadata properties, otherwise use partial matching.
**Returns:** `number?`
@@ -0,0 +1,13 @@
Get all slot ids in an inventory matching the given name and metadata.
```lua
exports.ox_inventory:GetSlotIdsWithItem(inv, itemName, metadata, strict)
```
- inv: `table` or `string` or `number`
- itemName: `string`
- metadata?: `table`
- strict?: `boolean`
- Strictly match metadata properties, otherwise use partial matching.
**Returns:** `number[]?`
@@ -0,0 +1,13 @@
Get data for a slot in an inventory matching the given name and metadata.
```lua
exports.ox_inventory:GetSlotWithItem(inv, itemName, metadata, strict)
```
- inv: `table` or `string` or `number`
- itemName: `string`
- metadata?: `table`
- strict?: `boolean`
- Strictly match metadata properties, otherwise use partial matching.
**Returns:** `table?`
@@ -0,0 +1,13 @@
Get data all slots in an inventory matching the given name and metadata.
```lua
exports.ox_inventory:GetSlotsWithItem(inv, itemName, metadata, strict)
```
- inv: `table` or `string` or `number`
- itemName: `string`
- metadata?: `table`
- strict?: `boolean`
- Strictly match metadata properties, otherwise use partial matching.
**Returns:** `table[]?`
@@ -18,7 +18,7 @@ exports.ox_inventory:RegisterStash(id, label, slots, maxWeight, owner, groups, c
* Table of player groups (jobs) able to access the stash.
* Table of group names where the numeric value is the minimum grade required.
* `{['police'] = 0, ['ambulance'] = 2}`
* coords: `vector3`
* coords?: `vector3` or `vector3[]`
:::caution
+4 -1
View File
@@ -53,7 +53,7 @@ setr inventory:enablekeys [249]
setr inventory:aimedfiring false
# Show a list of all nearby players when giving items
setr inventory:giveplayerlist true
setr inventory:giveplayerlist false
# Toggle weapon draw/holster animations
setr inventory:weaponanims true
@@ -64,6 +64,9 @@ setr inventory:itemnotify true
# Disable drop markers and spawn a prop instead
setr inventory:dropprops true
# Set the default model used for drop props
setr inventory:dropmodel "prop_med_bag_01b"
# Disarm the player if an unexpected weapon is in use (i.e. did not use the weapon item)
setr inventory:weaponmismatch true