Server
onInventoryItemAdded
Parameters
Parameter
Type
Description
Example
AddEventHandler('jaksam_inventory:onInventoryItemAdded', function(inventoryId, itemName, amount, metadata, slotId)
local inventoryType = exports['jaksam_inventory']:getInventoryType(inventoryId)
if inventoryType ~= 'player' then return end -- Only handle player inventories
print(string.format("Item %s (x%d) added to inventory %s", itemName, amount, inventoryId))
-- For QBCore: Get player by character identifier
local Player = exports['qb-core']:GetPlayerByCitizenId(inventoryId)
if Player then
local playerId = Player.PlayerData.source
print(string.format("Player %d added item %s", playerId, itemName))
end
-- For ESX: Get player by character identifier
-- local xPlayer = ESX.GetPlayerFromIdentifier(inventoryId)
-- if xPlayer then
-- local playerId = xPlayer.source
-- print(string.format("Player %d added item %s", playerId, itemName))
-- end
end)onInventoryItemRemoved
Parameters
Parameter
Type
Description
Example
onInventoryItemTransferred
Parameters
Parameter
Type
Description
Example
Last updated