🟢 Client Exports
OnPlayerLoad
Force the player's boot and inventory systems.
Copy exports.origen_inventory: OnPlayerLoad ()
OpenInventory
Open player inventory
Copy exports.origen_inventory: OpenInventory ()
GetInventory
Get Player inventory data
Copy exports.origen_inventory:GetInventory()
CloseInventory
Close player inventory
Copy exports.origen_inventory: CloseInventory ()
HasItem
Check if player has item
Copy -- @ 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
Copy exports.origen_inventory: GetItems ()
Unarmed
Set player unarmed
Copy exports.origen_inventory: Unarmed ()
SetCurrentWeapon
Copy 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
Copy exports.origen_inventory: AddAmmo ( type , amount, item)
Others ExportsFor either one, it will look for the closest player to execute the action.
exports.origen_inventory:Carry()
exports.origen_inventory:PiggyBack()
🟡 Server Exports
RegisterStash
Copy exports.origen_inventory: RegisterStash (stash_name, stash_data)
-- Example usage
exports.origen_inventory: RegisterStash ( 'police_locker' , {
label = "Police Locker" ,
slots = 10 ,
weight = 100
})
GetStash
Copy exports.origen_inventory: GetStash (stash_name)
GetStashItems
Copy exports.origen_inventory: GetStashItems (stash_name)
StashGetItemByname
Copy exports.origen_inventory: StashGetItemByname (stash_name, item_name)
CanCarryItem
Copy exports.origen_inventory: CanCarryItems (playerId, item, amount)
GiveWeaponToPlayer
Copy exports.origen_inventory: GiveWeaponToPlayer (playerId, weapon_name, ammo)
ClearInventory
Copy exports.origen_inventory: ClearInventory (playerId, filter)
SetInventory
Copy exports.origen_inventory: SetInventory (playerId, inventory)
SetInventoryItems
Copy exports.origen_inventory: SetInventoryItems (playerId, item, amount)
GetTotalWeight
Copy exports.origen_inventory: GetTotalWeight (playerId)
HasItem
Copy exports.origen_inventory: HasItem (playerId, item, amount)
GetItemByName
Copy exports.origen_inventory: GetItemByName (playerId, item)
GetSlotsByItem
Copy exports.origen_inventory: GetSlotsByItem (items, item)
GetItemByslot
Copy exports.origen_inventory: GetItemBySlot (playerId, slot)
GetFirstSlotByItem
Copy exports.origen_inventory: GetFirstSlotByItem (items, item)
GetItemTotalAmount
Copy exports.origen_inventory: GetItemTotalAmount (playerId, item)
RemoveItem
Copy exports.origen_inventory: RemoveItem (playerId, item, amount)
AddItem
Copy exports.origen_inventory:AddItem(playerId, item, amount, slot --[[optional]], info --[[optional]], metadata--[[optional]])
RemoveItem
Copy exports.origen_inventory: RemoveItem (playerId, item, amount, slot --[[optional]] , metadata --[[optional]] )
SetItemMetada
Copy exports.origen_inventory: SetItemMetadata (playerId, item, slot, metadata)
AddItemMetadata
Copy exports.origen_inventory: AddItemMetadata (playerId, item, slot, metadata)
SetInventoryData
Copy exports.origen_inventory: SetInventoryData (fromInventory, toInventory, fromSlot, toSlot, fromAmount, toAmount)
OpenInventory
Copy --[[
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
Copy exports.origen_inventory: GetItemLabel (item)
SaveInventory
Copy exports.origen_inventory: SaveInventory (playerId, isOffline?)
LoadInventory
Copy -- 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
Copy exports.origen_inventory: GetInventory (playerId)
exports.origen_inventory: getPlayerInventory (playerId)
GetUsableItem
Copy exports.origen_inventory: GetUsableItem (name)
CreateUseableItem
Copy exports.origen_inventory: CreateUseableItem (name, cb)
UseItem
Copy exports.origen_inventory: UseItem (playerId, name)
UseItemSlot
Copy exports.origen_inventory: UseItemSlot (slot, inventory_id)
GetTotalWeightByItems
Copy local items = { 'id_card' , 'sandwich' }
exports.origen_inventory: GetTotalWeightByItems (items)
OpenInventoryById
Copy exports.origen_inventory: OpenInventoryById (playerId, otherPlayerId)
GetItemByMetadata
Copy exports.origen_inventory: GetItemByMetadata (playerId, metaKey, metaValue)
GetItemsByMetadata
Copy exports.origen_inventory: GetItemsByMetadata (playerId, metaKey, metaValue)
GetItemByMetaKey
Copy exports.origen_inventory: GetItemByMetaKey (playerId, metaKey)
GetItemsByMetaKey
Copy exports.origen_inventory: GetItemsByMetaKey (playerId, metaKey)
GetItemInfoBySlot
Copy exports.origen_inventory: GetItemInfoBySlot (playerId, itemName, slot)
GetItemCount
Copy exports.origen_inventory: GetItemCount (playerId, itemName, metadata, strict)
GetItem
Copy exports.origen_inventory: GetItem (playerId, itemName, metadata, returnsCount)
Last updated 3 months ago