Esx_shops doesn't display shop names?

I am using the latest version of the project here on github. I thought there was supposed to be multiple shops with different names for a few of them. According to the config.lua

Config              = {}
Config.DrawDistance = 100
Config.Size         = {x = 1.5, y = 1.5, z = 1.5}
Config.Color        = {r = 0, g = 128, b = 255}
Config.Type         = 1
Config.Locale       = 'en'

Config.Zones = {

	TwentyFourSeven = {
		Items = {},
		Pos = {
			{x = 373.875,   y = 325.896,  z = 102.566},
			{x = 2557.458,  y = 382.282,  z = 107.622},
			{x = -3038.939, y = 585.954,  z = 6.908},
			{x = -3241.927, y = 1001.462, z = 11.830},
			{x = 547.431,   y = 2671.710, z = 41.156},
			{x = 1961.464,  y = 3740.672, z = 31.343},
			{x = 2678.916,  y = 3280.671, z = 54.241},
			{x = 1729.216,  y = 6414.131, z = 34.037}
		}
	},

	RobsLiquor = {
		Items = {},
		Pos = {
			{x = 1135.808,  y = -982.281,  z = 45.415},
			{x = -1222.915, y = -906.983,  z = 11.326},
			{x = -1487.553, y = -379.107,  z = 39.163},
			{x = -2968.243, y = 390.910,   z = 14.043},
			{x = 1166.024,  y = 2708.930,  z = 37.157},
			{x = 1392.562,  y = 3604.684,  z = 33.980},
			{x = 127.830,   y = -1284.796, z = 28.280}, --StripClub
			{x = -1393.409, y = -606.624,  z = 29.319}, --Tequila la
			{x = -559.906,  y = 287.093,   z = 81.176}  --Bahamamas
		}
	},

	LTDgasoline = {
		Items = {},
		Pos = {
			{x = -48.519,   y = -1757.514, z = 28.421},
			{x = 1163.373,  y = -323.801,  z = 68.205},
			{x = -707.501,  y = -914.260,  z = 18.215},
			{x = -1820.523, y = 792.518,   z = 137.118},
			{x = 1698.388,  y = 4924.404,  z = 41.063}
		}
	}
}

but when I go into the map in-game all of the shops are just named shop. Not sure if I am missing something or what. Any help greatly appreciated, thank you.

1 Like

Hi,
Take a Look into client/Main.lua the part with the Blips

Here is the default code from esx_shops/client/main.lua

-- Create Blips
Citizen.CreateThread(function()
	for k,v in pairs(Config.Zones) do
		for i = 1, #v.Pos, 1 do
			local blip = AddBlipForCoord(v.Pos[i].x, v.Pos[i].y, v.Pos[i].z)
			SetBlipSprite (blip, 52)
			SetBlipDisplay(blip, 4)
			SetBlipScale  (blip, 1.0)
			SetBlipColour (blip, 2)
			SetBlipAsShortRange(blip, true)
			BeginTextCommandSetBlipName("STRING")
			AddTextComponentString(_U('shops'))
			EndTextCommandSetBlipName(blip)
		end
	end
end)

-- Display markers
Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		local coords = GetEntityCoords(PlayerPedId())

		for k,v in pairs(Config.Zones) do
			for i = 1, #v.Pos, 1 do
				if(Config.Type ~= -1 and GetDistanceBetweenCoords(coords, v.Pos[i].x, v.Pos[i].y, v.Pos[i].z, true) < Config.DrawDistance) then
					DrawMarker(Config.Type, v.Pos[i].x, v.Pos[i].y, v.Pos[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.Size.x, Config.Size.y, Config.Size.z, Config.Color.r, Config.Color.g, Config.Color.b, 100, false, true, 2, false, false, false, false)
				end
			end
		end
	end
end)

Try to change this line :

AddTextComponentString(_U('shops'))

To this:

AddTextComponentString(k)
2 Likes

Worked, thank you!

That worked awesome.

I tryed something else to create the name with space.
Beside that also the blip icon and color.

It kinda works, because i can see it in the list, but not the rest of the locations.

