Skip to content

Commit

Permalink
feat(bridge/inventory): ✨ add auto inventory detection with the optio…
Browse files Browse the repository at this point in the history
…n to turn it off.
  • Loading branch information
Arctos2win authored Nov 14, 2024
1 parent 0b2cdf8 commit 0c2a8f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
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

0 comments on commit 0c2a8f8

Please sign in to comment.