🌐
TPZ-CORE DOCUMENTATION
  • Introduction
  • CLIENT
    • Events
    • Functions
    • Callbacks
    • Inventory
  • SERVER
    • Functions
    • Player
    • Callbacks
    • Inventory
Powered by GitBook
On this page
  1. CLIENT

Inventory

This is the way of how to get the Inventory API Functions.

local TPZInv = exports.tpz_inventory:getInventoryAPI()

Inventory API Functions

Player Inventory

Check if the player inventory contents have been loaded .

-- returns a boolean.
local loadedInventoryContents = TPZInv.loadedInventoryContents()

Get the player inventory contents.

-- returns a table.
local contents = TPZInv.getInventoryContents()

Check if the inventory is active.

-- returns a boolean.
local isInventoryActive = TPZInv.isInventoryActive()

Check if the secondary inventory is active.

-- returns a boolean.
local isSecondaryInventoryActive = TPZInv.isSecondaryInventoryActive()

Close player inventory.

TPZInv.closeInventory()
Containers

Open a container contents by its id

-- @param containerId : requires the container id (not name).
-- @param header : requires the header (title) of the container.
-- @param isTarget : requires a boolean value (false / true) if the container is a player / not.
-- @param disable : requires a boolean value (false / true) to disable the player inventory items to be transferred to the container contents.
TPZInv.openInventoryContainerById(containerId, header, isTarget, disable)
Weapons

Get current used weapon data .

-- @param weaponData.ammoType : returns nil on throwables, lanterns, torches, knifes, except firing weapons.
-- @param weaponData.ammo : returns 0 on lanterns, torches, knifes, except firing weapons and throwables, throwables are always (1).
-- @param weaponData.weaponId : returns the unique weapon identifier of the holding weapon when being used.
-- @param weaponData.name, weaponData.hash (string), weaponData.durability, weaponData.metadata, obvious returns.
local weaponData = TPZInv.getUsedWeaponData()

PreviousCallbacksNextFunctions

Last updated 3 months ago