- 129
- 14
- Версия MoonLoader
- .026-beta
Включается сам по себе AirBrake после запуска скрипта
Lua:
function main()
AirBrake()
while true do
wait(0)
end
end
Lua:
function AirBrake()
local p = {x = 0, y = 0, z = 0}
local pedX, pedY, pedZ = getCharCoordinates(PLAYER_PED)
p.x, p.y, p.z = pedX, pedY, pedZ
local speed = 0.3
lua_thread.create(function()
while true do
wait(0)
if wasKeyPressed(VK_RSHIFT) then
airbrake_settings.airbrake_state = not airbrake_settings.airbrake_state
local pedX, pedY, pedZ = getCharCoordinates(PLAYER_PED)
p.x, p.y, p.z = pedX, pedY, pedZ
printStyledString('~n~~n~~n~~n~~n~~n~~y~AIRBRAKE: '..(airbrake_settings.airbrake_state and '~g~ON' or '~r~OFF'), 1500, 5)
end
if airbrake_settings.airbrake_state then
if not sampIsCursorActive() then
-- SPEED EDITOR
local speedEdit = getMousewheelDelta()
if speedEdit ~= 0 then
if speed >= 0 then
speed = speed + speedEdit / 10
printStringNow('~y~AIRBRAKE: ~w~Speed = ~r~'..speed, 2000)
end
end
if speed < 0 then speed = 0 end
-- SET MOUSE HEADING
local cx, cy, _ = getActiveCameraCoordinates()
local px, py, _ = getActiveCameraPointAt()
local camDirection = math.atan2( (px-cx), (py-cy) ) * 180 / math.pi
if isCharInAnyCar(PLAYER_PED) then
setCarHeading(storeCarCharIsInNoSave(PLAYER_PED), - camDirection)
else
setCharHeading(PLAYER_PED, - camDirection)
end
-- CONTROLS
if isKeyDown(VK_SPACE) then
p.z = p.z + speed / 2
end
if isKeyDown(VK_LSHIFT) and p.z > -95.0 then
p.z = p.z - speed / 2
end
if isKeyDown(VK_W) then
p.x = p.x + speed * math.sin(-math.rad(getCharHeading(PLAYER_PED)))
p.y = p.y + speed * math.cos(-math.rad(getCharHeading(PLAYER_PED)))
end
if isKeyDown(VK_S) then
p.x = p.x - speed * math.sin(-math.rad(getCharHeading(PLAYER_PED)))
p.y = p.y - speed * math.cos(-math.rad(getCharHeading(PLAYER_PED)))
end
if isKeyDown(VK_A) then
p.x = p.x - air_brk_getAngle(speed)[1]
p.y = p.y - air_brk_getAngle(speed)[2]
end
if isKeyDown(VK_D) then
p.x = p.x + air_brk_getAngle(speed)[1]
p.y = p.y + air_brk_getAngle(speed)[2]
end
end
setCharCoordinates(PLAYER_PED, p.x, p.y, p.z)
end
end
end)
end