--тактически спизжено с проджект кавер
require 'moonloader'
local airBrkCoords
local airbrk
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
while true do wait(0)
if wasKeyPressed(VK_1) then
airbrk = not airbrk
posX, posY, posZ = getCharCoordinates(playerPed)
airBrkCoords = {posX, posY, posZ, 0.0, 0.0, getCharHeading(playerPed)}
end
if airbrk then
if isCharInAnyCar(playerPed) then heading = getCarHeading(storeCarCharIsInNoSave(playerPed))
else heading = getCharHeading(playerPed) end
camCoordX, camCoordY, camCoordZ = getActiveCameraCoordinates()
targetCamX, targetCamY, targetCamZ = getActiveCameraPointAt()
angle = getHeadingFromVector2d(targetCamX - camCoordX, targetCamY - camCoordY)
if isCharInAnyCar(playerPed) then difference = 0.79 else difference = 1.0 end
setCharCoordinates(playerPed, airBrkCoords[1], airBrkCoords[2], airBrkCoords[3] - difference)
if isKeyDown(VK_W) then
airBrkCoords[1] = airBrkCoords[1] + 0.5 * math.sin(-math.rad(angle))
airBrkCoords[2] = airBrkCoords[2] + 0.5 * math.cos(-math.rad(angle))
if not isCharInAnyCar(playerPed) then setCharHeading(playerPed, angle)
else setCarHeading(storeCarCharIsInNoSave(playerPed), angle) end
elseif isKeyDown(VK_S) then
airBrkCoords[1] = airBrkCoords[1] - 0.5 * math.sin(-math.rad(heading))
airBrkCoords[2] = airBrkCoords[2] - 0.5 * math.cos(-math.rad(heading))
end
if isKeyDown(VK_A) then
airBrkCoords[1] = airBrkCoords[1] - 0.5 * math.sin(-math.rad(heading - 90))
airBrkCoords[2] = airBrkCoords[2] - 0.5 * math.cos(-math.rad(heading - 90))
elseif isKeyDown(VK_D) then
airBrkCoords[1] = airBrkCoords[1] - 0.5 * math.sin(-math.rad(heading + 90))
airBrkCoords[2] = airBrkCoords[2] - 0.5 * math.cos(-math.rad(heading + 90))
end
if isKeyDown(VK_LSHIFT) then airBrkCoords[3] = airBrkCoords[3] + 0.5 / 2.0 end
if isKeyDown(VK_CONTROL) and airBrkCoords[3] > - 95.0 then airBrkCoords[3] = airBrkCoords[3] - 0.5 / 2.0 end
end
end
end