Event on player location / Marker

is there any way of me opening a menu if a player is in a location?
like a marker ?

Yes by using Native.UI or using any menu addition here on the forums or writing one yourself.

i alredy built the menu just cant realize how to trigger it when someone is in a location :confused:

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
				if IsControlJustPressed(1,51) then -- "E"
					do something
				end
            end
        end
    end
end)
1 Like

I know this might be a stretch with it being several years since this topic has been discussed, but I have a question.

I tried the code you provided and I keep getting an error with the part of the code

				do something
			end

I get a syntax error for the end part.