QBCore玩家背包 扩展储物空间 警用腰带可作为储物空间
-
扩展库存容量:玩家可以在库存中携带更多材料和物品,从而实现更大的灵活性和资源管理。
-
道具:该脚本通过在玩家的背部或手上显示袋子道具来提供逼真的视觉效果,表明他们配备了一个袋子。
-
列入黑名单的物品:灵活的选项允许您指定列入黑名单的物品,确保某些物品不能存放在袋子中。此功能有助于保持平衡并防止滥用。
-
流畅动画:打开和关闭动画在访问背包时提供身临其境且具有视觉吸引力的体验。这些动画增强了游戏的真实感和沉浸感。
-
锁定系统:袋子可以配备锁定系统,为贵重物品提供额外的安全层。
-
防止漏洞利用:该脚本主动防止“袋中包”漏洞,确保公平的游戏玩法并维护库存系统的完整性。
查看 Keep-bags 预览,以更好地了解该模组的功能。
- 脚本从 keep-backpack 重命名为 keep-bags 😉
- qb-core/esx
- qb-inventory/ox_inventory
- ox_lib (required on esx/optional for qbcore)
- keep-harmony
- illenium-appearance / qb-clothing
请按照以下步骤安装 keep-bags:
- 在里面添加图像
inventoryimages
qb-inventory/html/images
- QBCore 将以下代码添加到
qb-core/shared/items.lua
backpack1 = { name = "backpack1", label = "Backpack", weight = 7500, type = "item", image = "backpack1.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "A stylish backpack" },
backpack2 = { name = "backpack2", label = "Backpack", weight = 15000, type = "item", image = "backpack2.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "A stylish backpack" },
duffle1 = { name = "duffle1", label = "Duffle bag", weight = 15000, type = "item", image = "duffle1.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "A stylish duffle bag" },
briefcase = { name = "briefcase", label = "Briefcase", weight = 10000, type = "item", image = "briefcase.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "A portable rectangular case used for carrying important documents, files, or other personal belongings." },
paramedicbag = { name = "paramedicbag", label = "Paramedic bag", weight = 5000, type = "item", image = "paramedicbag.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "A medical bag used by paramedics, containing essential supplies for emergency care." },
policepouches = { name = "policepouches", label = "Police Pouch", weight = 5000, type = "item", image = "policepouches.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "A pouch used by police officers to store and carry essential supplies such as handcuffs, pepper spray, and other tactical equipment." },
policepouches1 = { name = "policepouches1", label = "Police Pouch", weight = 5000, type = "item", image = "policepouches1.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "A larger version of the police pouch used to store additional tactical gear and equipment." },
briefcaselockpicker = { name = "briefcaselockpicker", label = "Briefcase Lockpicker", weight = 500, type = "item", image = "lockpick.png", unique = false, useable = true, shouldClose = true, combinable = nil, description = "Briefcase Lockpicker" },
ESX (ox_inventory)
["backpack1"] = {
label = "backpack1",
weight = 15,
stack = false,
close = true,
description = "A stylish backpack"
},
["backpack2"] = {
label = "backpack2",
weight = 15,
stack = false,
close = true,
description = "A stylish backpack"
},
["duffle1"] = {
label = "Duffle bag",
weight = 15,
stack = false,
close = true,
description = "A stylish duffle bag"
},
["briefcase"] = {
label = "Briefcase",
weight = 10,
stack = false,
close = true,
description = "A portable rectangular case used for carrying important documents, files, or other personal belongings."
},
["paramedicbag"] = {
label = "Paramedic bag",
weight = 5,
stack = false,
close = true,
description = "A medical bag used by paramedics, containing essential supplies for emergency care."
},
["policepouches"] = {
label = "Police Pouch",
weight = 5,
stack = false,
close = true,
description = "A pouch used by police officers to store and carry essential supplies such as handcuffs, pepper spray, and other tactical equipment."
},
["policepouches1"] = {
label = "Police Pouch",
weight = 5,
stack = false,
close = true,
description = "A larger version of the police pouch used to store additional tactical gear and equipment."
},
["briefcaselockpicker"] = {
label = "Briefcase Lockpicker",
weight = 0.5,
stack = true,
close = true,
description = "Briefcase Lockpicker"
}
找到函数,然后在其末尾添加此事件:openMenu
client/main.lua
local function openMenu(allowedMenus)
-- existing code up there ...
TriggerEvent('qb-clothing:client->open')
end
编辑函数后。修改后的函数应如下所示:
local function SaveStashItems(stashId, items)
if Stashes[stashId].label == 'Stash-None' or not items then return end
for _, item in pairs(items) do
item.description = nil
end
MySQL.insert('INSERT INTO stashitems (stash, items) VALUES (:stash, :items) ON DUPLICATE KEY UPDATE items = :items',
{
['stash'] = stashId,
['items'] = json.encode(items)
})
Stashes[stashId].isOpen = false
TriggerEvent('keep-harmony:stash->close', stashId) --- this is the line
end
然后在末尾添加此导出:server/main.lua
exports('GetInventoryData', function(type, id)
if type == 'stash' then
return Stashes[id]
end
end)
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
- 最新
- 最热
只看作者