Server
inventory:server:OpenInventory
You need to add the shop config to the inventory script
(tgiann-inventory\configs\shopConfig.lua)
Parameters :
Name | Type | Description |
---|---|---|
shopName* | string | shop name from "shopConfig.lua" |
TriggerServerEvent("inventory:server:OpenInventory", "shop", shopName, shopName)
-- Exports can only be used on the server side
exports["tgiann-inventory"]:OpenInventory(playerSrc, "shop", shopName, shopName)
Examples
TriggerServerEvent("inventory:server:OpenInventory", "shop", "weaponshop", "weaponshop")
TriggerServerEvent("inventory:server:OpenInventory", "shop", "police", "police")
Parameters :
Name | Type | Description |
---|---|---|
shopName* | string | shop name from "configShop.lua" |
extraData | table | showClothe: showclothe true also shows the other player's clothing inventory |
TriggerServerEvent("inventory:server:OpenInventory", "otherplayer", src, nil, { showClothe = false })
-- Exports can only be used on the server side
exports["tgiann-inventory"]:OpenInventory(playerSrc, "otherplayer", src, nil, { showClothe = false })
Parameters :
Name | Type | Description |
---|---|---|
stashName* | string | Stash name |
data | table | you can adjust the max weight and slot |
extraData | table | isPlayer; when set to true, no other player can open except the first player to open password; password is set the first time it is opened on and the password is checked every time it is opened |
TriggerServerEvent("inventory:server:OpenInventory", "stash", stashName, {
maxweight = 4000000,
slots = 50,
}, { isPlayer = false, password = "abc" })
-- Exports can only be used on the server side
exports["tgiann-inventory"]:OpenInventory(playerSrc, "stash", stashName, {
maxweight = 4000000,
slots = 50,
}, { isPlayer = false, password = "abc" })
Examples
local name = "policeStash"
TriggerServerEvent("inventory:server:OpenInventory", "stash", name, {maxweight = 200000, slots = 10})
local playerStashName = PlayerData.citizenid.."_motel"
TriggerServerEvent("inventory:server:OpenInventory", "stash", playerStashName, {maxweight = 200000, slots = 10}, { isPlayer = true })
local password = "abcTGI123"
local securityStashName = "best"
TriggerServerEvent("inventory:server:OpenInventory", "stash", securityStashName, {maxweight = 200000, slots = 10}, {password = password})
You need to add the craft config to the inventory script
(tgiann-inventory\configs\configCraft.lua)
Parameters :
Name | Type | Description |
---|---|---|
categoryName* | string | crafting category from "configCraft.lua" |
TriggerServerEvent("inventory:server:OpenInventory", "crafting", "craft_"..GetGameTimer(), categoryName)
-- Exports can only be used on the server side
exports["tgiann-inventory"]:OpenInventory(playerSrc, "crafting", "craft_"..GetGameTimer(), categoryName)
Examples
TriggerServerEvent("inventory:server:OpenInventory", "crafting", "craft_"..GetGameTimer(), "mycraftname")
Last updated