Skip to content

Commit

Permalink
refactor(server/inventory): reference server.accounts in Inventory
Browse files Browse the repository at this point in the history
When we send the event with function references, we need to include accounts to sync for ESX.
  • Loading branch information
thelindat committed Feb 18, 2022
1 parent 1965622 commit 32754cc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ game 'gta5'
--[[ Resource Information ]]--
name 'ox_inventory'
author 'Overextended'
version '2.4.1'
version '2.4.2'
repository 'https://github.com/overextended/ox_inventory'
description 'Slot-based inventory with metadata'

Expand Down
1 change: 1 addition & 0 deletions modules/bridge/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ elseif shared.framework == 'esx' then
server.UsableItemsCallbacks = ESX.GetUsableItems
server.GetPlayerFromId = ESX.GetPlayerFromId

-- Accounts that need to be synced with physical items
server.accounts = {
money = 0,
black_money = 0,
Expand Down
1 change: 1 addition & 0 deletions modules/inventory/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,7 @@ import.commands('ox_inventory', 'viewinv', function(source, args)
end, {'target'})

import.commands = nil
Inventory.accounts = server.accounts

TriggerEvent('ox_inventory:loadInventory', Inventory)

Expand Down

0 comments on commit 32754cc

Please sign in to comment.