[Release] Show any blip on map

This simple client script put blips on map, just edit X,Y,Z and change BlipSprite: BlipSpriteIDs dont forget put in the same folder inside resources a file called __resource.lua containing ( client_script 'thisscript.lua' ).

Citizen.CreateThread(function()

while true do
                                                                   
 local blip1 = AddBlipForCoord(131.14, -1302.6, 29.23)
       SetBlipSprite(blip, 121)
 local blip2 = AddBlipForCoord(1159.65, -313.948, 69.2051)
       SetBlipSprite(blip2, 431)   
 local blip3 = AddBlipForCoord(1126.86, -980.184, 45.4158)
       SetBlipSprite(blip3, 431)   
 
     return
   end
end)
3 Likes

Don’t use this, this adds TONS and TONS of blips to the map and every tick more. You should add a blip onPlayerSpawn

@kanersps Ok i will add a blip onPlayerspawn, thanks

Here’s a fixed variant:

Citizen.CreateThread(function()
                                                               
 local blip1 = AddBlipForCoord(131.14, -1302.6, 29.23)
       SetBlipSprite(blip, 121)
 local blip2 = AddBlipForCoord(1159.65, -313.948, 69.2051)
       SetBlipSprite(blip2, 431)   
 local blip3 = AddBlipForCoord(1126.86, -980.184, 45.4158)
       SetBlipSprite(blip3, 431)   
end)

Of course, the original version worked too, @Kanersps missed this back in August - but it contains a return at the end of the loop. :wink:

Also use a list with coordinates + the sprite id instead of copy + pasting the same lines over and over again.

@Mr.Scammer could you provide a short tutorial on howto use a list with coordinates + the sprite id instead of copy + pasting the same lines over and over again? thanks in advance

Instead of

local blip1 = AddBlipForCoord(131.14, -1302.6, 29.23)
       SetBlipSprite(blip, 121)
 local blip2 = AddBlipForCoord(1159.65, -313.948, 69.2051)
       SetBlipSprite(blip2, 431)   
 local blip3 = AddBlipForCoord(1126.86, -980.184, 45.4158)
       SetBlipSprite(blip3, 431)

use something like this

local blips = {
    {id=121, x=131.14, y=-1302.6, z=29.23},
    ...
}

-- And later --

for _, item in pairs(blips) do
    item.blip = AddBlipForCoord(item.x, item.y, item.z)
    SetBlipSprite(item.blip, item.id)
end
5 Likes

Thanks! going to give it a try right now

cant download the BlipSpriteIDs files and can we have the package of all files or all the .lua content that would be great

Here you have the BlipSpriteIDs https://www.gtamodding.com/wiki/Blip_Sprite_IDs

2 Likes

question for everyone is there a way to put blips on the map but whitout the name on the top right in the (legend) ??

3 Likes

How to rename it ? pls ?

Thanks guys, This worked out perfect!!

How to give the name to the blip??

1 Like

Hello, please how can I show the blips of a job only when the player have the job and hide them when he doesn’t have
Thanks

up please guys if someone knows how to proceed

no one knows please ?

I would also like to know.

An idea ?

UltraGAMING