Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bridge/inventory): ✨ add auto inventory detection with the option to turn it off. #1465

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions [core]/es_extended/server/bridge/inventory/oxinventory.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
if Config.CustomInventory == "auto" and GetResourceState("ox_inventory") ~= "missing" then
Config.OxInventory = true
Config.CustomInventory = "ox"
SetConvarReplicated("inventory:framework", "esx")
SetConvarReplicated("inventory:weight", Config.MaxWeight * 1000)
end

if Config.CustomInventory ~= "ox" then return end

MySQL.ready(function()
Expand Down
6 changes: 4 additions & 2 deletions [core]/es_extended/shared/config/main.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Config = {}

-- for ox inventory, use Config.CustomInventory = "ox", for others, set to "resource_name"
Config.CustomInventory = false
-- false = no custom inventory
-- "ox" = ox_inventory
-- for other inventories use "inventory_name"
Config.CustomInventory = "auto"

Config.Accounts = {
bank = {
Expand Down
Loading