mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-03 14:38:49 +00:00
new docs
This commit is contained in:
1 parent
3cebaf7fa5
commit
b5eba8423f
229 files changed
+6238
-10690
No files matched your search
@@ -0,0 +1,25 @@
|
||||
Returns true or false depending if the inventory can carry the specified item.
|
||||
|
||||
The function checks for inventory weight and available slots.
|
||||
|
||||
```lua
|
||||
exports.ox_inventory:CanCarryItem(inv, item, count, metadata)
|
||||
```
|
||||
|
||||
* inv: `table` or `string` or `number`
|
||||
* item `table` or `string`
|
||||
* Can be array of items.
|
||||
* count: `number`
|
||||
* metadata?: `table` or `string`
|
||||
* If metadata is passed as string then `metadata.type` will be checked.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Checks if the player calling the event can carry 3 water items
|
||||
if exports.ox_inventory:CanCarryItem(source, 'water', 3) then
|
||||
-- Do stuff if can carry
|
||||
else
|
||||
-- Do stuff if can't carry
|
||||
end
|
||||
```
|
||||
Reference in new issue
Block a user