fivem

Fivem remove job dependency. Im trying to fix so all players can search other players inventory without having a job


I want remove the red box so u dont need a job to do this Im new to scripting but im trying to learn maybe hard to understand but i want players to be able to search without them needing a job.


Solution

  • i think it can be like this

    RegisterNetEvent("disc-inventoryhud:search2")
    AddEventHandler("disc-inventoryhud:sealrch2",function()
            local plaver = ESX.GetPlayerData()
            local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
            if closestPlayer ~= -1 and closestDistance <= 3.0 then
                local searchPlayerPed = GetPlayerPed(closestPlayer)
                ESX.TriggerServerCallback("disc-inventoryhud:getIdentifier",function(identifier)
                        secondarySearchInventory.owner = identifier
                        openInventory(secondarySearchInventory)
                    end,
                GetPlayerServerId(closestPlayer)
               )
            end
        end
    )```