Get GPS waypoint coords

I know that you can set the GPS using SetNewWaypoint(x, y), but is there any way to get the current gps waypoint?

    local blip = GetFirstBlipInfoId(8)
    local blipX = 0.0
    local blipY = 0.0
    
    if (blip ~= 0) then
        local coord = GetBlipCoords(blip)
        blipX = coord.x
        blipY = coord.y
    end

Some code I’ve used to get the coords of it.

6 Likes

hey hey,

i tried it but it give me an error
it says i try to index a number value if i want to access to coord.y

GetBlipCoords(blip) didnt give back vector3

@Heady20006 Try This:

if GetFirstBlipInfoId( 8 ) ~= 0 then
	
	local waypointBlip = GetFirstBlipInfoId( 8 ) 
	local coord = Citizen.InvokeNative( 0xFA7C7F0AADF25D09, waypointBlip, Citizen.ResultAsVector( ) ) 
	local x  = coord.x
	local y = coord.y
	local z = coord.z
		
else
	
	-- There are no waypoint! 
	
end
2 Likes

thx. already found it :wink:
but thx for sharing the right way