Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.72 KB | None | 0 0
  1. // Player Chams
  2. int ChamsStyle = Menu::Window.VisualsTab.ckOptionsChams.GetIndex();
  3. int HandsStyle = Menu::Window.VisualsTab.OtherNoHands.GetIndex();
  4. if (ChamsStyle != 0 && Menu::Window.VisualsTab.FiltersPlayers.GetState() && strstr(ModelName, "models/player")) if (ChamsStyle != 0 && Menu::Window.VisualsTab.FiltersPlayers.GetState() && strstr(ModelName, "models/player"))
  5. {
  6. if (pLocal)
  7. {
  8.  
  9. IMaterial *covered = ChamsStyle == 1 ? CoveredLit : CoveredFlat;
  10. IMaterial *open = ChamsStyle == 1 ? OpenLit : OpenFlat;
  11.  
  12. IClientEntity* pModelEntity = (IClientEntity*)Interfaces::EntList->GetClientEntity(pInfo.entity_index);
  13. if (pModelEntity)
  14. {
  15. IClientEntity *local = Interfaces::EntList->GetClientEntity(Interfaces::Engine->GetLocalPlayer());
  16. if (local)
  17. {
  18. if (Menu::Window.VisualsTab.FiltersEnemiesOnly.GetState() && pModelEntity->GetTeamNum() == local->GetTeamNum())
  19. {
  20.  
  21. }
  22. else
  23. {
  24. if (pModelEntity->IsAlive() && pModelEntity->GetHealth() > 0 /*&& pModelEntity->GetTeamNum() != local->GetTeamNum()*/)
  25. {
  26. float alpha = 1.f;
  27.  
  28. if (pModelEntity->HasGunGameImmunity())
  29. alpha = 0.5f;
  30.  
  31. if (pModelEntity->GetTeamNum() == 2)
  32. {
  33. flColor[0] = Menu::Window.ColorsTab.TColorNoVisR.GetValue() / 255.f;
  34. flColor[1] = Menu::Window.ColorsTab.TColorNoVisG.GetValue() / 255.f;
  35. flColor[2] = Menu::Window.ColorsTab.TColorNoVisB.GetValue() / 255.f;
  36. }
  37. else
  38. {
  39. flColor[0] = Menu::Window.ColorsTab.CTColorNoVisR.GetValue() / 255.f;
  40. flColor[1] = Menu::Window.ColorsTab.CTColorNoVisG.GetValue() / 255.f;
  41. flColor[2] = Menu::Window.ColorsTab.CTColorNoVisB.GetValue() / 255.f;
  42. }
  43.  
  44. Interfaces::RenderView->SetColorModulation(flColor);
  45. Interfaces::RenderView->SetBlend(alpha);
  46. Interfaces::ModelRender->ForcedMaterialOverride(covered);
  47. oDrawModelExecute(thisptr, ctx, state, pInfo, pCustomBoneToWorld);
  48.  
  49. if (pModelEntity->GetTeamNum() == 2)
  50. {
  51. flColor[0] = Menu::Window.ColorsTab.TColorVisR.GetValue() / 255.f;
  52. flColor[1] = Menu::Window.ColorsTab.TColorVisG.GetValue() / 255.f;
  53. flColor[2] = Menu::Window.ColorsTab.TColorVisB.GetValue() / 255.f;
  54. }
  55. else
  56. {
  57. flColor[0] = Menu::Window.ColorsTab.CTColorVisR.GetValue() / 255.f;
  58. flColor[1] = Menu::Window.ColorsTab.CTColorVisG.GetValue() / 255.f;
  59. flColor[2] = Menu::Window.ColorsTab.CTColorVisB.GetValue() / 255.f;
  60. }
  61.  
  62. Interfaces::RenderView->SetColorModulation(flColor);
  63. Interfaces::RenderView->SetBlend(alpha);
  64. Interfaces::ModelRender->ForcedMaterialOverride(open);
  65. }
  66. else
  67. {
  68. color.SetColor(255, 255, 255, 255);
  69. ForceMaterial(color, open);
  70. }
  71. }
  72. }
  73. }
  74. }
  75. }
  76. else if (HandsStyle != 0 && strstr(ModelName, "arms"))
  77. {
  78. if (HandsStyle == 1)
  79. {
  80. DontDraw = true;
  81. }
  82. else if (HandsStyle == 2)
  83. {
  84. Interfaces::RenderView->SetBlend(0.3);
  85. }
  86. else if (HandsStyle == 3)
  87. {
  88. IMaterial *covered = ChamsStyle == 1 ? CoveredLit : CoveredFlat;
  89. IMaterial *open = ChamsStyle == 1 ? OpenLit : OpenFlat;
  90. if (pLocal)
  91. {
  92. if (pLocal->IsAlive())
  93. {
  94. int alpha = pLocal->HasGunGameImmunity() ? 150 : 255;
  95.  
  96. if (pLocal->GetTeamNum() == 2)
  97. color.SetColor(240, 30, 255, 255);
  98. else
  99. color.SetColor(63, 72, 255, 255);
  100.  
  101. ForceMaterial(color, covered);
  102. oDrawModelExecute(thisptr, ctx, state, pInfo, pCustomBoneToWorld);
  103.  
  104. if (pLocal->GetTeamNum() == 2)
  105. color.SetColor(247, 180, 255, 255);
  106. else
  107. color.SetColor(32, 180, 255, 255);
  108. }
  109. else
  110. {
  111. color.SetColor(255, 255, 255, 255);
  112. }
  113.  
  114. ForceMaterial(color, open);
  115. }
  116. }
  117. else
  118. {
  119. static int counter = 0;
  120. static float colors[3] = { 1.f, 0.f, 0.f };
  121.  
  122. if (colors[counter] >= 1.0f)
  123. {
  124. colors[counter] = 1.0f;
  125. counter += 1;
  126. if (counter > 2)
  127. counter = 0;
  128. }
  129. else
  130. {
  131. int prev = counter - 1;
  132. if (prev < 0) prev = 2;
  133. colors[prev] -= 0.05f;
  134. colors[counter] += 0.05f;
  135. }
  136.  
  137. Interfaces::RenderView->SetColorModulation(colors);
  138. Interfaces::RenderView->SetBlend(0.3);
  139. Interfaces::ModelRender->ForcedMaterialOverride(OpenLit);
  140. }
  141. }
  142. else if (ChamsStyle != 0 && Menu::Window.VisualsTab.FiltersWeapons.GetState() && strstr(ModelName, "_dropped.mdl"))
  143. {
  144. IMaterial *covered = ChamsStyle == 1 ? CoveredLit : CoveredFlat;
  145. color.SetColor(255, 255, 255, 255);
  146. ForceMaterial(color, covered);
  147. }
  148.  
  149.  
  150. if (!DontDraw)
  151. oDrawModelExecute(thisptr, ctx, state, pInfo, pCustomBoneToWorld);
  152. Interfaces::ModelRender->ForcedMaterialOverride(NULL);
  153. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement