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,26 @@
|
||||
Returns if inventory can carry specified weight and free inventory weight.
|
||||
|
||||
```lua
|
||||
exports.ox_inventory:CanCarryWeight(inv, weight)
|
||||
```
|
||||
|
||||
* inv: `table` or `string` or `number`
|
||||
* weight: `number`
|
||||
|
||||
Example:
|
||||
|
||||
```lua
|
||||
-- Checks if player can carry 1000 grams.
|
||||
local fillAmount = 1000
|
||||
local canCarryWeight, freeWeight = ox_inventory:CanCarryWeight(playerId, fillAmount)
|
||||
|
||||
if freeWeight == 0 then
|
||||
-- Player can't carry weight.
|
||||
return
|
||||
elseif not canCarryWeight then
|
||||
-- Modify fillAmount, because inventory can't carry specified weight
|
||||
fillAmount = freeWeight
|
||||
end
|
||||
|
||||
-- Do something
|
||||
```
|
||||
Reference in new issue
Block a user