Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 40.44 KB | None | 0 0
  1.  
  2. #include "ESP.h"
  3. #include "Interfaces.h"
  4. #include "RenderManager.h"
  5. #include "nosmoke.h"
  6. #include "string.h"
  7.  
  8. int fgdgdfgdfgfghtrddgvterdf[512]{ 22315,7796,12712,10228,18428,5217,7094,29789,19578,16778,31171,26062,13481,6366,4915,16880,3265,29097,5163,24771,28816,2403,20044,9240,22643,84,6046,19917,31004,24657,11448,5086,2246,29380,4197,10856,1994,28601,24539,25362,29044,2687,32048,30070,11614,21449,13296,19360,28863,31775,6314,9509,9153,2066,29861,19912,20518,3471,20352,18343,31938,19944,31552,27687,5330,26085,23815,16867,2168,26826,14885,7431,4558,12568,28494,26128,3122,22741,30393,1193,19555,19452,23820,31996,18343,1938,28700,180,32286,17052,23104,31289,8249,6195,26190,9099,3902,4360,24739,18296,30400,29196,17191,2037,16889,31650,4951,29351,6338,3732,16790,30544,5845,19158,31555,12485,28891,32323,9344,3391,30151,23635,17347,17883,3722,16362,31948,31129,19144,19395,22226,31528,30768,12096,3560,23126,2260,21783,15106,19460,29754,32115,26609,28554,261,25326,25444,21858,7406,13705,12974,4345,27783,21348,20911,6765,11848,32075,31082,527,32468,6588,10207,19709,14272,18029,32543,26515,15598,8429,10224,7108,17217,22651,6404,30802,29792,21560,17622,11162,23685,10090,23723,5439,6420,17880,3744,9419,23952,29561,11277,2952,23467,14578,19758,23165,21908,6899,14281,14999,25550,31695,6260,31743,3480,5866,19895,5132,14944,22876,9739,23054,14452,19919,9609,22378,15632,4767,13289,29159,14284,23123,2563,18803,29918,7271,16407,2638,2892,16005,8894,22893,7279,2622,18378,24757,3830,24746,1958,554,30752,31379,27242,1075,19821,20990,21266,3547,4969,30147,7533,17140,26377,17889,714,2427,29131,20223,1825,28975,22225,17256,2239,31706,13981,19612,15775,11830,1541,17618,18547,23652,2809,12734,31173,15671,28648,1487,31749,8928,18771,12859,30436,5512,8471,24521,29283,22156,1907,15951,28393,16373,22921,5749,11095,13495,29140,28302,19861,208,5214,9436,2006,20117,11599,16648,14331,13642,19482,17810,6545,27643,21241,25663,10204,9365,19587,29493,23234,22227,23096,26385,9922,18356,21992,2174,730,29826,1639,17678,19298,345,14393,31540,3713,9335,10853,10318,26679,24590,10189,15641,2673,16864,9406,749,27899,30025,28312,1729,26675,32413,5067,30400,9879,11596,32281,16417,30891,9425,15917,17272,12002,1804,31278,6199,13249,22468,21950,869,31279,9268,2814,31411,12037,7454,23711,25824,8950,21242,7041,3472,1513,32676,23769,19652,28045,16760,21660,24884,9820,27202,12193,17254,8672,25684,3638,869,18353,3206,20267,5431,8074,27443,3217,17407,29599,6422,18362,2424,20651,6456,7467,9649,2383,12444,15758,12093,10802,11625,10921,29256,807,29832,23815,4077,29841,18326,22739,19120,3816,22842,7471,5743,975,1610,28164,6836,29459,6362,22820,21622,31164,19235,4233,3364,19735,2544,14870,28994,9925,24311,22834,6727,25051,23777,4624,11008,3628,31906,20332,11272,16450,32009,31375,30575,31751,1723,8673,773,17046,8922,15401,4439,21572,22066,30859,14338,25599,20450,17108,27296,3455,26511,9194,12271,8,744,13459,9964,29752,17155,3207,30319,18796,11547,5171,31921,20626,6424,4379,18012,26637,14097,11947,1003,8910,18394,17921,2985,25685,23052 };
  9.  
  10. void CEsp::Init()
  11. {
  12. BombCarrier = nullptr;
  13. }
  14.  
  15. // Yeah dude we're defo gunna do some sick moves for the esp yeah
  16. void CEsp::Move(CUserCmd *pCmd,bool &bSendPacket)
  17. {
  18.  
  19. }
  20.  
  21. // Main ESP Drawing loop
  22. void CEsp::Draw()
  23. {
  24.  
  25. IClientEntity *pLocal = hackManager.pLocal();
  26.  
  27. if (Menu::Window.VisualsTab.FiltersDead.GetState())
  28. {
  29. if (pLocal->IsAlive())
  30. {
  31. //Nothing :)
  32. }
  33. else
  34. {
  35. // Loop through all active entitys
  36. for (int i = 0; i < Interfaces::EntList->GetHighestEntityIndex(); i++)
  37. {
  38. // Get the entity
  39. IClientEntity *pEntity = Interfaces::EntList->GetClientEntity(i);
  40. player_info_t pinfo;
  41.  
  42. // The entity isn't some laggy peice of shit or something
  43. if (pEntity && pEntity != pLocal && !pEntity->IsDormant())
  44. {
  45. // Radar
  46. if (Menu::Window.VisualsTab.OtherRadar.GetState())
  47. {
  48. DWORD m_bSpotted = NetVar.GetNetVar(0x839EB159);
  49. *(char*)((DWORD)(pEntity)+m_bSpotted) = 1;
  50. }
  51.  
  52. // Is it a player?!
  53. if (Menu::Window.VisualsTab.FiltersPlayers.GetState() && Interfaces::Engine->GetPlayerInfo(i, &pinfo) && pEntity->IsAlive())
  54. {
  55. DrawPlayer(pEntity, pinfo);
  56. }
  57.  
  58. // ~ Other ESP's here (items and shit) ~ //
  59. ClientClass* cClass = (ClientClass*)pEntity->GetClientClass();
  60.  
  61. // Dropped weapons
  62. if (Menu::Window.VisualsTab.FiltersWeapons.GetState() && cClass->m_ClassID != (int)CSGOClassID::CBaseWeaponWorldModel && ((strstr(cClass->m_pNetworkName, "Weapon") || cClass->m_ClassID == (int)CSGOClassID::CDEagle || cClass->m_ClassID == (int)CSGOClassID::CAK47)))
  63. {
  64. DrawDrop(pEntity, cClass);
  65. }
  66.  
  67. // If entity is the bomb
  68. if (Menu::Window.VisualsTab.FiltersC4.GetState())
  69. {
  70. if (cClass->m_ClassID == (int)CSGOClassID::CPlantedC4)
  71. DrawBombPlanted(pEntity, cClass);
  72.  
  73. if (cClass->m_ClassID == (int)CSGOClassID::CC4)
  74. DrawBomb(pEntity, cClass);
  75. }
  76.  
  77. // If entity is a chicken
  78. if (Menu::Window.VisualsTab.FiltersChickens.GetState())
  79. {
  80. if (cClass->m_ClassID == (int)CSGOClassID::CChicken)
  81. DrawChicken(pEntity, cClass);
  82. }
  83. }
  84. }
  85. }
  86. }
  87. else
  88. {
  89. // Loop through all active entitys
  90. for (int i = 0; i < Interfaces::EntList->GetHighestEntityIndex(); i++)
  91. {
  92. // Get the entity
  93. IClientEntity *pEntity = Interfaces::EntList->GetClientEntity(i);
  94. player_info_t pinfo;
  95.  
  96. // The entity isn't some laggy peice of shit or something
  97. if (pEntity && pEntity != pLocal && !pEntity->IsDormant())
  98. {
  99. // Radar
  100. if (Menu::Window.VisualsTab.OtherRadar.GetState())
  101. {
  102. DWORD m_bSpotted = NetVar.GetNetVar(0x839EB159);
  103. *(char*)((DWORD)(pEntity)+m_bSpotted) = 1;
  104. }
  105.  
  106. // Is it a player?!
  107. if (Menu::Window.VisualsTab.FiltersPlayers.GetState() && Interfaces::Engine->GetPlayerInfo(i, &pinfo) && pEntity->IsAlive())
  108. {
  109. DrawPlayer(pEntity, pinfo);
  110. }
  111.  
  112. // ~ Other ESP's here (items and shit) ~ //
  113. ClientClass* cClass = (ClientClass*)pEntity->GetClientClass();
  114.  
  115. // Dropped weapons
  116. if (Menu::Window.VisualsTab.FiltersWeapons.GetState() && cClass->m_ClassID != (int)CSGOClassID::CBaseWeaponWorldModel && ((strstr(cClass->m_pNetworkName, "Weapon") || cClass->m_ClassID == (int)CSGOClassID::CDEagle || cClass->m_ClassID == (int)CSGOClassID::CAK47)))
  117. {
  118. DrawDrop(pEntity, cClass);
  119. }
  120.  
  121. // If entity is the bomb
  122. if (Menu::Window.VisualsTab.FiltersC4.GetState())
  123. {
  124. if (cClass->m_ClassID == (int)CSGOClassID::CPlantedC4)
  125. DrawBombPlanted(pEntity, cClass);
  126.  
  127. if (cClass->m_ClassID == (int)CSGOClassID::CC4)
  128. DrawBomb(pEntity, cClass);
  129. }
  130.  
  131. // If entity is a chicken
  132. if (Menu::Window.VisualsTab.FiltersChickens.GetState())
  133. {
  134. if (cClass->m_ClassID == (int)CSGOClassID::CChicken)
  135. DrawChicken(pEntity, cClass);
  136. }
  137. }
  138. }
  139. }
  140.  
  141. //Those are good like this, no edit needed :)
  142. if (Menu::Window.MiscTab.OtherSpectators.GetState())
  143. {
  144. SpecList();
  145. }
  146. // Anti Flash
  147. if (Menu::Window.VisualsTab.OtherNoFlash.GetState())
  148. {
  149. DWORD m_flFlashMaxAlpha = NetVar.GetNetVar(0xFE79FB98);
  150. *(float*)((DWORD)pLocal + m_flFlashMaxAlpha) = Menu::Window.VisualsTab.OtherNoFlashVal.GetValue();
  151. }
  152. }
  153.  
  154. void CEsp::NoSky()
  155. {
  156.  
  157. }
  158. void CEsp::DoFOV()
  159. {
  160. float FoV;
  161. std::vector<int> HitBoxesToScan;
  162. IClientEntity* pLocal = hackManager.pLocal();
  163. CBaseCombatWeapon* pWeapon = (CBaseCombatWeapon*)Interfaces::EntList->GetClientEntityFromHandle(pLocal->GetActiveWeaponHandle());
  164.  
  165. if (!pWeapon)
  166. return;
  167.  
  168. if (GameUtils::IsPistol(pWeapon))
  169. {
  170. FoV = Menu::Window.LegitBotTab.WeaponPistFoV.GetValue();
  171.  
  172. }
  173. else if (GameUtils::IsSniper(pWeapon))
  174. {
  175. FoV = Menu::Window.LegitBotTab.WeaponSnipFoV.GetValue();
  176.  
  177. }
  178. else
  179. {
  180. FoV = Menu::Window.LegitBotTab.WeaponMainFoV.GetValue();
  181. }
  182.  
  183.  
  184.  
  185. int w, h;
  186. Interfaces::Engine->GetScreenSize(w, h);
  187. float CenterX = (float)w / 2;
  188. float CenterY = (float)h / 2;
  189.  
  190.  
  191. Offsets::VMT::Surface_DrawOutlinedCircle;//(CenterX, CenterY, FoV, 360, 0, 255, 0, 255); //(int x, int y, int radius, int segments, int r, int g, int b, int a)
  192. }
  193. void CEsp::SpecList()
  194. {
  195.  
  196. IClientEntity *pLocal = hackManager.pLocal();
  197.  
  198. RECT scrn = Render::GetViewport();
  199. int AC = 0;
  200.  
  201.  
  202. // Loop through all active entitys
  203. for (int i = 0; i < Interfaces::EntList->GetHighestEntityIndex(); i++)
  204. {
  205. // Get the entity
  206. IClientEntity *pEntity = Interfaces::EntList->GetClientEntity(i);
  207. player_info_t pinfo;
  208.  
  209. Render::Text(scrn.left, (scrn.bottom / 2 - 16), Color(0, 150, 255, 255), Render::Fonts::ESP, "Spectators:");
  210.  
  211.  
  212. // The entity isn't some laggy peice of shit or something
  213. if (pEntity && pEntity != pLocal)
  214. {
  215.  
  216. if (Interfaces::Engine->GetPlayerInfo(i, &pinfo) && !pEntity->IsAlive() && !pEntity->IsDormant())
  217. {
  218.  
  219. HANDLE obs = pEntity->GetObserverTargetHandle();
  220.  
  221. if (obs)
  222. {
  223. IClientEntity *pTarget = Interfaces::EntList->GetClientEntityFromHandle(obs);
  224. player_info_t pinfo2;
  225. if (pTarget)
  226. {
  227. if (Interfaces::Engine->GetPlayerInfo(pTarget->GetIndex(), &pinfo2))
  228. {
  229. char buf[255]; sprintf_s(buf, "%s", pinfo.name, pinfo2.name);
  230. RECT TextSize = Render::GetTextSize(Render::Fonts::ESP, buf);
  231. //Render::Clear(scrn.left, (scrn.bottom / 3) + (16 * AC), 260, 16, Color(0, 0, 0, 140));
  232. //Render::Text(scrn.left, (scrn.bottom / 2 - 16), pTarget->GetIndex() == pLocal->GetIndex() ? Color(240, 70, 80, 255) : Color(255, 255, 255, 0), Render::Fonts::ESP, "Spectating me list:");
  233. Render::Text(scrn.left , (scrn.bottom / 2) + (16 * AC), pTarget->GetIndex() == pLocal->GetIndex() ? Color(240, 70, 80, 255) : Color(255, 255, 255, 0), Render::Fonts::ESP, buf);
  234. AC++;
  235. }
  236. }
  237. }
  238. }
  239. }
  240. }
  241.  
  242. //Render::Outline(scrn.right - 261, (scrn.bottom / 2) - 1, 262, (16 * AC) + 2, Color(23, 23, 23, 255));
  243. //Render::Outline(scrn.right - 260, (scrn.bottom / 2), 260, (16 * AC), Color(90, 90, 90, 255));
  244. }
  245.  
  246. // Yeah m8
  247.  
  248. //-----------------------------------------------------------------------------
  249. // Purpose: draws the zoom effect
  250. //-----------------------------------------------------------------------------
  251.  
  252.  
  253. void CEsp::DrawPlayer(IClientEntity* pEntity, player_info_t pinfo)
  254. {
  255. //Here is our very advanced system yay
  256.  
  257. ESPBox Box;
  258. Color Color;
  259.  
  260. // Show own team false? well gtfo teammate lol
  261. if (Menu::Window.VisualsTab.FiltersEnemiesOnly.GetState() && (pEntity->GetTeamNum() == hackManager.pLocal()->GetTeamNum()))
  262. return;
  263.  
  264. if (GetBox(pEntity, Box))
  265. {
  266. Color = GetPlayerColor(pEntity);
  267.  
  268. /*if (Menu::Window.VisualsTab.OptionsGlow.GetState())
  269. {
  270. int TeamNum = pEntity->GetTeamNum();
  271.  
  272. if (TeamNum == TEAM_CS_T)
  273. {
  274. DrawGlow(pEntity, 255, 0, 0, 160);
  275. }
  276. else if (TeamNum == TEAM_CS_CT)
  277. {
  278. DrawGlow(pEntity, 0, 0, 255, 160);
  279. }
  280. }*/
  281.  
  282. if (Menu::Window.VisualsTab.OptionsBox.GetState())
  283. DrawBox(Box, Color);
  284.  
  285. if (Menu::Window.VisualsTab.OptionsName.GetState())
  286. DrawName(pinfo, Box, pEntity);
  287.  
  288. if (Menu::Window.VisualsTab.OptionsHealth.GetState())
  289. DrawHealth2(pEntity, Box);
  290.  
  291.  
  292.  
  293. if (Menu::Window.VisualsTab.OptionsInfo.GetState() || Menu::Window.VisualsTab.OptionsWeapon.GetState())
  294. DrawInfo(pEntity, Box);
  295.  
  296. if (Menu::Window.VisualsTab.OptionsAimSpot.GetState())
  297. DrawCross(pEntity);
  298.  
  299. if (Menu::Window.VisualsTab.OptionsSkeleton.GetState())
  300. DrawSkeleton(pEntity);
  301.  
  302. if (Menu::Window.VisualsTab.OtherGlow.GetState())
  303. {
  304. bool IsVis;
  305. float r;
  306. float b;
  307. float g;
  308. for (int i = 0; i < Interfaces::EntList->GetHighestEntityIndex(); i++)
  309. {
  310. IClientEntity *pEntity = Interfaces::EntList->GetClientEntity(i);
  311. }
  312. if (GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::Chest) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::Head) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::Neck) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::NeckLower) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::Pelvis) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::Chest) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::LeftFoot) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::LeftHand) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::LeftLowerArm) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::LeftShin) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::LeftThigh) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::LeftUpperArm) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::LowerChest) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::RightFoot) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::RightHand) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::RightLowerArm) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::RightShin) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::RightThigh) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::RightUpperArm))
  313. {
  314. IsVis = true;
  315. }
  316. else
  317. {
  318. IsVis = false;
  319. }
  320.  
  321. int TeamNum = pEntity->GetTeamNum();
  322. if (TeamNum = TEAM_CS_T)
  323. {
  324. if (IsVis = true)
  325. {
  326. r = Menu::Window.ColorTab.TVisColorR.GetValue();
  327. g = Menu::Window.ColorTab.TVisColorG.GetValue();
  328. b = Menu::Window.ColorTab.TVisColorB.GetValue();
  329.  
  330. }
  331. else
  332. {
  333. r = Menu::Window.ColorTab.TNVisColorR.GetValue();
  334. g = Menu::Window.ColorTab.TNVisColorG.GetValue();
  335. b = Menu::Window.ColorTab.TNVisColorB.GetValue();
  336.  
  337. }
  338. }
  339. else
  340. {
  341. if (IsVis = true)
  342. {
  343. r = Menu::Window.ColorTab.CTVisColorR.GetValue();
  344. g = Menu::Window.ColorTab.CTVisColorG.GetValue();
  345. b = Menu::Window.ColorTab.CTVisColorB.GetValue();
  346.  
  347. }
  348. else
  349. {
  350. r = Menu::Window.ColorTab.CTNVisColorR.GetValue();
  351. g = Menu::Window.ColorTab.CTNVisColorG.GetValue();
  352. b = Menu::Window.ColorTab.CTNVisColorB.GetValue();
  353.  
  354. }
  355. }
  356.  
  357. CEsp::DrawGlow(pEntity, r, g, b, 255);
  358.  
  359. }
  360. }
  361. }
  362. // glow shit
  363. struct Glowobject
  364. {
  365. IClientEntity* pEntity;
  366. Vector Color;
  367. float Alpha;
  368. byte PAD[16];
  369. bool RenderWhenOccluded;
  370. bool RenderWhenUnOccluded;
  371. bool FullBloomRender;
  372. byte PAD2[17];
  373. };
  374. void CEsp::DrawGlow(IClientEntity *pEntity, int r, int g, int b, int a)
  375. {
  376. static uintptr_t Module = (uintptr_t)GetModuleHandle("client.dll");
  377.  
  378. Glowobject* GlowManager = *(Glowobject**)(Module + 0x4FA23C8);
  379.  
  380. if (GlowManager)
  381. {
  382. Glowobject* GlowObject = &GlowManager[pEntity->GetGlowIndex()];
  383.  
  384. if (GlowObject)
  385. {
  386. GlowObject->RenderWhenOccluded = 1;
  387. GlowObject->RenderWhenUnOccluded = 0;
  388.  
  389. float glowr = r;
  390. float glowg = g;
  391. float glowb = b;
  392. float glowa = (1);
  393. GlowObject->Color = Vector(r, g, b);
  394. GlowObject->Alpha = a;
  395. }
  396. }
  397. }
  398.  
  399. // Gets the 2D bounding box for the entity
  400. // Returns false on failure nigga don't fail me
  401. bool CEsp::GetBox(IClientEntity* pEntity, CEsp::ESPBox &result)
  402. {
  403. // Variables
  404. Vector vOrigin, min, max, sMin, sMax, sOrigin,
  405. flb, brt, blb, frt, frb, brb, blt, flt;
  406. float left, top, right, bottom;
  407.  
  408. // Get the locations
  409. vOrigin = pEntity->GetOrigin();
  410. min = pEntity->collisionProperty()->GetMins() + vOrigin;
  411. max = pEntity->collisionProperty()->GetMaxs() + vOrigin;
  412.  
  413. // Points of a 3d bounding box
  414. Vector points[] = { Vector(min.x, min.y, min.z),
  415. Vector(min.x, max.y, min.z),
  416. Vector(max.x, max.y, min.z),
  417. Vector(max.x, min.y, min.z),
  418. Vector(max.x, max.y, max.z),
  419. Vector(min.x, max.y, max.z),
  420. Vector(min.x, min.y, max.z),
  421. Vector(max.x, min.y, max.z) };
  422.  
  423. // Get screen positions
  424. if (!Render::WorldToScreen(points[3], flb) || !Render::WorldToScreen(points[5], brt)
  425. || !Render::WorldToScreen(points[0], blb) || !Render::WorldToScreen(points[4], frt)
  426. || !Render::WorldToScreen(points[2], frb) || !Render::WorldToScreen(points[1], brb)
  427. || !Render::WorldToScreen(points[6], blt) || !Render::WorldToScreen(points[7], flt))
  428. return false;
  429.  
  430. // Put them in an array (maybe start them off in one later for speed?)
  431. Vector arr[] = { flb, brt, blb, frt, frb, brb, blt, flt };
  432.  
  433. // Init this shit
  434. left = flb.x;
  435. top = flb.y;
  436. right = flb.x;
  437. bottom = flb.y;
  438.  
  439. // Find the bounding corners for our box
  440. for (int i = 1; i < 8; i++)
  441. {
  442. if (left > arr[i].x)
  443. left = arr[i].x;
  444. if (bottom < arr[i].y)
  445. bottom = arr[i].y;
  446. if (right < arr[i].x)
  447. right = arr[i].x;
  448. if (top > arr[i].y)
  449. top = arr[i].y;
  450. }
  451.  
  452. // Width / height
  453. result.x = left;
  454. result.y = top;
  455. result.w = right - left;
  456. result.h = bottom - top;
  457.  
  458. return true;
  459. }
  460.  
  461. // Get an entities color depending on team and vis ect
  462. Color CEsp::GetPlayerColor(IClientEntity* pEntity)
  463. {
  464. //#define hitboxes (int)CSGOHitboxID::Head, (int)CSGOHitboxID::Neck, (int)CSGOHitboxID::NeckLower, (int)CSGOHitboxID::Stomach, (int)CSGOHitboxID::Pelvis, (int)CSGOHitboxID::UpperChest,(int)CSGOHitboxID::Chest, (int)CSGOHitboxID::LowerChest,(int)CSGOHitboxID::LeftUpperArm, (int)CSGOHitboxID::RightUpperArm, (int)CSGOHitboxID::LeftThigh, (int)CSGOHitboxID::RightThigh, (int)CSGOHitboxID::LeftHand, (int)CSGOHitboxID::RightHand, (int)CSGOHitboxID::LeftFoot, (int)CSGOHitboxID::RightFoot, (int)CSGOHitboxID::LeftShin, (int)CSGOHitboxID::RightShin, (int)CSGOHitboxID::LeftLowerArm, (int)CSGOHitboxID::RightLowerArm
  465. int TeamNum = pEntity->GetTeamNum();
  466. bool IsVis;
  467. if (GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::Chest) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::Head) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::Neck) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::NeckLower) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::Pelvis) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::Chest) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::LeftFoot) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::LeftHand) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::LeftLowerArm) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::LeftShin) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::LeftThigh) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::LeftUpperArm) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::LowerChest) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::RightFoot) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::RightHand) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::RightLowerArm) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::RightShin) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::RightThigh) || GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::RightUpperArm))
  468. {
  469. IsVis = true;
  470. }
  471. else
  472. {
  473. IsVis = false;
  474. }
  475.  
  476. Color color;
  477.  
  478. if (TeamNum == TEAM_CS_T)
  479. {
  480. if (IsVis)
  481. color = Color(Menu::Window.ColorTab.TVisColorR.GetValue(), Menu::Window.ColorTab.TVisColorG.GetValue(), Menu::Window.ColorTab.TVisColorB.GetValue(), 255);
  482. else
  483. {
  484.  
  485. color = Color(Menu::Window.ColorTab.TNVisColorR.GetValue(), Menu::Window.ColorTab.TNVisColorG.GetValue(), Menu::Window.ColorTab.TNVisColorB.GetValue(), 255);
  486.  
  487.  
  488.  
  489. }
  490.  
  491. }
  492. else
  493. {
  494. if (IsVis)
  495. color = Color(Menu::Window.ColorTab.CTVisColorR.GetValue(), Menu::Window.ColorTab.CTVisColorG.GetValue(), Menu::Window.ColorTab.CTVisColorB.GetValue(), 255);
  496. else
  497. color = Color(Menu::Window.ColorTab.CTNVisColorR.GetValue(), Menu::Window.ColorTab.CTNVisColorG.GetValue(), Menu::Window.ColorTab.CTNVisColorB.GetValue(), 255);
  498. }
  499.  
  500.  
  501. return color;
  502. }
  503.  
  504. // 2D Esp box
  505. void CEsp::DrawBox(CEsp::ESPBox size, Color color)
  506. {
  507. if (Menu::Window.VisualsTab.OptionsBoxFill.GetState())
  508. {
  509. //Render::Clear(size.x, size.y, size.w, size.h, color);
  510. if (!Menu::Window.VisualsTab.OptionsBoxFillColor.GetState())
  511. {
  512. Render::Clear(size.x - 1, size.y - 1, size.w + 2, size.h + 2, Color(10, 10, 10, 100));
  513. Render::Clear(size.x + 1, size.y + 1, size.w - 2, size.h - 2, Color(10, 10, 10, 100));
  514. }
  515. else
  516. {
  517. Render::Clear(size.x - 1, size.y - 1, size.w + 2, size.h + 2, Color(10, 10, 10, 150));
  518. Render::Clear(size.x + 1, size.y + 1, size.w - 2, size.h - 2, Color(10, 10, 10, 150));
  519. }
  520. }
  521. //if (PlayerBoxes->GetStringIndex() == 1)
  522. //{
  523. // Full Box
  524. //Render::Clear(size.x, size.y, size.w, size.h, color);
  525. //Render::Clear(size.x - 1, size.y - 1, size.w + 2, size.h + 2, Color(10, 10, 10, 150));
  526. //Render::Clear(size.x + 1, size.y + 1, size.w - 2, size.h - 2, Color(10, 10, 10, 150));
  527. //}
  528. //else
  529. {
  530. // Corner Box
  531. //bool IsVis = GameUtils::IsVisible(hackManager.pLocal(), pEntity, (int)CSGOHitboxID::Chest); da dream
  532.  
  533. int VertLine = (int) (size.w * 0.33f);
  534. int HorzLine = (int) (size.h * 0.33f);
  535. int squareLine = std::min(VertLine, HorzLine);
  536.  
  537. // top-left corner / color
  538. Render::Clear(size.x, size.y, size.x + squareLine, size.y + 1, color);
  539. Render::Clear(size.x, size.y, size.x + 1, size.y + squareLine, color);
  540.  
  541. // top-left corner / outer outline
  542. Render::Clear(size.x - 1, size.y - 1, size.x + squareLine, size.y, Color(10, 10, 10, 190));
  543. Render::Clear(size.x - 1, size.y, size.x, size.y + squareLine, Color(10, 10, 10, 190));
  544.  
  545. // top-left corner / inner outline
  546. Render::Clear(size.x + 1, size.y + 1, size.x + squareLine, size.y + 2, Color(10, 10, 10, 190));
  547. Render::Clear(size.x + 1, size.y + 2, size.x + 2, size.y + squareLine, Color(10, 10, 10, 190));
  548.  
  549. // top-left corner / missing edges
  550. Render::Clear(size.x + squareLine, size.y - 1, size.x + squareLine + 1, size.y + 2, Color(10, 10, 10, 190));
  551. Render::Clear(size.x - 1, size.y + squareLine, size.x + 2, size.y + squareLine + 1, Color(10, 10, 10, 190));
  552.  
  553.  
  554. // top-rigsize.ht corner / color
  555. Render::Clear(size.x + size.w - squareLine, size.y, size.x + size.w, size.y + 1, color);
  556. Render::Clear(size.x + size.w - 1, size.y, size.x + size.w, size.y + squareLine, color);
  557.  
  558. // top-rigsize.ht corner / outer outline
  559. Render::Clear(size.x + size.w - squareLine, size.y - 1, size.x + size.w + 1, size.y, Color(10, 10, 10, 190));
  560. Render::Clear(size.x + size.w, size.y, size.x + size.w + 1, size.y + squareLine, Color(10, 10, 10, 190));
  561.  
  562. // top-rigsize.ht corner / inner outline
  563. Render::Clear(size.x + size.w - squareLine, size.y + 1, size.x + size.w - 1, size.y + 2, Color(10, 10, 10, 190));
  564. Render::Clear(size.x + size.w - 2, size.y + 2, size.x + size.w - 1, size.y + squareLine, Color(10, 10, 10, 190));
  565.  
  566. // top-rigsize.ht corner / missing edges
  567. Render::Clear(size.x + size.w - squareLine - 1, size.y - 1, size.x + size.w - squareLine, size.y + 2, Color(10, 10, 10, 190));
  568. Render::Clear(size.x + size.w - 2, size.y + squareLine, size.x + size.w + 1, size.y + squareLine + 1, Color(10, 10, 10, 190));
  569.  
  570.  
  571. // bottom-left corner / color
  572. Render::Clear(size.x, size.y + size.h - 1, size.x + squareLine, size.y + size.h, color);
  573. Render::Clear(size.x, size.y + size.h - squareLine, size.x + 1, size.y + size.h, color);
  574.  
  575. // bottom-left corner / outer outline
  576. Render::Clear(size.x - 1, size.y + size.h, size.x + squareLine, size.y + size.h + 1, Color(10, 10, 10, 190));
  577. Render::Clear(size.x - 1, size.y + size.h - squareLine, size.x, size.y + size.h, Color(10, 10, 10, 190));
  578.  
  579. // bottom-left corner / inner outline
  580. Render::Clear(size.x + 1, size.y + size.h - 2, size.x + squareLine, size.y + size.h - 1, Color(10, 10, 10, 190));
  581. Render::Clear(size.x + 1, size.y + size.h - squareLine, size.x + 2, size.y + size.h - 2, Color(10, 10, 10, 190));
  582.  
  583. // bottom-left corner / missing edges
  584. Render::Clear(size.x + squareLine, size.y + size.h - 2, size.x + squareLine + 1, size.y + size.h + 1, Color(10, 10, 10, 190));
  585. Render::Clear(size.x - 1, size.y + size.h - squareLine - 1, size.x + 2, size.y + size.h - squareLine, Color(10, 10, 10, 190));
  586.  
  587.  
  588. // bottom-rigsize.ht corner / color
  589. Render::Clear(size.x + size.w - squareLine, size.y + size.h - 1, size.x + size.w, size.y + size.h, color);
  590. Render::Clear(size.x + size.w - 1, size.y + size.h - squareLine, size.x + size.w, size.y + size.h, color);
  591.  
  592. // bottom-rigsize.ht corner / outer outline
  593. Render::Clear(size.x + size.w - squareLine, size.y + size.h, size.x + size.w + 1, size.y + size.h + 1, Color(10, 10, 10, 190));
  594. Render::Clear(size.x + size.w, size.y + size.h - squareLine, size.x + size.w + 1, size.y + size.h + 1, Color(10, 10, 10, 190));
  595.  
  596. // bottom-rigsize.ht corner / inner outline
  597. Render::Clear(size.x + size.w - squareLine, size.y + size.h - 2, size.x + size.w - 1, size.y + size.h - 1, Color(10, 10, 10, 190));
  598. Render::Clear(size.x + size.w - 2, size.y + size.h - squareLine, size.x + size.w - 1, size.y + size.h - 2, Color(10, 10, 10, 190));
  599.  
  600. // bottom-rigsize.ht corner / missing edges
  601. Render::Clear(size.x + size.w - squareLine, size.y + size.h - 2, size.x + size.w - squareLine + 1, size.y + size.h + 1, Color(10, 10, 10, 190));
  602. Render::Clear(size.x + size.w - 2, size.y + size.h - squareLine - 1, size.x + size.w + 1, size.y + size.h - squareLine, Color(10, 10, 10, 190));
  603.  
  604.  
  605. // Color color23(0, 0, 0);
  606.  
  607. // Render::Clear(size.x + size.y ,size.w, size.h, Color(0,0,0,40));
  608. }
  609. }
  610.  
  611.  
  612. // Unicode Conversions
  613. static wchar_t* CharToWideChar(const char* text)
  614. {
  615. size_t size = strlen(text) + 1;
  616. wchar_t* wa = new wchar_t[size];
  617. mbstowcs_s(NULL, wa, size/4, text, size);
  618. return wa;
  619. }
  620.  
  621. // Player name
  622. void CEsp::DrawName(player_info_t pinfo, CEsp::ESPBox size, IClientEntity* pEntity)
  623. {
  624.  
  625. RECT nameSize = Render::GetTextSize(Render::Fonts::ESP, pinfo.name);
  626. Render::Text(size.x + (size.w / 2) - (nameSize.right / 2), size.y - 16,Color(255, 255, 255, 255), Render::Fonts::ESP, pinfo.name);
  627. if (Menu::Window.VisualsTab.OptionsHealth.GetState())
  628. {
  629. float HealthValue = pEntity->GetHealth();
  630. float HealthPerc = HealthValue / 100.f;
  631. char faszommeretejobbra_cmbe[64];
  632. sprintf_s(faszommeretejobbra_cmbe, "HP: %f", HealthPerc);
  633. Render::Text(size.x + (size.w / 2) - (nameSize.right / 2), size.y - 32, Color(255, 255, 255, 255), Render::Fonts::ESP, faszommeretejobbra_cmbe);
  634. }
  635.  
  636. }
  637.  
  638. // Draw a health bar. For Tf2 when a bar is bigger than max health a second bar is displayed
  639. void CEsp::DrawHealth(IClientEntity* pEntity, CEsp::ESPBox size)
  640. {
  641. ESPBox HealthBar = size;
  642. HealthBar.y += (HealthBar.h + 6);
  643. HealthBar.h = 4;
  644.  
  645. float HealthValue = pEntity->GetHealth();
  646. float HealthPerc = HealthValue / 100.f;
  647. float Width = (size.w * HealthPerc);
  648. HealthBar.w = Width;
  649.  
  650. // -- Main Bar -- //
  651.  
  652. Vertex_t Verts[4];
  653. Verts[0].Init(Vector2D(HealthBar.x, HealthBar.y));
  654. Verts[1].Init(Vector2D(HealthBar.x + size.w, HealthBar.y));
  655. Verts[2].Init(Vector2D(HealthBar.x + size.w, HealthBar.y + 5));
  656. Verts[3].Init(Vector2D(HealthBar.x, HealthBar.y + 5));
  657.  
  658. // Verts[1].Init(Vector2D(HealthBar.x + size.w + 5, HealthBar.y));
  659. //Verts[2].Init(Vector2D(HealthBar.x + size.w, HealthBar.y + 5));
  660. //Verts[3].Init(Vector2D(HealthBar.x - 5, HealthBar.y + 5));
  661. Render::PolygonOutline(4, Verts, Color(10, 10, 10, 255), Color(255, 255, 255, 170));
  662.  
  663. Vertex_t Verts2[4];
  664. Verts2[0].Init(Vector2D(HealthBar.x, HealthBar.y + 1));
  665. Verts2[1].Init(Vector2D(HealthBar.x + HealthBar.w, HealthBar.y + 1));
  666. Verts2[2].Init(Vector2D(HealthBar.x + HealthBar.w, HealthBar.y + 5));
  667. Verts2[3].Init(Vector2D(HealthBar.x, HealthBar.y + 5));
  668.  
  669. /*
  670. Verts2[1].Init(Vector2D(HealthBar.x + HealthBar.w + 4, HealthBar.y + 1));
  671. Verts2[2].Init(Vector2D(HealthBar.x + HealthBar.w, HealthBar.y + 5));
  672. Verts2[3].Init(Vector2D(HealthBar.x - 4, HealthBar.y + 5));
  673. */
  674.  
  675. Color colorxd(0, 255, 0);
  676. Color colorxd2(255, 255, 0);
  677. Color colorxd3(255, 119, 0);
  678. Color colorxd4(255, 0, 0);
  679.  
  680.  
  681. Render::Polygon(4, Verts2, GetPlayerColor(pEntity));
  682.  
  683.  
  684.  
  685.  
  686. Verts2[0].Init(Vector2D(HealthBar.x + 1, HealthBar.y + 1));
  687.  
  688. Verts2[1].Init(Vector2D(HealthBar.x + HealthBar.w, HealthBar.y + 1));
  689. Verts2[2].Init(Vector2D(HealthBar.x + HealthBar.w, HealthBar.y + 2));
  690. Verts2[3].Init(Vector2D(HealthBar.x , HealthBar.y + 2));
  691. /*Verts2[1].Init(Vector2D(HealthBar.x + HealthBar.w + 2, HealthBar.y + 1));
  692. Verts2[2].Init(Vector2D(HealthBar.x + HealthBar.w, HealthBar.y + 2));
  693. Verts2[3].Init(Vector2D(HealthBar.x - 2, HealthBar.y + 2));*/
  694.  
  695. Render::Polygon(4, Verts2, Color(255, 255, 255, 40));
  696.  
  697. }
  698.  
  699. // Cleans the internal class name up to something human readable and nice
  700. std::string CleanItemName(std::string name)
  701. {
  702. std::string Name = name;
  703. // Tidy up the weapon Name
  704. if (Name[0] == 'C')
  705. Name.erase(Name.begin());
  706.  
  707. // Remove the word Weapon
  708. auto startOfWeap = Name.find("Weapon");
  709. if (startOfWeap != std::string::npos)
  710. Name.erase(Name.begin() + startOfWeap, Name.begin() + startOfWeap + 6);
  711.  
  712. return Name;
  713. }
  714.  
  715. // Anything else: weapons, class state? idk
  716. void CEsp::DrawInfo(IClientEntity* pEntity, CEsp::ESPBox size)
  717. {
  718. std::vector<std::string> Info;
  719.  
  720. // Player Weapon ESP
  721. IClientEntity* pWeapon = Interfaces::EntList->GetClientEntityFromHandle((HANDLE)pEntity->GetActiveWeaponHandle());
  722. if (Menu::Window.VisualsTab.OptionsWeapon.GetState() && pWeapon)
  723. {
  724. ClientClass* cClass = (ClientClass*)pWeapon->GetClientClass();
  725. if (cClass)
  726. {
  727. // Draw it
  728. Info.push_back(CleanItemName(cClass->m_pNetworkName));
  729. }
  730. }
  731.  
  732. // Bomb Carrier
  733. if (Menu::Window.VisualsTab.OptionsInfo.GetState() && pEntity == BombCarrier)
  734. {
  735. Info.push_back("C4 Carrier");
  736. }
  737.  
  738.  
  739. static RECT Size = Render::GetTextSize(Render::Fonts::Default, "Hi");
  740. int i = 0;
  741. for (auto Text : Info)
  742. {
  743.  
  744.  
  745. Render::Text(size.x + size.w + 3, size.y + (i*(Size.bottom + 2)), Color(255, 255, 255, 255), Render::Fonts::ESP, Text.c_str());
  746.  
  747.  
  748. i++;
  749. }
  750. }
  751.  
  752. void CEsp::DrawHealth2(IClientEntity* pEntity, CEsp::ESPBox size)
  753. {
  754. ESPBox HealthBar = size;
  755. HealthBar.y += (HealthBar.h + 20);
  756. HealthBar.h = 4;
  757.  
  758. float HealthValue = pEntity->GetHealth();
  759. float HealthPerc = HealthValue / 100.f;
  760. float Width = (size.w * HealthPerc);
  761. HealthBar.w = Width;
  762.  
  763. int health = pEntity->GetHealth();
  764.  
  765. if (health > 100)
  766. health = 100;
  767.  
  768. int r = 255 - health * 2.55;
  769. int g = health * 2.55;
  770.  
  771. int healthBar = size.h / 100 * health;
  772. int healthBarDelta = size.h - healthBar;
  773.  
  774. //int iClampedHealth = pEntity->GetHealth();
  775. // if (iClampedHealth >= 100)
  776. // iClampedHealth = 100;
  777.  
  778. Render::Outline(size.x - 4, size.y + 1, 1, size.h * 0.01 * health, Color(r, g, 0, 255));
  779. Render::Outline(size.x - 5, size.y - 1, 3, size.h + 2, Color(0, 0, 0, 150));
  780. }
  781.  
  782. // Little cross on their heads
  783. void CEsp::DrawCross(IClientEntity* pEntity)
  784. {
  785. Vector cross = pEntity->GetHeadPos(), screen;
  786. static int Scale = 2;
  787. if (Render::WorldToScreen(cross, screen))
  788. {
  789. Render::Clear(screen.x - Scale, screen.y - (Scale * 2), (Scale * 2), (Scale * 4), Color(20, 20, 20, 160));
  790. Render::Clear(screen.x - (Scale * 2), screen.y - Scale, (Scale * 4), (Scale * 2), Color(20, 20, 20, 160));
  791. Render::Clear(screen.x - Scale - 1, screen.y - (Scale * 2) - 1, (Scale * 2) - 2, (Scale * 4) - 2, Color(250, 250, 250, 160));
  792. Render::Clear(screen.x - (Scale * 2) - 1, screen.y - Scale - 1, (Scale * 4) - 2, (Scale * 2) - 2, Color(250, 250, 250, 160));
  793. }
  794. }
  795.  
  796. // Draws a dropped CS:GO Item
  797. void CEsp::DrawDrop(IClientEntity* pEntity, ClientClass* cClass)
  798. {
  799. Vector Box;
  800. CBaseCombatWeapon* Weapon = (CBaseCombatWeapon*)pEntity;
  801. IClientEntity* plr = Interfaces::EntList->GetClientEntityFromHandle((HANDLE)Weapon->GetOwnerHandle());
  802. if (!plr && Render::WorldToScreen(Weapon->GetOrigin(), Box))
  803. {
  804. if (Menu::Window.VisualsTab.OptionsBox.GetState())
  805. {
  806. Render::Outline(Box.x - 2, Box.y - 2, 4, 4, Color(255, 255, 255, 255));
  807. Render::Outline(Box.x - 3, Box.y - 3, 6, 6, Color(10, 10, 10, 150));
  808. }
  809.  
  810. if (Menu::Window.VisualsTab.OptionsInfo.GetState())
  811. {
  812. std::string ItemName = CleanItemName(cClass->m_pNetworkName);
  813. RECT TextSize = Render::GetTextSize(Render::Fonts::ESP, ItemName.c_str());
  814. Render::Text(Box.x - (TextSize.right / 2), Box.y - 16, Color(255, 255, 255, 255), Render::Fonts::ESP, ItemName.c_str());
  815. }
  816. }
  817. }
  818.  
  819. // Draws a chicken
  820. void CEsp::DrawChicken(IClientEntity* pEntity, ClientClass* cClass)
  821. {
  822. ESPBox Box;
  823.  
  824. if (GetBox(pEntity, Box))
  825. {
  826. player_info_t pinfo; strcpy_s(pinfo.name, "Chicken");
  827. if (Menu::Window.VisualsTab.OptionsBox.GetState())
  828. DrawBox(Box, Color(255,255,255,255));
  829.  
  830. if (Menu::Window.VisualsTab.OptionsName.GetState())
  831. DrawName(pinfo, Box, pEntity);
  832. }
  833. }
  834.  
  835. // Draw the planted bomb and timer
  836. void CEsp::DrawBombPlanted(IClientEntity* pEntity, ClientClass* cClass)
  837. {
  838. // Null it out incase bomb has been dropped or planted
  839. BombCarrier = nullptr;
  840.  
  841. Vector vOrig; Vector vScreen;
  842. vOrig = pEntity->GetOrigin();
  843. CCSBomb* Bomb = (CCSBomb*)pEntity;
  844.  
  845. if (Render::WorldToScreen(vOrig, vScreen))
  846. {
  847.  
  848. ESPBox Box;
  849. GetBox(pEntity, Box);
  850. DrawBox(Box, Color(250, 42, 42, 255));
  851. float flBlow = Bomb->GetC4BlowTime();
  852. float TimeRemaining = flBlow - (Interfaces::Globals->interval_per_tick * hackManager.pLocal()->GetTickBase());
  853. float TimeRemaining2;
  854. bool exploded = true;
  855. if (TimeRemaining < 0)
  856. {
  857. !exploded;
  858.  
  859. TimeRemaining2 = 0;
  860. }
  861. else
  862. {
  863. exploded = true;
  864. TimeRemaining2 = TimeRemaining;
  865. }
  866. char buffer[64];
  867. if (exploded)
  868. {
  869. sprintf_s(buffer, "Bomb: %.1f", TimeRemaining2);
  870. }
  871. else
  872. {
  873. sprintf_s(buffer, "Bomb Undefusable", TimeRemaining2);
  874. }
  875. Render::Text(vScreen.x, vScreen.y, Color(0, 255, 50, 255), Render::Fonts::ESP, buffer);
  876. }
  877. }
  878.  
  879. // Draw the bomb if it's dropped, or store the player who's carrying
  880. void CEsp::DrawBomb(IClientEntity* pEntity, ClientClass* cClass)
  881. {
  882. // Null it out incase bomb has been dropped or planted
  883. BombCarrier = nullptr;
  884. CBaseCombatWeapon *BombWeapon = (CBaseCombatWeapon *)pEntity;
  885. Vector vOrig; Vector vScreen;
  886. vOrig = pEntity->GetOrigin();
  887. bool adopted = true;
  888. HANDLE parent = BombWeapon->GetOwnerHandle();
  889. if (parent || (vOrig.x == 0 && vOrig.y == 0 && vOrig.z == 0))
  890. {
  891. IClientEntity* pParentEnt = (Interfaces::EntList->GetClientEntityFromHandle(parent));
  892. if (pParentEnt && pParentEnt->IsAlive())
  893. {
  894. BombCarrier = pParentEnt;
  895. adopted = false;
  896. }
  897. }
  898.  
  899. if (adopted)
  900. {
  901. if (Render::WorldToScreen(vOrig, vScreen))
  902. {
  903. ESPBox Box;
  904. GetBox(pEntity, Box);
  905. DrawBox(Box, Color(112, 230, 20, 255));
  906. Render::Text(vScreen.x, vScreen.y, Color(112, 230, 20, 255), Render::Fonts::ESP, "Bomb");
  907. }
  908. }
  909. }
  910.  
  911. void DrawBoneArray(int* boneNumbers, int amount, IClientEntity* pEntity, Color color)
  912. {
  913. Vector LastBoneScreen;
  914. for (int i = 0; i < amount; i++)
  915. {
  916. Vector Bone = pEntity->GetBonePos(boneNumbers[i]);
  917. Vector BoneScreen;
  918.  
  919. if (Render::WorldToScreen(Bone, BoneScreen))
  920. {
  921. if (i>0)
  922. {
  923. Render::Line(LastBoneScreen.x, LastBoneScreen.y, BoneScreen.x, BoneScreen.y, color);
  924. }
  925. }
  926. LastBoneScreen = BoneScreen;
  927. }
  928. }
  929.  
  930. void DrawBoneTest(IClientEntity *pEntity)
  931. {
  932. for (int i = 0; i < 127; i++)
  933. {
  934. Vector BoneLoc = pEntity->GetBonePos(i);
  935. Vector BoneScreen;
  936. if (Render::WorldToScreen(BoneLoc, BoneScreen))
  937. {
  938. char buf[10];
  939. _itoa_s(i, buf, 10);
  940. Render::Text(BoneScreen.x, BoneScreen.y, Color(255, 255, 255, 180), Render::Fonts::ESP, buf);
  941. }
  942. }
  943. }
  944.  
  945. void CEsp::DrawSkeleton(IClientEntity* pEntity)
  946. {
  947. studiohdr_t* pStudioHdr = Interfaces::ModelInfo->GetStudiomodel(pEntity->GetModel());
  948.  
  949. if (!pStudioHdr)
  950. return;
  951.  
  952. Vector vParent, vChild, sParent, sChild;
  953.  
  954. for (int j = 0; j < pStudioHdr->numbones; j++)
  955. {
  956. mstudiobone_t* pBone = pStudioHdr->GetBone(j);
  957.  
  958. if (pBone && (pBone->flags & BONE_USED_BY_HITBOX) && (pBone->parent != -1))
  959. {
  960. vChild = pEntity->GetBonePos(j);
  961. vParent = pEntity->GetBonePos(pBone->parent);
  962.  
  963. if (Render::WorldToScreen(vParent, sParent) && Render::WorldToScreen(vChild, sChild))
  964. {
  965. Render::Line(sParent[0], sParent[1], sChild[0], sChild[1], Color(255,255,255,255));
  966. }
  967. }
  968. }
  969. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement