Help With DrawMarker


#1

Marker vanishes when I walk into it. How can I fix that?

local circleplacement = {
{[‘x’] = 1181.5, [‘y’] = 2652.46, [‘z’] = 37.8099}
}

incircle = false
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local pos = GetEntityCoords(GetPlayerPed(-1), true)
for k,v in ipairs(circleplacement) do
if(Vdist(pos.x, pos.y, pos.z, v.x, v.y, v.z) < 15.0)then
DrawMarker(1, v.x, v.y, v.z - 1, 0, 0, 0, 0, 0, 0, 1.0001, 1.0001, 1.5001, 1555, 0, 0,165, 0, 0, 0,0)
if(Vdist(pos.x, pos.y, pos.z, v.x, v.y, v.z) < 1.0)then
if (incircle == false) then
DisplayHelpText(“Click ~INPUT_CONTEXT~ To Do Something”)
end
incircle = true
if IsControlJustReleased(1, 51) then
ShowNotification(“This is Something”)
end
elseif(Vdist(pos.x, pos.y, pos.z, v.x, v.y, v.z) > 1.0)then
incircle = false
end
end
end
end
end)


#2
local table = {
    {x = -104.919,y = 6476.06,z = 31.6267}
}

Citizen.CreateThread(function()
    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)

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)

        for k in pairs(table) do

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

            if dist <= 1.2 then
				DrawText3("Press E To Do Something")
				if IsControlJustPressed(1,51) then
					do something
				end
            end
        end
    end
end)

#3

Thank you @Scott_UK, You are the man.


#4

You need to make the function for DrawText btw that’s just something from a previous script I made :wink:


#5

Yeah I managed to do that. Works great!