E aí @Dandnix, em primeiro lugar, arrume a indentação do seu código, tornando mais fácil a leitura do mesmo, para facilitar o trabalho de quem te ajudar e até mesmo facilitar a sua leitura do seu próprio código. Você pode ver como faz isso com um tutorial do @Lord Henry: Clique aqui para acessar o tutorial.
function getOneBlipByID (id)
for i, v in ipairs (getElementsByType("blips")) do
if getBlipIcon(v) == id then
return v
end
end
return false
end
createBlip (0, 0, 0, 10)
createBlip (1, 1, 1, 10)
createBlip (2, 2, 2, 10)
getOneBlipByID (10)
You can simply keep track of the ids by adding them to a table and then check against that table to see if it's already seen that id.
local ids = {}
for i,v in ipairs(getElementsByType("blips")) do
local id = getBlipIcon(v)
if not ids[id] then
ids[id] = true
outputChatBox("ID Icon : "..id)
end
end
ids = {} -- clear it if necessary (depends on your application)
You'll probably want to put this inside a function so that you can trigger it again later, or have the function return the unique ids. But this all depends on the application.