Results 1 to 5 of 5
  1. #1
    m0L3cuL3's Avatar
    Join Date
    Jul 2017
    Gender
    male
    Posts
    61
    Reputation
    10
    Thanks
    70
    My Mood
    Aggressive

    Question Nightmode in CSGOSimple

    can someone send me a simple code of nightmode.
    Last edited by T-800; 11-30-2017 at 07:40 AM.

  2. #2
    ClauBurrito's Avatar
    Join Date
    Jul 2016
    Gender
    male
    Posts
    590
    Reputation
    18
    Thanks
    5,463
    put this in visuals.cpp
    Code:
    void visuals::misc::night_mode()
    {
        static float r;
        static float g;
        static float b;
    
        if (g_Options.misc_nightmode.get_bool())
        {
            if (!done)
            {
                char m_szLevelNameShort[65];
                sprintf_s(m_szLevelNameShort, sizeof(m_szLevelNameShort) - 1, "materials_%s.txt", g_ClientState->m_szLevelNameShort);
                auto s = std::ofstream(m_szLevelNameShort);
                std::ostream& stream = s;
                
                static auto sv_skyname = g_CVar->FindVar("sv_skyname");
                static auto r_DrawSpecificStaticProp = g_CVar->FindVar("r_DrawSpecificStaticProp");
                r_DrawSpecificStaticProp->SetValue(1);
                sv_skyname->SetValue("sky_csgo_night02");
    
                for (MaterialHandle_t i = g_MatSystem->FirstMaterial(); i != g_MatSystem->InvalidMaterial(); i = g_MatSystem->NextMaterial(i))
                {
                    IMaterial *pMaterial = g_MatSystem->GetMaterial(i);
    
                    if (!pMaterial)
                        continue;
    
                    const char* group = pMaterial->GetTextureGroupName();
                    const char* name  = pMaterial->GetName();
    
                    stream << name << '\n';
    
    
    
                    if (strstr(group, TEXTURE_GROUP_WORLD))
                    {
                        pMaterial->GetColorModulation(&r, &g, &b);
                        pMaterial->ColorModulate(r * 0.10, g * 0.10, b * 0.10);
                    }
                    if (strstr(group, "StaticProp"))
                    {
                        pMaterial->GetColorModulation(&r, &g, &b);
                        pMaterial->ColorModulate(r * 0.30, g * 0.30, b * 0.30);
                    }
                    if (strstr(name, "models/props/de_dust/palace_bigdome"))
                    {
                        pMaterial->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
                    }
                    if (strstr(name, "models/props/de_dust/palace_pillars"))
                    {
                        pMaterial->GetColorModulation(&r, &g, &b);
                        pMaterial->ColorModulate(r * 0.30, g * 0.30, b * 0.30);
                    }
    
                    if (strstr(group, TEXTURE_GROUP_PARTICLE))
                    {
                        pMaterial->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
                    }
                    done = true;
                }
    
            }
        }
        else
        {
            if (done)
            {
                for (MaterialHandle_t i = g_MatSystem->FirstMaterial(); i != g_MatSystem->InvalidMaterial(); i = g_MatSystem->NextMaterial(i))
                {
                    IMaterial *pMaterial = g_MatSystem->GetMaterial(i);
    
                    if (!pMaterial)
                        continue;
    
                    const char* group = pMaterial->GetTextureGroupName();
                    const char* name = pMaterial->GetName();
    
                    if (strstr(group, TEXTURE_GROUP_WORLD))
                    {
                        pMaterial->GetColorModulation(&r, &g, &b);
                        pMaterial->ColorModulate(r * 10, g * 10, b * 10);
                    }
                    if (strstr(group, "StaticProp"))
                    {
                        pMaterial->GetColorModulation(&r, &g, &b);
                        pMaterial->ColorModulate(r * 3.33335, g * 3.33335, b * 3.33335);
                    }
                    if (strstr(name, "models/props/de_dust/palace_bigdome"))
                    {
                        pMaterial->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, false);
                    }
                    if (strstr(name, "models/props/de_dust/palace_pillars"))
                    {
                        pMaterial->GetColorModulation(&r, &g, &b);
                        pMaterial->ColorModulate(r * 3.33335, g * 3.33335, b * 3.33335);
                    }
                    if (strstr(group, TEXTURE_GROUP_PARTICLE))
                    {
                        pMaterial->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, false);
                    }
                }
                done = false;
            }
    
        }
    }
    and this in visuals.hpp in namespace misc
    Code:
    void night_mode();
    and add this to menu.cpp in misc tab
    Code:
                if (g_Options.misc_nightmode.get_bool() && !g_EngineClient->IsInGame())
                    g_Options.misc_nightmode.set_bool(false);
                ImGui::Checkbox("NightMode       ", &g_Options.misc_nightmode);
    Last edited by ClauBurrito; 11-16-2017 at 08:16 AM.
    I have no interest in cases that I have no interest in.

  3. #3
    m0L3cuL3's Avatar
    Join Date
    Jul 2017
    Gender
    male
    Posts
    61
    Reputation
    10
    Thanks
    70
    My Mood
    Aggressive
    Quote Originally Posted by ClauBurrito View Post
    put this in visuals.cpp
    Code:
    void visuals::misc::night_mode()
    {
        static float r;
        static float g;
        static float b;
    
        if (g_Options.misc_nightmode.get_bool())
        {
            if (!done)
            {
                char m_szLevelNameShort[65];
                sprintf_s(m_szLevelNameShort, sizeof(m_szLevelNameShort) - 1, "materials_%s.txt", g_ClientState->m_szLevelNameShort);
                auto s = std::ofstream(m_szLevelNameShort);
                std::ostream& stream = s;
                
                static auto sv_skyname = g_CVar->FindVar("sv_skyname");
                static auto r_DrawSpecificStaticProp = g_CVar->FindVar("r_DrawSpecificStaticProp");
                r_DrawSpecificStaticProp->SetValue(1);
                sv_skyname->SetValue("sky_csgo_night02");
    
                for (MaterialHandle_t i = g_MatSystem->FirstMaterial(); i != g_MatSystem->InvalidMaterial(); i = g_MatSystem->NextMaterial(i))
                {
                    IMaterial *pMaterial = g_MatSystem->GetMaterial(i);
    
                    if (!pMaterial)
                        continue;
    
                    const char* group = pMaterial->GetTextureGroupName();
                    const char* name  = pMaterial->GetName();
    
                    stream << name << '\n';
    
    
    
                    if (strstr(group, TEXTURE_GROUP_WORLD))
                    {
                        pMaterial->GetColorModulation(&r, &g, &b);
                        pMaterial->ColorModulate(r * 0.10, g * 0.10, b * 0.10);
                    }
                    if (strstr(group, "StaticProp"))
                    {
                        pMaterial->GetColorModulation(&r, &g, &b);
                        pMaterial->ColorModulate(r * 0.30, g * 0.30, b * 0.30);
                    }
                    if (strstr(name, "models/props/de_dust/palace_bigdome"))
                    {
                        pMaterial->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
                    }
                    if (strstr(name, "models/props/de_dust/palace_pillars"))
                    {
                        pMaterial->GetColorModulation(&r, &g, &b);
                        pMaterial->ColorModulate(r * 0.30, g * 0.30, b * 0.30);
                    }
    
                    if (strstr(group, TEXTURE_GROUP_PARTICLE))
                    {
                        pMaterial->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
                    }
                    done = true;
                }
    
            }
        }
        else
        {
            if (done)
            {
                for (MaterialHandle_t i = g_MatSystem->FirstMaterial(); i != g_MatSystem->InvalidMaterial(); i = g_MatSystem->NextMaterial(i))
                {
                    IMaterial *pMaterial = g_MatSystem->GetMaterial(i);
    
                    if (!pMaterial)
                        continue;
    
                    const char* group = pMaterial->GetTextureGroupName();
                    const char* name = pMaterial->GetName();
    
                    if (strstr(group, TEXTURE_GROUP_WORLD))
                    {
                        pMaterial->GetColorModulation(&r, &g, &b);
                        pMaterial->ColorModulate(r * 10, g * 10, b * 10);
                    }
                    if (strstr(group, "StaticProp"))
                    {
                        pMaterial->GetColorModulation(&r, &g, &b);
                        pMaterial->ColorModulate(r * 3.33335, g * 3.33335, b * 3.33335);
                    }
                    if (strstr(name, "models/props/de_dust/palace_bigdome"))
                    {
                        pMaterial->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, false);
                    }
                    if (strstr(name, "models/props/de_dust/palace_pillars"))
                    {
                        pMaterial->GetColorModulation(&r, &g, &b);
                        pMaterial->ColorModulate(r * 3.33335, g * 3.33335, b * 3.33335);
                    }
                    if (strstr(group, TEXTURE_GROUP_PARTICLE))
                    {
                        pMaterial->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, false);
                    }
                }
                done = false;
            }
    
        }
    }
    and this in visuals.hpp in namespace misc
    Code:
    void night_mode();
    and add this to menu.cpp in misc tab
    Code:
                if (g_Options.misc_nightmode.get_bool() && !g_EngineClient->IsInGame())
                    g_Options.misc_nightmode.set_bool(false);
                ImGui::Checkbox("NightMode       ", &g_Options.misc_nightmode);
    Im getting some errors. like g_Options is not defined, done! is not defined. need help thanks in advance.
    https://imgur.com/a/9bGBw
    Last edited by m0L3cuL3; 11-17-2017 at 06:05 AM. Reason: Image Link

  4. The Following User Says Thank You to m0L3cuL3 For This Useful Post:

    ClauBurrito (11-17-2017)

  5. #4
    ClauBurrito's Avatar
    Join Date
    Jul 2016
    Gender
    male
    Posts
    590
    Reputation
    18
    Thanks
    5,463
    Quote Originally Posted by m0L3cuL3 View Post
    Im getting some errors. like g_Options is not defined, done! is not defined. need help thanks in advance.
    https://imgur.com/a/9bGBw
    no problem, im glad i could help you
    I have no interest in cases that I have no interest in.

  6. #5
    m0L3cuL3's Avatar
    Join Date
    Jul 2017
    Gender
    male
    Posts
    61
    Reputation
    10
    Thanks
    70
    My Mood
    Aggressive
    Quote Originally Posted by ClauBurrito View Post


    no problem, im glad i could help you
    can you tell me how to fix class "Config" has no member "Misc"

Tags for this Thread