What's new

Answered MF-Inventory Help

masnyscala

Bronze Elite
Joined
Jan 20, 2022
Messages
6
Solutions
1
Reaction score
5
Points
156
Location
Brazil
Hey, i'm with some problems here..

I'm trying to integrate the mf-inventory to allhousing personal inventorys, but i can't create the command to generate a different inventory sql for each person.

I've tried to get the player identifier to generate the house id "local id" but when i run the script nothing happens.
================= SERVER SIDE =================
Citizen.CreateThread(function()
if not Config.UsingDiscInventory then
local _source = source
local identifier = GetPlayerIdentifier(_source)
local id = "house"..identifier -- Unique identifier for this inventory.
local inventoryType = "inventory" -- Inventory type. Default is "inventory", other types are "shop" and "recipe".
local inventorySubType = "housing" -- Inventory sub-type, used to modify degrade modifiers by the config table.
local inventoryLabel = "house_storage" -- The inventorys UI label index (which will pull the translation value).
local maxWeight = 250.0 -- Max weight for the inventory.
local maxSlots = 50 -- Max slots for the inventory.

exports["mf-inventory"]:createInventory(id,inventoryType,inventorySubType,inventoryLabel,maxWeight,maxSlots)
end
end)
================= SERVER SIDE =================

================= CLIENT SIDE =================
OpenInventory = function()
local _source = source
local identifier = GetPlayerIdentifier(_source)
local id = "house"..identifier -- Unique identifier for this inventory.
exports["mf-inventory"]openOtherInventory("house"..id)
end
================= CLIENT SIDE =================
 
Last edited:

KingTM

Silver Elite
Joined
Jul 7, 2021
Messages
27
Reaction score
40
Points
166
1646256949198.png
 
Top