Server Exports

getAvailableSlots

Description: Returns the number of available inventory slots for the player, taking into account:

  • reserved slots,

  • blocked slots,

  • backpack configuration (if enabled).

Parameters:

  • src (number) – Player server ID.

Returns:

  • number – Available slot count.

Example:

local availableSlots = exports['pinkFrog_inventoryAddon']:getAvailableSlots(source)
print(('Available slots: %d'):format(availableSlots))

How it works (short explanation):

  • Gets total configured player slots with backpack and counted of blocked slots.

getBackpackExtraWeight

Description: Returns the additional weight (in grams) granted by the backpack item currently equipped by the player.

Parameters:

  • src (number) – Player server ID.

Returns:

  • number – Extra weight in grams (0 if no backpack or no bonus configured).

Example:

How it works (short explanation):

  • Checks if backpack settings are enabled.

  • Gets the configured backpack slot.

  • Reads the item from ox_inventory.

  • If the item has extra weight configured, it converts kg to grams and returns the value.


Test Command Example


Last updated