Вопрос Removing agent patches

Начинающий
Статус
Оффлайн
Регистрация
3 Май 2021
Сообщения
8
Реакции[?]
0
Поинты[?]
0
I'm having a problem at the time of rendering chams on players who have patches in their agents.
I've looked in uc and some other sites and this is the only fix i found
C++:
// The function where the magic should occur
// I'm calling this on fsn (I've tried with FRAME_RENDER_START and FRAME_NET_UPDATE_END)
void misc::remove_agent_patches()
{
    if (g_cfg.player.enable)
        return;

    if (!g_cfg.player.type[ENEMY].chams_enable && !g_cfg.player.type[TEAM].chams_enable && !g_cfg.player.type[LOCAL].chams_enable)
        return;

    for (size_t i = 1; i <= m_engine()->GetMaxClients(); i++)
    {
        player_t* player = (player_t*)m_entitylist()->GetClientEntity(i);

        if (!player->is_alive())
            continue;

        for (size_t k = 0; k < 5; k++)
        {
            player->m_vecPlayerPatchEconIndices()[k] = NULL;
        }
    }
}
C++:
// The definition of m_vecPlayerPatchEconIndices
NETVAR(Vector, m_vecPlayerPatchEconIndices, crypt_str("DT_CSPlayer"), crypt_str("m_vecPlayerPatchEconIndices"));
Well, i wouldn't call it a fix 'cus still not working.
If someone could tell me the reason of why it's not working or any solution it'd be appreaciated :D
 
Пользователь
Статус
Оффлайн
Регистрация
3 Июл 2019
Сообщения
137
Реакции[?]
77
Поинты[?]
2K
hooked_fsn.cpp (call this in FRAME_RENDER_START)
C++:
void remove_player_patches()
{
    if (g_cfg.player.enable && (g_cfg.player.type[ENEMY].chams[PLAYER_CHAMS_VISIBLE] ||
        g_cfg.player.type[TEAM].chams[PLAYER_CHAMS_VISIBLE] ||
        g_cfg.player.backtrack_chams
        )) {

        for (auto i = 1; i < m_globals()->m_maxclients; i++)
        {
            auto e = (player_t*)m_entitylist()->GetClientEntity(i);

            if (!e->valid(false, false))
                continue;

            for (size_t patchIndex = 0; patchIndex < 5; patchIndex++)
            {
                e->m_vecPlayerPatchEconIndices()[patchIndex] = Vector(0, 0, 0);
            }
        }
    }
}
structs.cpp
C++:
std::array<Vector, 5>& player_t::m_vecPlayerPatchEconIndices()
{
    static int _m_vecPlayerPatchEconIndices = netvars::get().get_offset(crypt_str("CCSPlayer"), crypt_str("m_vecPlayerPatchEconIndices"));
    return *(std::array<Vector, 5>*)((uintptr_t)this + _m_vecPlayerPatchEconIndices);
}
and there is something wrong with your code

if (g_cfg.player.enable) return;
why is this?

and.
if (!g_cfg.player.type[ENEMY].chams_enable && !g_cfg.player.type[TEAM].chams_enable && !g_cfg.player.type[LOCAL].chams_enable) return;
i think this operators "&&" should be changed to "||"
 
Сверху Снизу