Skip to content

05. Property support

Dutch Players edited this page May 1, 2020 · 15 revisions

Add property support

1a. 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'})

1b. And replace it with:

			table.insert(elements, {label = "Property inventory", value = "property_inventory"}

2a. Then find this code:

			elseif data.current.value == 'room_inventory' then
				OpenRoomInventoryMenu(property, owner)
			elseif data.current.value == 'player_inventory' then
				OpenPlayerInventoryMenu(property, owner)

2b. And replace it with:

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

Clone this wiki locally