-
Автор темы
- #1
на 6 строчке крашит игра (не луашка)
code_language.lua:
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("Backward legs") then
ffi.cast('float*', lp_ptr+10104)[0] = 1 --- Если комментирую эту строчку - не крашит
refs.legmovement:set('Sliding')
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)