-- Create a public stash with interaction point (runtimeOnly = false)
local stashId = exports['jaksam_inventory']:registerStash({
label = "Public Storage",
coords = vector3(100.0, 200.0, 30.0),
maxWeight = 500,
maxSlots = 50,
radius = 5.0,
runtimeOnly = false -- Enable interaction points
})
-- Create a job-restricted stash with interaction point
local policeStashId = exports['jaksam_inventory']:registerStash({
id = "police_evidence",
label = "Police Evidence Locker",
coords = vector3(450.0, -990.0, 30.0),
maxWeight = 1000,
maxSlots = 100,
radius = 3.0,
allowedJobs = {police = true, sheriff = true},
runtimeOnly = false -- Enable interaction points
})
-- Create a programmatic-only stash (default behavior, runtimeOnly = true)
-- Players can't access it via world interaction, only through code
local hiddenStashId = exports['jaksam_inventory']:registerStash({
id = "secret_stash",
label = "Secret Storage",
maxWeight = 200,
maxSlots = 30
-- No coords provided, accessed only programmatically
})
-- Create a private stash (each player gets their own inventory when accessing the stash)
local privateStashId = exports['jaksam_inventory']:registerStash({
id = "luxury_apartment_stash",
label = "Personal Safe",
coords = vector3(300.0, 400.0, 50.0),
maxWeight = 200,
maxSlots = 30,
isPrivate = true
})
-- Create a temporary stash with starting items (won't save to database)
local tempStashId = exports['jaksam_inventory']:registerStash({
label = "Event Loot Box",
coords = vector3(500.0, 600.0, 20.0),
maxWeight = 100,
maxSlots = 20,
temporary = true,
startingItems = {
{"bread", 5, nil},
{"water", 3, nil},
{"money", 1000, nil}
}
})
-- Create a menu-based stash (runtimeOnly = true by default)
-- Useful for custom UI/menu systems
local virtualStashId = exports['jaksam_inventory']:registerStash({
id = "player_bank_vault",
label = "Bank Vault",
maxWeight = 500,
maxSlots = 50,
isPrivate = true
-- runtimeOnly = true by default, accessed only programmatically
})
-- Open stash programmatically from server (e.g., from a menu or command)
RegisterCommand('openvault', function(source)
local charId = Framework.getPlayerCharIdentifier(source)
local stashId = "player_bank_vault_" .. charId
exports['jaksam_inventory']:forceOpenInventory(source, stashId)
end)
-- Alternative: Open from client-side script
-- exports['jaksam_inventory']:openInventory('stashId')