mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-02 06:28:54 +00:00
add some inventory examples
This commit is contained in:
1 parent
7380341246
commit
c1d420aeaa
5 files changed
+44
-15
No files matched your search
@@ -1,14 +1,21 @@
|
||||
Creates an inventory drop at the specified coords.
|
||||
Drops can be created from other resources, containing a variety of items and utilising a custom label (instead of 'Drop 32648').
|
||||
|
||||
```lua
|
||||
-- prefix: string
|
||||
-- items: table
|
||||
-- name: string
|
||||
-- count: number
|
||||
-- metadata: table (optional)
|
||||
-- coords: vector3
|
||||
-- slots: number
|
||||
-- maxWeight: number
|
||||
-- instance: ? (optional)
|
||||
exports.ox_inventory:CustomDrop(prefix, item, coords, slots, maxWeight, instance)
|
||||
-- slots: number (optional)
|
||||
-- maxWeight: number (optional)
|
||||
-- instance: string | number (optional)
|
||||
exports.ox_inventory:CustomDrop(prefix, items, coords, slots, maxWeight, instance)
|
||||
```
|
||||
|
||||
**Example:**
|
||||
You can find and example showcasing this function into furher detail [here](../../../Guides/customDrop.md).
|
||||
```lua
|
||||
exports.ox_inventory:CustomDrop('Carcass', {
|
||||
{'meat', 5, { grade = 2, type = 'deer' }},
|
||||
{'hide', 5, { grade = 2, type = 'deer' }}
|
||||
}, coords)
|
||||
```
|
||||
@@ -16,8 +16,9 @@ for k, v in pairs(water) do
|
||||
print('\n______________'..'\n- index '..k)
|
||||
print(v.name, 'slot: '..v.slot, 'metadata: '..json.encode(v.metadata))
|
||||
water = v
|
||||
break
|
||||
end
|
||||
water.metadata.type = 'clean'
|
||||
ox_inventory:SetMetadata(source, water.slot, water.metadata)
|
||||
print(('modified %sx water in slot %s with new metadata'):format(water.count, water.slot))
|
||||
```
|
||||
```
|
||||
Reference in new issue
Block a user