[HELP]Make blip on map to make something happen

Hi I am wondering if anyone could help me I am not sure where to start but I need to find out how to make a little like circle or something at a location on the map to then activate a menu or something if anyone could help me figure this out I would be most appreciative.

Youâ€™d compare the players coords to the coords of the marker then if below x distance then do whatever you want it to do

So basically create a variable called like coords or something and reference that with player coords and draw a notifacation or however you do a blip ?

``````local cords = [getplayercords]

function blipgreen()
CREATE BLIP HERE
end

ps i know you dont actually do get cords like that but for example purposes:

if PLAYER STAND ON BLIP DOES SOMETHING
``````

Basically, just check the distance between 2 coords (the players and the blips) and if its below lets say 5 then do something

Ok i am going to do kiind of an example see if it works

Just asking can I use a native to get the coords or just create variable with coords?

You would need to get the distance for the player to do something on the marker. Is this a Blip or a Marker?

Marker think like you go to pd say and there will be like a thing there you go to and menu pops up. Like I am new to programming with gtav I learnt the basics of lua like the function if else while etc

``````local table = {
{x = 1,y = 1,z = 1},
{x = 2,y = 2,z = 2},
{x = 3,y = 3,z = 3}
}

-- Draw Markers --
while true do
Citizen.Wait(0)
for k in pairs(table) do
-- Draw Marker Here --
DrawMarker(1, table[k].x, table[k].y, table[k].z, 0, 0, 0, 0, 0, 0, 1.001, 1.0001, 0.5001, 0, 0, 255, 200, 0, 0, 0, 0)
end
end
end)

while true do
Citizen.Wait(0)

for k in pairs(table) do

local plyCoords = GetEntityCoords(GetPlayerPed(-1), false)
local dis = Vdist(plyCoords.x, plyCoords.y, plyCoords.z, table[k].x, table[k].y, table[k].z)

if dist <= 1.2 then
if IsControlJustPressed(3,176) then
Citizen.Trace("BUTTON ENTER PRESSED ON MARKER.")
end
end
end
end
end)
``````
1 Like

Thanks but Could you explain little more about how I would do the marker

I put markers in comments up thereâ€¦

Yes I mean I dont really understand exactly what you mean but thanks for the help so if you cant tel me its fine ill figure it out but it would help a lot if you could

Thats litterally a full scriptâ€¦ That copy and past would work. Just need to fill the XYZ coords in the table.

Oh ok thanks I will take this and learn from it thanks

Also do i put the coords in the variable or the draw marker just checking incase i do it wrong lol

``````local table = {
{x = 1,y = 1,z = 1},
{x = 2,y = 2,z = 2},
{x = 3,y = 3,z = 3}
}
``````

Ok thanks This will help me learn to script a lot more thanks

Where it says Citizen.trace("Buttonâ€¦)
Under that is where i put what i want it to do right?

Yes. It is where you would put your code.