ESX_Inventory not closing problem with conde-b1g_inventory

So I have been working on a new fiveM server and I have had this problem with the inventory where it opens and then when I close it does not leave the mouse control format. I will leave a link to what HUD I use and a video of the problem if anyone could tell me how to fix it that would be amazing.

HUD: GitHub - DanielEscadas/conde-b1g_inventory
Video:

Do you have any errors in the console?

It seems like a known issue to the community. looking at the issues #26 and #28.

But no fixes yet.

Nope, I don’t know if it has something to do with the current inventory HUD I’m using or if it’s an esx problem.

u can check if the SetAutoFocus(false,false) Gets called when closing the inventory. If its called maybe something is interfering with the focus?

To be honest, I’m not sure what to be looking for I am pretty brand new to this but I did a control F search through some of the main code and did not find what you were asking for I linked the script if you could look through it if not that’s fine.

In the main.lua inside the client script there is a function closeInventory()
You can try placing a print above the line SetNuiFocus(false, false) to check if the code reaches that. Im cannot test things by my self because I need to setup a complete esx server for that. Dont have time for that XD

Make sure you do not modify the script name and it is still “conde-b1g_inventory”.


If that isn’t the issue go to html/js/inventory.js and replace this:

$("body").on("keyup", function (key) {
    if (Config.closeKeys.includes(key.which)) {
        closeInventory();
    }
});

with this on lines 410 through 414: (this is a code snippet from a script I created)

document.onkeyup = function(data){
    if (data.which == 27) {
        closeInventory();
    }
}

If that still doesn’t fix it, keep the code replaced but instead of closeInventory() add $.post("http://conde-b1g_inventory/NUIFocusOff", JSON.stringify({}));


And if all else fails check your client and server console for errors, then reply back with anything you may find.

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