-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Может кому нужен.
Код:
void PerformNightmode()
{
static bool bPerformed = false, bLastSetting;
C_BasePlayer* pLocal = CSGO::EntList->GetClientEntity(CSGO::Engine->GetLocalPlayer());
static ConVar* sv_skyname = CSGO::CVar->FindVar("sv_skyname");
sv_skyname->nFlags &= ~FCVAR_CHEAT; // something something dont force convars
if(!pLocal || !CSGO::Engine->IsConnected() || !CSGO::Engine->IsInGame())
return;
if(!bPerformed)
{
for(auto i = CSGO::MaterialSystem->FirstMaterial(); i != CSGO::MaterialSystem->InvalidMaterial(); i = CSGO::MaterialSystem->NextMaterial(i))
{
static IMaterial* pMaterial = CSGO::MaterialSystem->GetMaterial(i);
if(!pMaterial || pMaterial->IsErrorMaterial())
continue;
if(strstr((pMaterial->GetTextureGroupName(), "World") || strstr(pMaterial->GetTextureGroupName(), "StaticProp"))
{
if(bLastSetting)
{
sv_skyname->SetValue("sky_csgo_night02");
pMaterial->SetMaterialVarFlag(MATERIAL_VAR_TRANSLUCENT, false); // walls were translucent for me for some odd reason, probably p100 codenz :/
pMaterial->ColorModulate(0.15, 0.15, 0.15);
}
else
{
sv_skyname->SetValue("vertigoblue_hdr"); // fixme: i was too lazy to backup old value
pMaterial->ColorModulate(1.00, 1.00, 1.00);
}
}
}
}
if(bLastSetting != Settings::bVisualNightmode)
{
bLastSetting = Settings::bVisualNightmode;
}
}