Skip to content

Commit

Permalink
OpenInventoryById (Missing export for new QB compatibility)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertGrubb authored and MonkeyWhisper committed Jul 24, 2024
1 parent f6516c3 commit 02e3a06
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,18 @@ local function CreateNewDrop(source, fromSlot, toSlot, itemAmount, created)
end
end

local function OpenInventoryById(source, targetId)
local QBPlayer = QBCore.Functions.GetPlayer(source)
local TargetPlayer = QBCore.Functions.GetPlayer(tonumber(targetId))
if not QBPlayer or not TargetPlayer then return end
if Player(targetId).state.inv_busy then TriggerClientEvent("ps-inventory:client:closeinv", targetId) end
Wait(1500)
Player(targetId).state.inv_busy = true
OpenInventory("otherplayer", targetId, nil, source)
end

exports('OpenInventoryById', OpenInventoryById)

local function OpenInventory(name, id, other, origin)

-- New QB compatibility
Expand Down

0 comments on commit 02e3a06

Please sign in to comment.