Module cityrp.inventory
Inventory Management
Module Overview
Client Fields
| cityrp.inventory.stored | Items currently stored on the client. |
| cityrp.inventory.updatePanel | If the panel requires updating. |
Client Functions
| cityrp.inventory.getMaximumSpace() | Get the maximum inventory space of the local player. |
| cityrp.inventory.getSize() | Get the currently used inventory space of the local player. |
| cityrp.inventory.canFit(size) | Check if a certain size will fit in the local player's inventory. |
Server Functions
| cityrp.inventory.update(ply, unique, amount, Meta[, force=false]) | Update a player's inventory with a given amount of item. |
| cityrp.inventory.updateMeta(ply, unique, amount, meta, newmeta) | Update a player's inventory meta. |
| cityrp.inventory.getMaximumSpace(player) | Get the maximum amount of space a player has. |
| cityrp.inventory.getSize(player) | Get the currently used amount of space a player has. |
| cityrp.inventory.canFit(ply, size) | Check if a certain size will fit in the local player's inventory. |
| cityrp.inventory.sizeAlert(player, size) | Check that a player may be closs to their limit and warn them. |
| cityrp.inventory.sizeAlertFull(player, size) | Check that a player is at to their limit and warn them. |
- cityrp.inventory.getMaximumSpace()
-
Get the maximum inventory space of the local player.
Returns:
-
number
Inventory size.
- cityrp.inventory.getSize()
-
Get the currently used inventory space of the local player.
Returns:
-
number
Inventory use.
- cityrp.inventory.canFit(size)
-
Check if a certain size will fit in the local player's inventory.
Parameters:
- size number The size to check fitting.
Returns:
-
boolean
If the given size will fit.
- cityrp.inventory.update(ply, unique, amount, Meta[, force=false])
-
Update a player's inventory with a given amount of item.
Parameters:
- cityrp.inventory.updateMeta(ply, unique, amount, meta, newmeta)
-
Update a player's inventory meta.
Parameters:
- cityrp.inventory.getMaximumSpace(player)
-
Get the maximum amount of space a player has.
Parameters:
- player Player Player to retrieve space for.
Returns:
-
number
The inventory space of the player.
- cityrp.inventory.getSize(player)
-
Get the currently used amount of space a player has.
Parameters:
- player Player Player to retrieve space for.
Returns:
-
number
The inventory space of the player.
- cityrp.inventory.canFit(ply, size)
-
Check if a certain size will fit in the local player's inventory.
Parameters:
- ply Player The player to check.
- size number The size to check fitting.
Returns:
-
boolean
If the given size will fit.
- cityrp.inventory.sizeAlert(player, size)
-
Check that a player may be closs to their limit and warn them.
Parameters:
- player Player The player to check.
- size number The size to check fitting.
Returns:
-
boolean
If the warning was issued.
- cityrp.inventory.sizeAlertFull(player, size)
-
Check that a player is at to their limit and warn them.
Parameters:
- player Player The player to check.
- size number[opt] unused
Returns:
-
boolean
If the warning was issued.