hooked_function = nil
ground_ticks, end_time = 1, 0
function updateCSA_hk(thisptr, edx)
if entity.get_local_player() == nil or ffi.cast('uintptr_t', thisptr) == nil then return end
local local_player = entity.get_local_player()
local lp_ptr = get_entity_address(local_player:get_index())
if animbreakers:get("Leg breaker") then
ffi.cast('float*', lp_ptr+10104)[0] = 1
ref.legmovement:set('Sliding')
end
if animbreakers:get("Zero pitch on land") then
ffi.cast('float*', lp_ptr+10104)[12] = 0
end
hooked_function(thisptr, edx)
if animbreakers:get("Static legs in air") then
ffi.cast('float*', lp_ptr+10104)[6] = 1
end
if animbreakers:get("Zero pitch on land") then
if bit.band(entity.get_local_player()["m_fFlags"], 1) == 1 then
ground_ticks = ground_ticks + 1
else
ground_ticks = 0
end_time = globals.curtime + 1
end
if not in_air() and ground_ticks > 1 and end_time > globals.curtime then
ffi.cast('float*', lp_ptr+10104)[12] = 0.5
end
end
end
function anim_state_hook()
local local_player = entity.get_local_player()
if not local_player then return end
local local_player_ptr = get_entity_address(local_player:get_index())
if not local_player_ptr or hooked_function then return end
local C_CSPLAYER = vmt_hook.new(local_player_ptr)
hooked_function = C_CSPLAYER.hookMethod('void(__fastcall*)(void*, void*)', updateCSA_hk, 224)
end
events.createmove_run:set(anim_state_hook)