Enable esx_property inventory HUD - Trsak/esx_inventoryhud GitHub Wiki

To enable esx_property support, follow these steps:

  1. You need to use esx_inventoryhud 2.2+
  2. Open esx_property/client/main.lua and do the following:
  • Find this code in OpenRoomMenu function:
table.insert(elements, {label = _U('remove_object'),  value = 'room_inventory'})
table.insert(elements, {label = _U('deposit_object'), value = 'player_inventory'})

And replace it with:

table.insert(elements, {label = "Property inventory", value = "property_inventory"})
  • Then find this code:
elseif data.current.value == 'room_inventory' then
	OpenRoomInventoryMenu(property, owner)
elseif data.current.value == 'player_inventory' then
	OpenPlayerInventoryMenu(property, owner)

And replace it with:

elseif data.current.value == "property_inventory" then
	menu.close()
	OpenPropertyInventoryMenu(property, owner)
  • And finally add this function:
function OpenPropertyInventoryMenu(property, owner)
	ESX.TriggerServerCallback(
		"esx_property:getPropertyInventory",
		function(inventory)
			TriggerEvent("esx_inventoryhud:openPropertyInventory", inventory)
		end,
		owner
	)
end

Function can be added anywhere in the file, so you can put it for example into end of the file.

And here you go! You now have esx_property support with InventoryHUD!