TwentyFourSeven = {
		Icon = { 52 },
		Color = { 2 },
		Name = { 'Twenty Four Seven' },
		Items = {},
		Pos = {
			{x = 373.875,   y = 325.896,  z = 102.566},
			{x = 2557.458,  y = 382.282,  z = 107.622},
			{x = -3038.939, y = 585.954,  z = 6.908},
			{x = -3241.927, y = 1001.462, z = 11.830},
			{x = 547.431,   y = 2671.710, z = 41.156},
			{x = 1961.464,  y = 3740.672, z = 31.343},
			{x = 2678.916,  y = 3280.671, z = 54.241},
			{x = 1729.216,  y = 6414.131, z = 34.037}
		}
	},
Citizen.CreateThread(function()
	for k,v in pairs(Config.Zones) do
		for i = 1, #v.Pos, 1 do
			local blip = AddBlipForCoord(v.Pos[i].x, v.Pos[i].y, v.Pos[i].z)
			SetBlipSprite (blip, v.Icon[i])
			SetBlipDisplay(blip, 4)
			SetBlipScale  (blip, 1.0)
			SetBlipColour (blip, v.Color[i])
			SetBlipAsShortRange(blip, true)
			BeginTextCommandSetBlipName("STRING")
			AddTextComponentString(v.Name[i])
			EndTextCommandSetBlipName(blip)
		end
	end
end)

What am i doing wrong ?
Do i still have to change something to the display marker ?

-- Display markers
Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		local coords = GetEntityCoords(PlayerPedId())

		for k,v in pairs(Config.Zones) do
			for i = 1, #v.Pos, 1 do
				if(Config.Type ~= -1 and GetDistanceBetweenCoords(coords, v.Pos[i].x, v.Pos[i].y, v.Pos[i].z, true) < Config.DrawDistance) then
					DrawMarker(Config.Type, v.Pos[i].x, v.Pos[i].y, v.Pos[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.Size.x, Config.Size.y, Config.Size.z, Config.Color.r, Config.Color.g, Config.Color.b, 100, false, true, 2, false, false, false, false)
				end
			end
		end
	end
end)

I just want every shop his own name icon and color.
Well it’s fixed.

TwentyFourSeven = {
		Items = {},
		Pos = {
			{x = 373.875,   y = 325.896,  z = 102.566, icon = 52, color = 2, name = 'Twenty Four Seven'},
			{x = 2557.458,  y = 382.282,  z = 107.622, icon = 52, color = 2, name = 'Twenty Four Seven'},
			{x = -3038.939, y = 585.954,  z = 6.908, icon = 52, color = 2, name = 'Twenty Four Seven'},
			{x = -3241.927, y = 1001.462, z = 11.830, icon = 52, color = 2, name = 'Twenty Four Seven'},
			{x = 547.431,   y = 2671.710, z = 41.156, icon = 52, color = 2, name = 'Twenty Four Seven'},
			{x = 1961.464,  y = 3740.672, z = 31.343, icon = 52, color = 2, name = 'Twenty Four Seven'},
			{x = 2678.916,  y = 3280.671, z = 54.241, icon = 52, color = 2, name = 'Twenty Four Seven'},
			{x = 1729.216,  y = 6414.131, z = 34.037, icon = 52, color = 2, name = 'Twenty Four Seven'}
		}
	},
Citizen.CreateThread(function()
	for k,v in pairs(Config.Zones) do
		for i = 1, #v.Pos, 1 do
			local blip = AddBlipForCoord(v.Pos[i].x, v.Pos[i].y, v.Pos[i].z)
			SetBlipSprite (blip, v.Pos[i].icon)
			SetBlipDisplay(blip, 4)
			SetBlipScale  (blip, 1.0)
			SetBlipColour (blip, v.Pos[i].color)
			SetBlipAsShortRange(blip, true)
			BeginTextCommandSetBlipName("STRING")
			AddTextComponentString(v.Pos[i].name)
			EndTextCommandSetBlipName(blip)

		end
	end
end)

Adding the icon, color, name on EVERY coord. There must be a shorter way. But i tryed so much.
Since i’m not the best with this. I hope somebody comes up with a shoter version.

2 Likes

This is what I was trying to do, I tried to separate each Config.Zone into conditions, but it didn’t work