function BeginToPoint(x, y, z, radius, move_code, isSprint, isJumping)
repeat
local posX, posY, posZ = getCharCoordinates(PLAYER_PED)
setCameraToCoord(x, y);
MovePlayer(move_code, isSprint, isJumping);
local dist = getDistanceBetweenCoords3d(x, y, z, posX, posY, z);
wait(0)
until not bot.active.v or dist < radius
end
function setCameraToCoord(x, y)
slot2, slot3 = getActiveCameraCoordinates()
setCameraPositionUnfixed(0, (getHeadingFromVector2d(x - slot2, y - slot3) - 90) / 57.2957795)
end
function MovePlayer(move_code, isSprint, isJumping)
setGameKeyState(1, move_code)
--[[255 - обычный бег назад
-255 - обычный бег вперед
65535 - идти шагом вперед
-65535 - идти шагом назад]]
lua_thread.create(function()
if isJumping then
local rand = math.random(0, 9999999);
if rand >= 9909999 then
isSprint = false
setGameKeyState(14, 255);
wait(200)
isSprint = true
end
end
end)
if isSprint then setGameKeyState(16, 255) end
end