Вопрос [NL] Zero Pitch crash

Начинающий
Статус
Оффлайн
Регистрация
5 Янв 2023
Сообщения
88
Реакции[?]
10
Поинты[?]
0
Всем ку, суть в том что крашит при активации zero pitch on land.
Как мне сказали на соседнем форуме, возможная проблема в lp(localplayer), но суть в том что Static legs in Air работают исправно.
 
Эксперт
Статус
Оффлайн
Регистрация
24 Апр 2018
Сообщения
1,468
Реакции[?]
909
Поинты[?]
42K
Начинающий
Статус
Оффлайн
Регистрация
5 Янв 2023
Сообщения
88
Реакции[?]
10
Поинты[?]
0
Ой, да, запамятовал

code_language.lua:
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)
Укажите мне на ошибку плиз
 
Последнее редактирование:
Начинающий
Статус
Оффлайн
Регистрация
24 Ноя 2020
Сообщения
13
Реакции[?]
1
Поинты[?]
0
Oh yes, I forgot

code_language.lua:
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)
Point me to the mistake plz
local m_flPoseParameter = local_player.m_flPoseParameter

m_flPoseParameter[12] = 0.5
 
Сверху Снизу