Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.76 KB | None | 0 0
  1. static auto oSceneEnd = g_Hooks.pRenderViewHook->GetOriginal<SceneEnd_t>(9);
  2. oSceneEnd(ecx);
  3.  
  4. g::pLocalEntity = g_pEntityList->GetClientEntity(g_pEngine->GetLocalPlayer());
  5. if (!g::pLocalEntity)
  6. return;
  7.  
  8. float flColor[3] = { 0.f };
  9. float flColor2[3] = { 0.f };
  10. float flColor3[3] = { 0.f };
  11.  
  12. flColor[0] = 60.f / 255.f;
  13. flColor[1] = 120.f / 255.f;
  14. flColor[2] = 180.f / 255.f;
  15.  
  16. flColor2[0] = 150.f / 255.f;
  17. flColor2[1] = 200.f / 255.f;
  18. flColor2[2] = 60.f / 255.f;
  19.  
  20. flColor3[0] = 255.f / 255.f;
  21. flColor3[1] = 255.f / 255.f;
  22. flColor3[2] = 255.f / 255.f;
  23.  
  24. Color LocalColor = Color(g_Settings.localchamscol, g_Settings.localchamscol[3] * 255);
  25. Color EnemyColor = Color(g_Settings.chamshidden, g_Settings.chamshidden[3] * 255);
  26.  
  27. Color LocalColorXqz = Color(g_Settings.localchamscol, g_Settings.localchamscol[3] * 255);
  28. Color EnemyColorXqz = Color(g_Settings.chamsvisible, g_Settings.chamsvisible[3] * 255);
  29.  
  30. if (!g::pLocalEntity || !g_pEngine->IsInGame())
  31. return;
  32.  
  33. if (!g_pEngine->IsInGame() && !g_pEngine->IsConnected())
  34. return;
  35.  
  36. for (int it = 1; it <= g_pEngine->GetMaxClients(); ++it)
  37. {
  38. C_BaseEntity* pPlayerEntity = g_pEntityList->GetClientEntity(it);
  39.  
  40. if (!pPlayerEntity
  41. || !pPlayerEntity->IsAlive()
  42. || pPlayerEntity->IsDormant())
  43. continue;
  44.  
  45. bool IsLocal = pPlayerEntity == g::pLocalEntity;
  46. bool IsTeam = pPlayerEntity->GetTeam() == g::pLocalEntity->GetTeam();
  47.  
  48. bool normal = false;
  49. bool flat = false;
  50. bool wireframe = false;
  51. bool glass = false;
  52. bool metallic = false;
  53. bool xqz = false;
  54. bool metallic_xqz = false;
  55. bool flat_xqz = false;
  56. bool wireframe_xqz = false;
  57. bool onetapsu = false;
  58.  
  59. int mode = IsLocal ? g_Settings.iLocalChamsMode : g_Settings.iChamsMode;
  60.  
  61. if (IsLocal && !g_Settings.bShowLocalChams)
  62. {
  63. continue;
  64. }
  65. if ((IsTeam && !IsLocal) && !g_Settings.bShowTeammates)
  66. {
  67. continue;
  68. }
  69. /*
  70. if (!IsTeam && !g_Settings.bShowChams)
  71. {
  72. continue;
  73. }
  74. */
  75.  
  76.  
  77. Color clr = IsLocal ? LocalColor : EnemyColor;
  78. Color clr2 = IsLocal ? LocalColorXqz : EnemyColorXqz;
  79.  
  80.  
  81. switch (mode)
  82. {
  83. case 1:
  84. xqz = true;
  85. break;
  86. case 2:
  87. flat_xqz = true;
  88. break;
  89. case 3:
  90. metallic_xqz = true; // metallic xqz
  91. break;
  92. case 4:
  93. xqz = true;
  94. }
  95.  
  96. switch (mode)
  97. {
  98. case 1:
  99. normal = true;
  100. break;
  101. case 2:
  102. flat = true;
  103. break;
  104. case 3:
  105. metallic = true;
  106. break;
  107. case 4:
  108. normal = true;
  109. break;
  110. }
  111. // tv chams
  112. // switch places ! --
  113. if (g_Settings.bShowChams)
  114. {
  115. MaterialManager::get().OverrideMaterial(xqz || flat_xqz || wireframe_xqz || metallic_xqz, flat, wireframe, glass, metallic, metallic_xqz, onetapsu); // add it to ||
  116. g_pRenderView->SetColorModulation(clr2.red / 255.f, clr2.green / 255.f, clr2.blue / 255.f);
  117. g_pRenderView->SetBlend(clr2.alpha / 255.f);
  118. pPlayerEntity->GetClientRenderable()->DrawModel(0x1, 255);
  119. }
  120.  
  121. if (g_Settings.bShowChamsXQZ) // else if
  122. {
  123.  
  124. if (xqz || flat_xqz || wireframe_xqz || metallic_xqz)
  125. {
  126. MaterialManager::get().OverrideMaterial(false, flat, wireframe, glass, metallic, metallic_xqz, onetapsu);
  127. g_pRenderView->SetColorModulation(clr.red / 255.f, clr.green / 255.f, clr.blue / 255.f);
  128. g_pRenderView->SetBlend(clr.alpha / 255.f);
  129. pPlayerEntity->GetClientRenderable()->DrawModel(0x1, 255);
  130. }
  131. }
  132. g_pModelRender->ForcedMaterialOverride(nullptr);
  133. }
  134. g_pModelRender->ForcedMaterialOverride(nullptr);
  135.  
  136. }
  137.  
  138. int __fastcall Hooks::DoPostScreenEffects(void* ecx, void* edx, int a1)
  139. {
  140. static auto oDoPostScreenEffects = g_Hooks.pClientModeHook->GetOriginal<DoPostScreenEffects_t>(44);
  141.  
  142. if (g_Settings.bShowGlow || g_Settings.iChamsMode == 4)
  143. DoGlow->DrawGlow();
  144.  
  145. return oDoPostScreenEffects(ecx, edx, a1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement