♻️Exports

List of all Integrations / Exports for Origen_Inventory

🟢 Client Exports

OnPlayerLoad

Force the player's boot and inventory systems.

exports.origen_inventory:OnPlayerLoad()

OpenInventory

Open player inventory

exports.origen_inventory:OpenInventory()

GetInventory

Get Player inventory data

exports.origen_inventory:GetInventory()

CloseInventory

Close player inventory

exports.origen_inventory:CloseInventory()

HasItem

Check if player has item

-- @return boolean
exports.origen_inventory:HasItem(item_name)

-- Example use
local hasWater --[[true/false]] = exports.origen_inventory:HasItem("water")
if hasWater then
    -- Do something
end

GetItems

Return the server item list

exports.origen_inventory:GetItems()

Unarmed

Set player unarmed

exports.origen_inventory:Unarmed()

SetCurrentWeapon

exports.origen_inventory:SetCurrentWeapon(weapon_data, can_shoot)

-- Example usage
exports.origen_inventory:SetCurrentWeapon({
    name = "WEAPON_PISTOL"
    info = {
        attachments = {
            {
                component = "COMPONENT_PISTOL_CLIP_02" -- Component Hash or Name
            }
        },
        tint = 1
    }
}, true)

SetCurrentWeapon

exports.origen_inventory:AddAmmo(type, amount, item)

Others Exports

For either one, it will look for the closest player to execute the action.

exports.origen_inventory:Carry()

exports.origen_inventory:PiggyBack()

🟡 Server Exports

RegisterStash

exports.origen_inventory:RegisterStash(stash_name, stash_data)

-- Example usage
exports.origen_inventory:RegisterStash('police_locker', {
    label = "Police Locker",
    slots = 10,
    weight = 100
})

GetStash

exports.origen_inventory:GetStash(stash_name)

GetStashItems

exports.origen_inventory:GetStashItems(stash_name)

StashGetItemByname

exports.origen_inventory:StashGetItemByname(stash_name, item_name)

CanCarryItem

exports.origen_inventory:CanCarryItems(playerId, item, amount)

GiveWeaponToPlayer

exports.origen_inventory:GiveWeaponToPlayer(playerId, weapon_name, ammo)

ClearInventory

exports.origen_inventory:ClearInventory(playerId, filter)

SetInventory

exports.origen_inventory:SetInventory(playerId, inventory)

SetInventoryItems

exports.origen_inventory:SetInventoryItems(playerId, item, amount)

GetTotalWeight

exports.origen_inventory:GetTotalWeight(playerId)

HasItem

exports.origen_inventory:HasItem(playerId, item, amount)

GetItemByName

exports.origen_inventory:GetItemByName(playerId, item)

GetSlotsByItem

exports.origen_inventory:GetSlotsByItem(items, item)

GetItemByslot

exports.origen_inventory:GetItemBySlot(playerId, slot)

GetFirstSlotByItem

exports.origen_inventory:GetFirstSlotByItem(items, item)

GetItemTotalAmount

exports.origen_inventory:GetItemTotalAmount(playerId, item)

RemoveItem

exports.origen_inventory:RemoveItem(playerId, item, amount)

AddItem

exports.origen_inventory:AddItem(playerId, item, amount, slot --[[optional]], info --[[optional]], metadata--[[optional]])

RemoveItem

exports.origen_inventory:RemoveItem(playerId, item, amount, slot --[[optional]], metadata--[[optional]])

SetItemMetada

exports.origen_inventory:SetItemMetadata(playerId, item, slot, metadata)

AddItemMetadata

exports.origen_inventory:AddItemMetadata(playerId, item, slot, metadata)

SetInventoryData

exports.origen_inventory:SetInventoryData(fromInventory, toInventory, fromSlot, toSlot, fromAmount, toAmount)

OpenInventory

--[[
    Inventory Types:
    - playerId
    - otherplayer
    - stash
    - trunk
    - glovebox
    - drop
    - shop
]]
exports.origen_inventory:OpenInventory(playerId, inventory_type, inventory_id)

-- Example
exports.origen_inventory:OpenInventory(1, 'stash', 'police-locker')

GetItemLabel

exports.origen_inventory:GetItemLabel(item)

SaveInventory

exports.origen_inventory:SaveInventory(playerId, isOffline?)

LoadInventory

-- Note: firstLoading represents whether the inventory should be loaded from the database (true) or from the cache (false).
exports.origen_inventory:LoadInventory(playerId, firstLoading?)

GetInventory or GetPlayerInventory

exports.origen_inventory:GetInventory(playerId)
exports.origen_inventory:getPlayerInventory(playerId)

GetUsableItem

exports.origen_inventory:GetUsableItem(name)

CreateUseableItem

exports.origen_inventory:CreateUseableItem(name, cb)

UseItem

exports.origen_inventory:UseItem(playerId, name)

UseItemSlot

exports.origen_inventory:UseItemSlot(slot, inventory_id)

GetTotalWeightByItems

local items = { 'id_card', 'sandwich' }
exports.origen_inventory:GetTotalWeightByItems(items)

OpenInventoryById

exports.origen_inventory:OpenInventoryById(playerId, otherPlayerId)

GetItemByMetadata

exports.origen_inventory:GetItemByMetadata(playerId, metaKey, metaValue)

GetItemsByMetadata

exports.origen_inventory:GetItemsByMetadata(playerId, metaKey, metaValue)

GetItemByMetaKey

exports.origen_inventory:GetItemByMetaKey(playerId, metaKey)

GetItemsByMetaKey

exports.origen_inventory:GetItemsByMetaKey(playerId, metaKey)

GetItemInfoBySlot

exports.origen_inventory:GetItemInfoBySlot(playerId, itemName, slot)

GetItemCount

exports.origen_inventory:GetItemCount(playerId, itemName, metadata, strict)

GetItem

exports.origen_inventory:GetItem(playerId, itemName, metadata, returnsCount)

Last updated