Dania_gg
Customer
- Регистрация
- 17 Авг 2024
- Сообщения
- 77
- Тема Автор
- #1
кому надо держите, бывает ловит идеальный тайминг самое удачное у меня было 10 прыжков)
local ffi = require("ffi")
ffi.cdef[[
short GetAsyncKeyState(int vKey);
]]
local function is_key_pressed(vKey)
return bit.band(ffi.C.GetAsyncKeyState(vKey), 0x8000) ~= 0
end
local last_z_pos = 0
local last_velocity_z = 0
local frames_since_peak = 0
local jump_cooldown = 0
local function bhop_handler()
local player_controller = entitylist.get_local_player_controller()
if not player_controller then return end
local pawn = player_controller.m_hPlayerPawn
if not pawn or not pawn.m_vecAbsVelocity then return end
local current_z = pawn.m_pGameSceneNode.m_vecAbsOrigin.z
local velocity_z = pawn.m_vecAbsVelocity.z
local flags = pawn.m_fFlags
local about_to_land = false
if velocity_z > 0 and velocity_z > last_velocity_z and current_z - last_z_pos < 2 then
frames_since_peak = frames_since_peak + 1
if frames_since_peak > 2 and velocity_z > 100 then
about_to_land = true
end
else
frames_since_peak = 0
end
local on_ground = bit.band(flags, 1) ~= 0
if jump_cooldown > 0 then
jump_cooldown = jump_cooldown - 1
end
if is_key_pressed(0x20) then
if (on_ground or about_to_land) and jump_cooldown == 0 then
engine.execute_client_cmd("+jump")
jump_cooldown = 2
else
engine.execute_client_cmd("-jump")
end
else
engine.execute_client_cmd("-jump")
end
last_velocity_z = velocity_z
last_z_pos = current_z
end
register_callback("paint", bhop_handler)
print("HIVRIWARE.lua best <3")
register_callback("unload", function()
engine.execute_client_cmd("-jump")
print("script unloaded")
end)
local ffi = require("ffi")
ffi.cdef[[
short GetAsyncKeyState(int vKey);
]]
local function is_key_pressed(vKey)
return bit.band(ffi.C.GetAsyncKeyState(vKey), 0x8000) ~= 0
end
local last_z_pos = 0
local last_velocity_z = 0
local frames_since_peak = 0
local jump_cooldown = 0
local function bhop_handler()
local player_controller = entitylist.get_local_player_controller()
if not player_controller then return end
local pawn = player_controller.m_hPlayerPawn
if not pawn or not pawn.m_vecAbsVelocity then return end
local current_z = pawn.m_pGameSceneNode.m_vecAbsOrigin.z
local velocity_z = pawn.m_vecAbsVelocity.z
local flags = pawn.m_fFlags
local about_to_land = false
if velocity_z > 0 and velocity_z > last_velocity_z and current_z - last_z_pos < 2 then
frames_since_peak = frames_since_peak + 1
if frames_since_peak > 2 and velocity_z > 100 then
about_to_land = true
end
else
frames_since_peak = 0
end
local on_ground = bit.band(flags, 1) ~= 0
if jump_cooldown > 0 then
jump_cooldown = jump_cooldown - 1
end
if is_key_pressed(0x20) then
if (on_ground or about_to_land) and jump_cooldown == 0 then
engine.execute_client_cmd("+jump")
jump_cooldown = 2
else
engine.execute_client_cmd("-jump")
end
else
engine.execute_client_cmd("-jump")
end
last_velocity_z = velocity_z
last_z_pos = current_z
end
register_callback("paint", bhop_handler)
print("HIVRIWARE.lua best <3")
register_callback("unload", function()
engine.execute_client_cmd("-jump")
print("script unloaded")
end)