[Release] Show any blip on map


#1

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)

[Help] Add markers to map (Gang locations)
[HELP] Simple script don't work
#2

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


#3

@kanersps Ok i will add a blip onPlayerspawn, thanks


#4

#5

#6

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:


#7

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


#8

@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


#9

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

#10

Thanks! going to give it a try right now


#11

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


#12

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


#15

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


#16

How to rename it ? pls ?


#17

Thanks guys, This worked out perfect!!


#18

How to give the name to the blip??


#19

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


#20

up please guys if someone knows how to proceed


#21

no one knows please ?


#22

I would also like to know.

An idea ?

UltraGAMING