Вопрос Chams issue

Пользователь
Статус
Оффлайн
Регистрация
19 Ноя 2019
Сообщения
263
Реакции[?]
50
Поинты[?]
2K
hello, i was working on chams but stumbled upon this problem
1650975984905.png
Invisible chams work just fine but visible simply dont work

heres my code:
Код:
void chams::enemy_chams(hooks::dmefn ofunc, i_mat_render_context* ctx, const draw_model_state_t& state, const model_render_info_t& info, matrix_t* matrix) {

    i_material* material = interfaces::material_system->find_material("debug/debugambientcube", nullptr);

    if (!csgo.local_player)
        return;

    std::string model_name = interfaces::model_info->get_model_name(info.model);

    if (interfaces::model_render->is_material_overrode())
        return ofunc(interfaces::model_render, ctx, state, info, matrix);

    if (model_name.find("models/player") != std::string::npos) {
        auto player = reinterpret_cast<player_t*>(interfaces::entity_list->get_client_entity(info.entity_index));

        if (player && player->is_player() && !player->dormant() && player->is_alive()) {
            if (player->team() != csgo.local_player->team()) {

                float col1[3] = { 0.5f, 0.f, 0.f };
                float col2[3] = { 0.0f, 5.f, 0.f };

                if (sett.visuals.chams_invisible) {
                    material->set_material_var_flag(material_var_ignorez, true);
                    interfaces::render_view->modulate_color(col1);
                    interfaces::model_render->override_material(material);
                    ofunc(interfaces::model_render, ctx, state, info, matrix);
                }

                ofunc(interfaces::model_render, ctx, state, info, matrix);
                interfaces::model_render->override_material(nullptr);

                if (sett.visuals.chams_visible) {
                    material->set_material_var_flag(material_var_ignorez, false);
                    interfaces::render_view->modulate_color(col2);
                    interfaces::model_render->override_material(material);
                    ofunc(interfaces::model_render, ctx, state, info, matrix);
                }
            
            }
        }
    }

    ofunc(interfaces::model_render, ctx, state, info, matrix);
    interfaces::model_render->override_material(nullptr);
}
any help is appreciated
 
Сверху Снизу