local targetPosition = { 0, 0, 0 } -- позиция, куда надо попасть
local step = 20 -- расстояние между точками
local x, y, z = getCharCoordinates(playerPed)
local angle = math.rad(getHeadingFromVector2d(targetPosition[1] - x, targetPosition[2] - y))
while getDistanceBeetweenCoords3d(x, y, z, table.unpack(targetPosition)) > step do
local data = samp_create_sync_data("player")
data.position.x = x + step * math.cos(angle)
data.position.y = y + step * math.sin(angle)
data.position.z = -5 -- значение, насколько утопится в землю
x, y, z = data.position.x, data.position.y, data.position.z
data.send()
wait(1000) -- задержка между телепортами
end
setCharCoordinates(playerPed, table.unpack(targetPosition))