Как сделать распределение на визибл/анвизибл?

Участник
Статус
Оффлайн
Регистрация
11 Апр 2019
Сообщения
1,117
Реакции[?]
306
Поинты[?]
4K
сделал я чамсы, но не могу сделать распределение на визибл/анвизибл. что делать я тупой
C++:
            if (IsEnemy) {

                if (c_config::get().enemychamss)
                {
                    auto local_player = g_pEntityList->GetClientEntity(g_pEngine->GetLocalPlayer());
                    switch (c_config::get().enemymat)
                    {
                    case 0:
                        break;
                    case 1:

                        static IMaterial * Glow = g_pMaterialSys->FindMaterial("models/inventory_items/music_kit/darude_01/mp3_detail", TEXTURE_GROUP_MODEL);
                        if (!Glow)
                            return;

                        Glow->AlphaModulate(c_config::get().vischamsz / 255.f);
                        g_pModelRender->ForcedMaterialOverride(Glow);
                        g_pRenderView->SetColorModulation(c_config::get().enemychamsvis);
                        pPlayerEntity->DrawModel(0x1, pPlayerEntity->GetModelInstance());
                        g_pModelRender->ForcedMaterialOverride(nullptr);
                        //models/inventory_items/music_kit/darude_01/mp3_detail
                        break;
                    case 2:

                        static IMaterial * Flat = g_pMaterialSys->FindMaterial("Flat.vmt", TEXTURE_GROUP_MODEL);
                        if (!Flat)
                            return;

                        Flat->AlphaModulate(c_config::get().vischamsz / 255.f);
                        g_pModelRender->ForcedMaterialOverride(Flat);
                        g_pRenderView->SetColorModulation(c_config::get().enemychamsvis);
                        pPlayerEntity->DrawModel(0x1, pPlayerEntity->GetModelInstance());
                        g_pModelRender->ForcedMaterialOverride(nullptr);

                        break;
                    case 3:

                        static IMaterial * Glass = g_pMaterialSys->FindMaterial("models/inventory_items/cologne_prediction/cologne_prediction_glass", TEXTURE_GROUP_MODEL);
                        if (!Glass)
                            return;

                        Glass->AlphaModulate(c_config::get().vischamsz / 255.f);
                        g_pModelRender->ForcedMaterialOverride(Glass);
                        g_pRenderView->SetColorModulation(c_config::get().enemychamsvis);
                        pPlayerEntity->DrawModel(0x1, pPlayerEntity->GetModelInstance());
                        g_pModelRender->ForcedMaterialOverride(nullptr);

                        break;
                    case 4:

                        static IMaterial * CrystalBlue = g_pMaterialSys->FindMaterial("models/inventory_items/trophy_majors/crystal_blue", TEXTURE_GROUP_MODEL);
                        if (!CrystalBlue)
                            return;

                        CrystalBlue->AlphaModulate(c_config::get().vischamsz / 255.f);
                        g_pModelRender->ForcedMaterialOverride(CrystalBlue);
                        g_pRenderView->SetColorModulation(c_config::get().enemychamsvis);
                        pPlayerEntity->DrawModel(0x1, pPlayerEntity->GetModelInstance());
                        g_pModelRender->ForcedMaterialOverride(nullptr);

                        break;

                    case 5:

                        static IMaterial * dogdag = g_pMaterialSys->FindMaterial("models/inventory_items/dogtags/dogtags_outline", TEXTURE_GROUP_MODEL);
                        if (!dogdag)
                            return;

                        dogdag->AlphaModulate(c_config::get().vischamsz / 255.f);
                        g_pModelRender->ForcedMaterialOverride(dogdag);
                        g_pRenderView->SetColorModulation(c_config::get().enemychamsvis);
                        pPlayerEntity->DrawModel(0x1, pPlayerEntity->GetModelInstance());
                        g_pModelRender->ForcedMaterialOverride(nullptr);

                        break;
                    }

                    if (!pPlayerEntity)
                        continue;


                    for (auto i = 0; i < g_GlowManager->GetSize(); i++)
                    {
                        auto& glowObject = g_GlowManager->m_GlowObjectDefinitions[i];
                        auto entity = reinterpret_cast<C_BaseEntity*>(glowObject.m_pEntity);
                        auto m_pLocalPlayer = reinterpret_cast<C_BaseEntity*>(g_pEntityList->GetClientEntity(g_pEngine->GetLocalPlayer()));

                        if (!pPlayerEntity)
                            continue;

                        if (!m_pLocalPlayer)
                            continue;

                        if (glowObject.IsUnused())
                            continue;

                        bool is_local_player = entity == m_pLocalPlayer;
                        bool is_teammate = m_pLocalPlayer->GetTeam() == entity->GetTeam() && !is_local_player;
                        bool IsEnemy = entity->GetTeam() != m_pLocalPlayer->GetTeam();

                        if (is_local_player) {
                            if (c_config::get().local_glow && c_config::get().chamsscopeent && !m_pLocalPlayer->IsScoped()) {
                                auto class_id = entity->GetClientClass()->ClassID;


                                switch (class_id)
                                {
                                default:
                                    glowObject.m_flAlpha = 0.0f;
                                    break;
                                case 40:
                                    glowObject.m_nGlowStyle = 0;
                                    glowObject.m_flAlpha = c_config::get().enemy_glow_color[3] / 255.f;
                                    break;
                                }

                                glowObject.m_flRed = c_config::get().enemy_glow_color[3] / 255.0f;
                                glowObject.m_flGreen = c_config::get().enemy_glow_color[3] / 255.0f;
                                glowObject.m_flBlue = c_config::get().enemy_glow_color[3] / 255.0f;
                                glowObject.m_bRenderWhenOccluded = true;
                                glowObject.m_bRenderWhenUnoccluded = false;



                            }
                        }
                    }
                }
            }
        }
 
Сверху Снизу