Server
inventory:server:OpenInventory
You need to add the shop config to the inventory script
(tgiann-inventory\configs\shopConfig.lua)
Parameters :
Name | Type | Description |
---|---|---|
splayerSrc | int | Player source id |
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"]:OpenShop(playerSrc, shopName)
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 |
---|---|---|
playerSrc | int | Player source |
targetSrc | int | Target player source |
TriggerServerEvent("inventory:server:OpenInventory", "otherplayer", targetSrc, nil, { showClothe = false })
-- Exports can only be used on the server side
exports["tgiann-inventory"]:OpenInventoryById(playerSrc, targetSrc)
exports["tgiann-inventory"]:OpenInventory(playerSrc, "otherplayer", targetSrc, nil, { showClothe = false })
Parameters :
Name | Type | Description |
---|---|---|
stashName* | string | Stash name |
data | table | null | maxweight: The maximum weight capacity of the storage. If null, a default value is assigned. slots: The maximum number of slots in the storage. If null, a default value is assigned. whitelist: Whitelist and blacklist cannot be used simultaneously. Only items added to the whitelist can be placed in the storage. If the value is null, items are not checked blacklist: Blacklist and whitelist cannot be used simultaneously. Items on the blacklist cannot be placed in the storage. If the value is null, items are not checked |
extraData | table | null | 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 |
-- Events can only be used on the client side
TriggerServerEvent("inventory:server:OpenInventory", "stash", stashName, {
maxweight = 4000000,
slots = 50,
whitelist = {"bandage"} -- If the value is not null, only the specified items can be stored in this stash.
}, { isPlayer = false, password = "abc" })
TriggerServerEvent("inventory:server:OpenInventory", "stash", stashName, {
maxweight = 4000000,
slots = 50,
}, { isPlayer = false, password = "abc" })
riggerServerEvent("inventory:server:OpenInventory", "stash", stashName, {
maxweight = 4000000,
slots = 50,
})
-- Exports can only be used on the server side
exports["tgiann-inventory"]:OpenInventory(playerSrc, "stash", stashName, {
maxweight = 4000000,
slots = 50,
blacklist = {"bandage"} -- If the value is not null, the specified items cannot be placed in the stash.
}, { isPlayer = false, password = "abc" })
exports["tgiann-inventory"]:OpenInventory(playerSrc, "stash", stashName, {
maxweight = 4000000,
slots = 50,
})
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