Guest User

Untitled

a guest
Dec 8th, 2018
434
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.16 KB | None | 0 0
  1. using System.Drawing;
  2. using System.Threading;
  3.  
  4. using strictexternal.Other;
  5. using strictexternal.Managers;
  6.  
  7. namespace strictexternal.Features
  8. {
  9. internal class Glow
  10. {
  11. public static void Run()
  12. {
  13. while (true)
  14. {
  15. Thread.Sleep(10);
  16.  
  17. if (!Checks.IsIngame) continue;
  18.  
  19. int gObject = MemoryManager.ReadMemory<int>((int)Structs.Base.Client + Offsets.dwGlowObjectManager);
  20. int gCount = MemoryManager.ReadMemory<int>((int)Structs.Base.Client + Offsets.dwGlowObjectManager + 0x4);
  21.  
  22. byte[] gEntities = MemoryManager.ReadMemory(gObject, gCount * 0x38);
  23.  
  24. for (int i = 0; i < gCount; i++)
  25. {
  26. int gEntity = Math.GetInt(gEntities, i * 0x38);
  27. if (gEntity == 0) continue;
  28.  
  29. int classID = Extensions.Other.GetClassID(gEntity);
  30. if (classID < 0) continue;
  31.  
  32. if (Settings.Glow.Snipers && Checks.IsSniper(classID))
  33. {
  34. Structs.Glow_t currGlowObject = MemoryManager.ReadMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4));
  35.  
  36. currGlowObject.r = Settings.Glow.Snipers_Color_R / 255f;
  37. currGlowObject.g = Settings.Glow.Snipers_Color_G / 255f;
  38. currGlowObject.b = Settings.Glow.Snipers_Color_B / 255f;
  39. currGlowObject.a = Settings.Glow.Snipers_Color_A / 255f;
  40. currGlowObject.m_bRenderWhenOccluded = true;
  41. currGlowObject.m_bRenderWhenUnoccluded = false;
  42.  
  43. if (Settings.Glow.FullBloom) currGlowObject.m_bFullBloom = true;
  44.  
  45. MemoryManager.WriteMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4), currGlowObject);
  46. }
  47. else if (Settings.Glow.Rifles && Checks.IsRifle(classID))
  48. {
  49. Structs.Glow_t currGlowObject = MemoryManager.ReadMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4));
  50.  
  51. currGlowObject.r = Settings.Glow.Rifles_Color_R / 255f;
  52. currGlowObject.g = Settings.Glow.Rifles_Color_G / 255f;
  53. currGlowObject.b = Settings.Glow.Rifles_Color_B / 255f;
  54. currGlowObject.a = Settings.Glow.Rifles_Color_A / 255f;
  55. currGlowObject.m_bRenderWhenOccluded = true;
  56. currGlowObject.m_bRenderWhenUnoccluded = false;
  57.  
  58. if (Settings.Glow.FullBloom) currGlowObject.m_bFullBloom = true;
  59.  
  60. MemoryManager.WriteMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4), currGlowObject);
  61. }
  62. else if (Settings.Glow.MachineGuns && Checks.IsMachineGun(classID))
  63. {
  64. Structs.Glow_t currGlowObject = MemoryManager.ReadMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4));
  65.  
  66. currGlowObject.r = Settings.Glow.MachineGuns_Color_R / 255f;
  67. currGlowObject.g = Settings.Glow.MachineGuns_Color_G / 255f;
  68. currGlowObject.b = Settings.Glow.MachineGuns_Color_B / 255f;
  69. currGlowObject.a = Settings.Glow.MachineGuns_Color_A / 255f;
  70. currGlowObject.m_bRenderWhenOccluded = true;
  71. currGlowObject.m_bRenderWhenUnoccluded = false;
  72.  
  73. if (Settings.Glow.FullBloom) currGlowObject.m_bFullBloom = true;
  74.  
  75. MemoryManager.WriteMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4), currGlowObject);
  76. }
  77. else if (Settings.Glow.Pistols && Checks.IsPistol(classID))
  78. {
  79. Structs.Glow_t currGlowObject = MemoryManager.ReadMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4));
  80.  
  81. currGlowObject.r = Settings.Glow.Pistols_Color_R / 255f;
  82. currGlowObject.g = Settings.Glow.Pistols_Color_G / 255f;
  83. currGlowObject.b = Settings.Glow.Pistols_Color_B / 255f;
  84. currGlowObject.a = Settings.Glow.Pistols_Color_A / 255f;
  85. currGlowObject.m_bRenderWhenOccluded = true;
  86. currGlowObject.m_bRenderWhenUnoccluded = false;
  87.  
  88. if (Settings.Glow.FullBloom) currGlowObject.m_bFullBloom = true;
  89.  
  90. MemoryManager.WriteMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4), currGlowObject);
  91. }
  92. else if (Settings.Glow.Shotguns && Checks.IsShotgun(classID))
  93. {
  94. Structs.Glow_t currGlowObject = MemoryManager.ReadMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4));
  95.  
  96. currGlowObject.r = Settings.Glow.Shotguns_Color_R / 255f;
  97. currGlowObject.g = Settings.Glow.Shotguns_Color_G / 255f;
  98. currGlowObject.b = Settings.Glow.Shotguns_Color_B / 255f;
  99. currGlowObject.a = Settings.Glow.Shotguns_Color_A / 255f;
  100. currGlowObject.m_bRenderWhenOccluded = true;
  101. currGlowObject.m_bRenderWhenUnoccluded = false;
  102.  
  103. if (Settings.Glow.FullBloom) currGlowObject.m_bFullBloom = true;
  104.  
  105. MemoryManager.WriteMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4), currGlowObject);
  106. }
  107. else if (Settings.Glow.MPs && Checks.IsMP(classID))
  108. {
  109. Structs.Glow_t currGlowObject = MemoryManager.ReadMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4));
  110.  
  111. currGlowObject.r = Settings.Glow.MPs_Color_R / 255f;
  112. currGlowObject.g = Settings.Glow.MPs_Color_G / 255f;
  113. currGlowObject.b = Settings.Glow.MPs_Color_B / 255f;
  114. currGlowObject.a = Settings.Glow.MPs_Color_A / 255f;
  115. currGlowObject.m_bRenderWhenOccluded = true;
  116. currGlowObject.m_bRenderWhenUnoccluded = false;
  117.  
  118. if (Settings.Glow.FullBloom) currGlowObject.m_bFullBloom = true;
  119.  
  120. MemoryManager.WriteMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4), currGlowObject);
  121. }
  122. else if (Settings.Glow.C4 && Checks.IsC4(classID))
  123. {
  124. Structs.Glow_t currGlowObject = MemoryManager.ReadMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4));
  125.  
  126. currGlowObject.r = Settings.Glow.C4_Color_R / 255f;
  127. currGlowObject.g = Settings.Glow.C4_Color_G / 255f;
  128. currGlowObject.b = Settings.Glow.C4_Color_B / 255f;
  129. currGlowObject.a = Settings.Glow.C4_Color_A / 255f;
  130. currGlowObject.m_bRenderWhenOccluded = true;
  131. currGlowObject.m_bRenderWhenUnoccluded = false;
  132.  
  133. if (Settings.Glow.FullBloom) currGlowObject.m_bFullBloom = true;
  134.  
  135. MemoryManager.WriteMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4), currGlowObject);
  136. }
  137. else if (Settings.Glow.Grenades && Checks.IsGrenade(classID))
  138. {
  139. Structs.Glow_t currGlowObject = MemoryManager.ReadMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4));
  140.  
  141. currGlowObject.r = Settings.Glow.Grenades_Color_R / 255f;
  142. currGlowObject.g = Settings.Glow.Grenades_Color_G / 255f;
  143. currGlowObject.b = Settings.Glow.Grenades_Color_B / 255f;
  144. currGlowObject.a = Settings.Glow.Grenades_Color_A / 255f;
  145. currGlowObject.m_bRenderWhenOccluded = true;
  146. currGlowObject.m_bRenderWhenUnoccluded = false;
  147.  
  148. if (Settings.Glow.FullBloom) currGlowObject.m_bFullBloom = true;
  149.  
  150. MemoryManager.WriteMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4), currGlowObject);
  151. }
  152. else if (Settings.Glow.Allies || Settings.Glow.Enemies && classID == (int)Enums.ClassIDs.CCSPlayer)
  153. {
  154. Structs.Enemy_t glowEntity = MemoryManager.ReadMemory<Structs.Enemy_t>(gEntity);
  155.  
  156. if (!glowEntity.Health.IsAlive()
  157. || glowEntity.Dormant
  158. || !glowEntity.Team.HasTeam()
  159. || glowEntity.Dormant) continue;
  160.  
  161. if (Settings.Glow.Enemies && !glowEntity.Team.IsMyTeam())
  162. {
  163. if (Settings.Glow.PlayerColorMode == 0)
  164. {
  165. Structs.Glow_t currGlowObject = MemoryManager.ReadMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4));
  166.  
  167. Color color = Extensions.Colors.FromHealth(glowEntity.Health / 100f);
  168.  
  169. currGlowObject.r = color.R / 255f;
  170. currGlowObject.g = color.G / 255f;
  171. currGlowObject.b = color.B / 255f;
  172. currGlowObject.a = Settings.Glow.Enemies_Color_A / 255f;
  173. currGlowObject.m_bRenderWhenOccluded = true;
  174. currGlowObject.m_bRenderWhenUnoccluded = false;
  175.  
  176. if (Settings.Glow.FullBloom) currGlowObject.m_bFullBloom = true;
  177.  
  178. MemoryManager.WriteMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4), currGlowObject);
  179. }
  180. else if (Settings.Glow.PlayerColorMode == 1)
  181. {
  182. Structs.Glow_t currGlowObject = MemoryManager.ReadMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4));
  183.  
  184. currGlowObject.r = Settings.Glow.Enemies_Color_R / 255f;
  185. currGlowObject.g = Settings.Glow.Enemies_Color_G / 255f;
  186. currGlowObject.b = Settings.Glow.Enemies_Color_B / 255f;
  187. currGlowObject.a = Settings.Glow.Enemies_Color_A / 255f;
  188. currGlowObject.m_bRenderWhenOccluded = true;
  189. currGlowObject.m_bRenderWhenUnoccluded = false;
  190.  
  191. if (Settings.Glow.FullBloom) currGlowObject.m_bFullBloom = true;
  192.  
  193. MemoryManager.WriteMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4), currGlowObject);
  194. }
  195. }
  196.  
  197. if (Settings.Glow.Allies && glowEntity.Team.IsMyTeam())
  198. {
  199. if (Settings.Glow.PlayerColorMode == 0)
  200. {
  201. Structs.Glow_t currGlowObject = MemoryManager.ReadMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4));
  202.  
  203. Color color = Extensions.Colors.FromHealth(glowEntity.Health / 100f);
  204.  
  205. currGlowObject.r = color.R / 255f;
  206. currGlowObject.g = color.G / 255f;
  207. currGlowObject.b = color.B / 255f;
  208. currGlowObject.a = Settings.Glow.Allies_Color_A / 255f;
  209. currGlowObject.m_bRenderWhenOccluded = true;
  210. currGlowObject.m_bRenderWhenUnoccluded = false;
  211.  
  212. if (Settings.Glow.FullBloom) currGlowObject.m_bFullBloom = true;
  213.  
  214. MemoryManager.WriteMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4), currGlowObject);
  215. }
  216. else if (Settings.Glow.PlayerColorMode == 1)
  217. {
  218. Structs.Glow_t currGlowObject = MemoryManager.ReadMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4));
  219.  
  220. currGlowObject.r = Settings.Glow.Allies_Color_R / 255f;
  221. currGlowObject.g = Settings.Glow.Allies_Color_G / 255f;
  222. currGlowObject.b = Settings.Glow.Allies_Color_B / 255f;
  223. currGlowObject.a = Settings.Glow.Allies_Color_A / 255f;
  224. currGlowObject.m_bRenderWhenOccluded = true;
  225. currGlowObject.m_bRenderWhenUnoccluded = false;
  226.  
  227. if (Settings.Glow.FullBloom) currGlowObject.m_bFullBloom = true;
  228.  
  229. MemoryManager.WriteMemory<Structs.Glow_t>((gObject + (i * 0x38) + 0x4), currGlowObject);
  230. }
  231. }
  232. }
  233. }
  234. }
  235. }
  236. }
  237. }
Advertisement
Add Comment
Please, Sign In to add comment