Client

Ready

Is player inverntory is ready to use

exports['ak47_inventory']:Ready()

Return: boolean

OpenInventory

exports['ak47_inventory']:OpenInventory(data)
  • data: table or string

    • string: target inventory identifier

    • table:

      • identifier (inventory identifier)

      • label (inventory label)

      • type (inventory type: stash, backpack, glovebox, trunk)

      • maxWeight (inventory max weight)

      • slots (inventory max slots)

Example:

exports['ak47_inventory']:OpenInventory('stash:1234')

OpenNearbyInventory

CloseInventory

Items

GetItem

  • name: string

    • item name

  • info?: any

    • Only returns the amount of items that strictly match the given info.

  • Strictly match info properties, otherwise use partial matching.

GetFirstItem

  • item: string

    • item name

Return: table

  • first item table with total item amount & properties

GetItemLabel

  • name: string

    • item name

  • return: string

    • item label

HasItems

  • items: table

    • table of items

  • return:

    • boolean

    • table table of missing items with amount

Example:

  • searchType: 'slots' or 'amount'

    • 'slots' returns a table of slots where the item was found at.

    • 'amount' returns the amount of the specified item in player's inventory. If searching for multiple items returns key-value pairs of itemName = amount.

  • item: table or string

    • Can be a single item name or array of item names.

  • info?: table or string

    • If info is provided as a string it will search the item's info.type property.

Amount

Slots

GetAmount

  • itemName: string

  • info?: table

  • strict?: boolean

    • Strictly match info properties, otherwise use partial matching.

Return:

  • amount: number

GetPlayerItems

Return:

  • items: table

GetPlayerWeight

Return:

  • inventoryWeight: number

GetPlayerMaxWeight

Return:

  • maxWeight: number

GetSlotWithItem

  • itemName: string

  • info?: table

  • strict?: boolean

    • Strictly match info properties, otherwise use partial matching.

Return:

  • slotData: table?

GetSlotIdWithItem

  • itemName: string

  • info?: table

  • strict?: boolean

    • Strictly match info properties, otherwise use partial matching.

Return:

  • slotId: number?

GetSlotsWithItem

  • itemName: string

  • info?: table

  • strict?: boolean

    • Strictly match info properties, otherwise use partial matching.

Return:

  • slotsData: table[]?

GetSlotIdsWithItem

  • itemName: string

  • info?: table

  • strict?: boolean

    • Strictly match info properties, otherwise use partial matching.

Return:

  • slotIds: number[]?

SetInventoryBusy

Use Case:

UnEquipeWeapon

Last updated