function go_to_point(point, is_sprint)
local dist
repeat
set_camera_direction(point)
wait(0)
setGameKeyState(1, -255)
local mx, my, mz = getCharCoordinates(playerPed)
if is_sprint then
setGameKeyState(16, 255)
end
dist = getDistanceBetweenCoords2d(point.x, point.y, mx, my)
if dist < 0.6 then
pressEnterKey()
end
until dist < 0.6
end
function set_camera_direction(point)
local c_pos_x, c_pos_y, c_pos_z = getActiveCameraCoordinates()
local vect = {
x = point.x - c_pos_x,
y = point.y - c_pos_y
}
local ax = math.atan2(vect.y, -vect.x)
setCameraPositionUnfixed(0.0, -ax)
end