Esx_menu_default and esx_shops

Hello im using this esx_menu_default: [Release] esx_menu_default edited to looks like gtaonline and the original esx_shops and I tried to make different header for different shops.

I tried this but it didn’t work:

config.lua (esx_shops) :

Config.Zones = {

	TwentyFourSeven = {
		Items = {},
		Pos = {
			{x = 373.875,   y = 325.896,  z = 102.566, icon = 52, color = 2, name = '24/7 Supermarkt', header = 'superete'},
			{x = 2557.458,  y = 382.282,  z = 107.622, icon = 52, color = 2, name = '24/7 Supermarkt', header = 'superete'},
			{x = -3038.939, y = 585.954,  z = 6.908, icon = 52, color = 2, name = '24/7 Supermarkt', header = 'superete'},
			{x = -3241.927, y = 1001.462, z = 11.830, icon = 52, color = 2, name = '24/7 Supermarkt', header = 'superete'},
			{x = 547.431,   y = 2671.710, z = 41.156, icon = 52, color = 2, name = '24/7 Supermarkt', header = 'superete'},
			{x = 1961.464,  y = 3740.672, z = 31.343, icon = 52, color = 2, name = '24/7 Supermarkt', header = 'superete'},
			{x = 2678.916,  y = 3280.671, z = 54.241, icon = 52, color = 2, name = '24/7 Supermarkt', header = 'superete'},
			{x = 1729.216,  y = 6414.131, z = 34.037, icon = 52, color = 2, name = '24/7 Supermarkt', header = 'superete'}
		}
	},

	RobsLiquor = {
		Items = {},
		Pos = {
			{x = 1135.808,  y = -982.281,  z = 45.415, icon = 52, color = 3, name = 'Getränkemarkt', header = 'ammu'},
			{x = -1222.915, y = -906.983,  z = 11.326, icon = 52, color = 3, name = 'Getränkemarkt', header = 'ammu'},
			{x = -1487.553, y = -379.107,  z = 39.163, icon = 52, color = 3, name = 'Getränkemarkt', header = 'ammu'},
			{x = -2968.243, y = 390.910,   z = 14.043, icon = 52, color = 3, name = 'Getränkemarkt', header = 'ammu'},
			{x = 1166.024,  y = 2708.930,  z = 37.157, icon = 52, color = 3, name = 'Getränkemarkt', header = 'ammu'},
			{x = 1392.562,  y = 3604.684,  z = 33.980, icon = 52, color = 3, name = 'Getränkemarkt', header = 'ammu'}
		}
	},

	LTDgasoline = {
		Items = {},
		Pos = {
			{x = -48.519,   y = -1757.514, z = 28.421, icon = 52, color = 1, name = 'Tankstelle', header = 'superete3'},
			{x = 1163.373,  y = -323.801,  z = 68.205, icon = 52, color = 1, name = 'Tankstelle', header = 'superete3'},
			{x = -707.501,  y = -914.260,  z = 18.215, icon = 52, color = 1, name = 'Tankstelle', header = 'superete3'},
			{x = -1820.523, y = 792.518,   z = 137.118, icon = 52, color = 1, name = 'Tankstelle', header = 'superete3'},
			{x = 1698.388,  y = 4924.404,  z = 41.063, icon = 52, color = 1, name = 'Tankstelle', header = 'superete3'}
		}
	},

	Bar = {
		Items = {},
		Pos = {
			{x = 127.830,   y = -1284.796, z = 28.280, icon = 121, color = 8, name = 'Vanilla Unicorn', header = 'superete'},
			{x = -1393.409, y = -606.624,  z = 29.319, icon = 93, color = 44, name = 'Bahamamas', header = 'superete'},
			{x = -559.906,  y = 287.093,   z = 81.176, icon = 93, color = 44, name = 'Tequi-la-la', header = 'superete'}
		}
	},

	WeedShop = {
		Items = {},
		Pos = {
			{x = -1172.37,   y = -1572.29, z = 3.66, icon = 496, color = 2, name = 'Smoke on the Water', header = 'superete'}
		}
	}

}

client/main.lua (esx_shops) :

function OpenShopMenu(zone)
	local elements = {}
	for i=1, #Config.Zones[zone].Items, 1 do
		local item = Config.Zones[zone].Items[i]

		table.insert(elements, {
			label      = ('%s - <span style="color:green;">%s</span>'):format(item.label, _U('shop_item', ESX.Math.GroupDigits(item.price))),
			itemLabel = item.label,
			item       = item.item,
			price      = item.price,

			-- menu properties
			value      = 1,
			type       = 'slider',
			min        = 1,
			max        = 100
		})
	end

	ESX.UI.Menu.CloseAll()

	for k,v in pairs(Config.Zones) do
		for i = 1, #v.Pos, 1 do
			ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'shop', {
				css = v.Pos[i].header,
				title    = _U('shop'),
				align    = 'bottom-right',
				elements = elements
			}, function(data, menu)
				ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'shop_confirm', {
					title    = _U('shop_confirm', data.current.value, data.current.itemLabel, ESX.Math.GroupDigits(data.current.price * data.current.value)),
					align    = 'bottom-right',
					elements = {
						{label = _U('no'),  value = 'no'},
						{label = _U('yes'), value = 'yes'}
				}}, function(data2, menu2)
					if data2.current.value == 'yes' then
						TriggerServerEvent('esx_shops:buyItem', data.current.item, data.current.value, zone)
					end

					menu2.close()
				end, function(data2, menu2)
					menu2.close()
				end)
			end, function(data, menu)
				menu.close()

				currentAction     = 'shop_menu'
				currentActionMsg  = _U('press_menu')
				currentActionData = {zone = zone}
			end)
		end
	end
end

But it didn’t open the different Header. How could I fix this?

Thanks for the help

Is there any Error?

There are no Errors. The Header is “ammu” on every shop I try to open

Be careful where you post next time. This is #server-development:essentialmode related

1 Like

Okay im sorry

It seems that the Shop uses 1 Header for every Shop. When I restart the resource he uses another different Header for all Shops

Fixed! If any1 needs help with this send me pm.

bro can you help me with my server

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