Help me with this please :)

Hello i am trying to change the name of a store and at the same time have my custom icon.
what i have done is:

for storeIndex, storeValues in pairs(Config["Stores"]) do
	local text = Strings["store"]
	local number = 52
	local size = 0.75
	if tonumber(storeIndex) == 17 then
		text = "Teletvå Butik"
		number = 308
		size = 1.0
	end
	blip = AddBlipForCoord(storeValues.blip)
	SetBlipSprite (blip, number)
	SetBlipDisplay(blip, 4)
	SetBlipScale  (blip, size)
	SetBlipColour (blip, 0)
	SetBlipAsShortRange(blip, true)
	BeginTextCommandSetBlipName("STRING")
	AddTextComponentString(storeIndex)
	EndTextCommandSetBlipName(blip)
end

But since the store have the number 17 it will have that name in game on the map. Is there away for me to change that the store have its own name and custom blip? Since i did do “if tonumber(storeIndex) == 17 then” is there anything i can change so i can have the store name and the blip i want?

    ["17"] = {
        ["blip"] = vector3(-657.3065, -857.7051, 24.5031),
        ["locations"] = {
            { coords = vector3(-657.3065, -857.7051, 24.5031), type = 'checkout' },
            { coords = vector3(-659.7975, -857.3751, 24.5031), type = 'telefoner' }
        }
    },

Sorry for my bad english and if you need more information of what i mean i can give you guys that. I am very new and still trying to figure out stuff :slight_smile:

Insead of that, why don’t you try to add a new parameter on the config (like blip or locations) and access it trough code like the others? Might be an easier and extensable aproach.

I realise this is an old thread, but I hate that it was not resolved properly.
So here you go…

The route you took is not the best. As the other responder mentioned, a config table with more properties would be ideal. But your way will still work and was almost right. The only thing that needed changing was;


This:
AddTextComponentString(storeIndex)

Needs to be:
AddTextComponentString(text)


And this;
local text = Strings["store"]

Needs to be;
local text = storeIndex


This will make all the blips labeled with numbers except 17 which will have the custom label and blip sprite. If “Strings” is a table of labels, then you don’t need to do that second change I mentioned, making it local text = storeIndex but instead make it local text = Strings[storeIndex]

There… Now this can be considered solved. :sweat_smile: