Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Player Chams
- int ChamsStyle = Menu::Window.VisualsTab.ckOptionsChams.GetIndex();
- int HandsStyle = Menu::Window.VisualsTab.OtherNoHands.GetIndex();
- if (ChamsStyle != 0 && Menu::Window.VisualsTab.FiltersPlayers.GetState() && strstr(ModelName, "models/player")) if (ChamsStyle != 0 && Menu::Window.VisualsTab.FiltersPlayers.GetState() && strstr(ModelName, "models/player"))
- {
- if (pLocal)
- {
- IMaterial *covered = ChamsStyle == 1 ? CoveredLit : CoveredFlat;
- IMaterial *open = ChamsStyle == 1 ? OpenLit : OpenFlat;
- IClientEntity* pModelEntity = (IClientEntity*)Interfaces::EntList->GetClientEntity(pInfo.entity_index);
- if (pModelEntity)
- {
- IClientEntity *local = Interfaces::EntList->GetClientEntity(Interfaces::Engine->GetLocalPlayer());
- if (local)
- {
- if (Menu::Window.VisualsTab.FiltersEnemiesOnly.GetState() && pModelEntity->GetTeamNum() == local->GetTeamNum())
- {
- }
- else
- {
- if (pModelEntity->IsAlive() && pModelEntity->GetHealth() > 0 /*&& pModelEntity->GetTeamNum() != local->GetTeamNum()*/)
- {
- float alpha = 1.f;
- if (pModelEntity->HasGunGameImmunity())
- alpha = 0.5f;
- if (pModelEntity->GetTeamNum() == 2)
- {
- flColor[0] = Menu::Window.ColorsTab.TColorNoVisR.GetValue() / 255.f;
- flColor[1] = Menu::Window.ColorsTab.TColorNoVisG.GetValue() / 255.f;
- flColor[2] = Menu::Window.ColorsTab.TColorNoVisB.GetValue() / 255.f;
- }
- else
- {
- flColor[0] = Menu::Window.ColorsTab.CTColorNoVisR.GetValue() / 255.f;
- flColor[1] = Menu::Window.ColorsTab.CTColorNoVisG.GetValue() / 255.f;
- flColor[2] = Menu::Window.ColorsTab.CTColorNoVisB.GetValue() / 255.f;
- }
- Interfaces::RenderView->SetColorModulation(flColor);
- Interfaces::RenderView->SetBlend(alpha);
- Interfaces::ModelRender->ForcedMaterialOverride(covered);
- oDrawModelExecute(thisptr, ctx, state, pInfo, pCustomBoneToWorld);
- if (pModelEntity->GetTeamNum() == 2)
- {
- flColor[0] = Menu::Window.ColorsTab.TColorVisR.GetValue() / 255.f;
- flColor[1] = Menu::Window.ColorsTab.TColorVisG.GetValue() / 255.f;
- flColor[2] = Menu::Window.ColorsTab.TColorVisB.GetValue() / 255.f;
- }
- else
- {
- flColor[0] = Menu::Window.ColorsTab.CTColorVisR.GetValue() / 255.f;
- flColor[1] = Menu::Window.ColorsTab.CTColorVisG.GetValue() / 255.f;
- flColor[2] = Menu::Window.ColorsTab.CTColorVisB.GetValue() / 255.f;
- }
- Interfaces::RenderView->SetColorModulation(flColor);
- Interfaces::RenderView->SetBlend(alpha);
- Interfaces::ModelRender->ForcedMaterialOverride(open);
- }
- else
- {
- color.SetColor(255, 255, 255, 255);
- ForceMaterial(color, open);
- }
- }
- }
- }
- }
- }
- else if (HandsStyle != 0 && strstr(ModelName, "arms"))
- {
- if (HandsStyle == 1)
- {
- DontDraw = true;
- }
- else if (HandsStyle == 2)
- {
- Interfaces::RenderView->SetBlend(0.3);
- }
- else if (HandsStyle == 3)
- {
- IMaterial *covered = ChamsStyle == 1 ? CoveredLit : CoveredFlat;
- IMaterial *open = ChamsStyle == 1 ? OpenLit : OpenFlat;
- if (pLocal)
- {
- if (pLocal->IsAlive())
- {
- int alpha = pLocal->HasGunGameImmunity() ? 150 : 255;
- if (pLocal->GetTeamNum() == 2)
- color.SetColor(240, 30, 255, 255);
- else
- color.SetColor(63, 72, 255, 255);
- ForceMaterial(color, covered);
- oDrawModelExecute(thisptr, ctx, state, pInfo, pCustomBoneToWorld);
- if (pLocal->GetTeamNum() == 2)
- color.SetColor(247, 180, 255, 255);
- else
- color.SetColor(32, 180, 255, 255);
- }
- else
- {
- color.SetColor(255, 255, 255, 255);
- }
- ForceMaterial(color, open);
- }
- }
- else
- {
- static int counter = 0;
- static float colors[3] = { 1.f, 0.f, 0.f };
- if (colors[counter] >= 1.0f)
- {
- colors[counter] = 1.0f;
- counter += 1;
- if (counter > 2)
- counter = 0;
- }
- else
- {
- int prev = counter - 1;
- if (prev < 0) prev = 2;
- colors[prev] -= 0.05f;
- colors[counter] += 0.05f;
- }
- Interfaces::RenderView->SetColorModulation(colors);
- Interfaces::RenderView->SetBlend(0.3);
- Interfaces::ModelRender->ForcedMaterialOverride(OpenLit);
- }
- }
- else if (ChamsStyle != 0 && Menu::Window.VisualsTab.FiltersWeapons.GetState() && strstr(ModelName, "_dropped.mdl"))
- {
- IMaterial *covered = ChamsStyle == 1 ? CoveredLit : CoveredFlat;
- color.SetColor(255, 255, 255, 255);
- ForceMaterial(color, covered);
- }
- if (!DontDraw)
- oDrawModelExecute(thisptr, ctx, state, pInfo, pCustomBoneToWorld);
- Interfaces::ModelRender->ForcedMaterialOverride(NULL);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement