Ox_Inventory open nearby inventory

Hello, so I am using ox_inventory GitHub - overextended/ox_inventory: Overextended Inventory for ESX Legacy and I am trying to make the openNearbyInventory export to work on other jobs not on only police…

if currentInventory.type == 'otherplayer' then

                        local id = GetPlayerFromServerId(currentInventory.id)

                        local ped = GetPlayerPed(id)

                        local pedCoords = GetEntityCoords(ped)

                        if not id or #(playerCoords - pedCoords) > 1.8 or not (PlayerData.job.name == ox.police or PlayerData.job.name == vst or CanOpenTarget(ped)) then

                            TriggerEvent('ox_inventory:closeInventory')

                            Utils.Notify({type = 'error', text = ox.locale('inventory_lost_access'), duration = 2500})

                        else

                            TaskTurnPedToFaceCoord(PlayerData.ped, pedCoords.x, pedCoords.y, pedCoords.z, 50)

                        end

                    elseif currentInventory.coords and (#(playerCoords - currentInventory.coords) > 2 or CanOpenTarget(PlayerData.ped)) then

                        TriggerEvent('ox_inventory:closeInventory')

                        Utils.Notify({type = 'error', text = ox.locale('inventory_lost_access'), duration = 2500})

                    end

This is 747 line in client.lua

So I’ve changed this line:
if not id or #(playerCoords - pedCoords) > 1.8 or not (PlayerData.job.name == ox.police or CanOpenTarget(ped)) then
To this:
if not id or #(playerCoords - pedCoords) > 1.8 or not (PlayerData.job.name == ox.police or PlayerData.job.name == vst or CanOpenTarget(ped)) then
And it still let’s me search other players only with police job if i put on vst job it doe’s nothing no errors, but doesn’t open inventory.

What should I change so it works?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.