SHARE
TWEET

Untitled

a guest Feb 20th, 2020 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "ESP.h"
  2. #include "..\Utils\Utils.h"
  3. #include "..\SDK\IVEngineClient.h"
  4. #include "..\SDK\PlayerInfo.h"
  5. #include "..\SDK\Materials.h"
  6. #include "..\SDK\IVModelInfo.h"
  7. ESP g_ESP;
  8.  
  9. float dormanttime = 0.f;
  10. float flHurtTime = 0.f;
  11.  
  12. void ESP::set_hitmarker_time(float time)
  13. {
  14.     flHurtTime = time;
  15. }
  16.  
  17.  
  18.  
  19. void ESP::DrawHitmarker()
  20. {
  21. /*  auto local_player = g_pEntityList->GetClientEntity(g_pEngine->GetLocalPlayer());
  22.  
  23.     if (!local_player)
  24.         return;
  25.  
  26.     if (local_player->GetHealth() <= 0)
  27.         return;
  28.  
  29.     static int lineSize = 4.25;
  30.  
  31.  
  32.     if (g_pGlobalVars->realtime - g::flHurtTime < .3f)
  33.         alpha = 255.f;
  34.     else
  35.         alpha -= step;
  36.  
  37.     if (alpha > 0)
  38.     {
  39.         int screenSizeX, screenCenterX;
  40.         int screenSizeY, screenCenterY;
  41.         g_pEngine->GetScreenSize(screenSizeX, screenSizeY);
  42.  
  43.         screenCenterX = screenSizeX / 2;
  44.         screenCenterY = screenSizeY / 2;
  45.         Color col = Color(240, 240, 240, alpha);
  46.         g_Render.Line(screenCenterX - lineSize * 2, screenCenterY - lineSize * 2, screenCenterX - (lineSize), screenCenterY - (lineSize), col);
  47.         g_Render.Line(screenCenterX - lineSize * 2, screenCenterY + lineSize * 2, screenCenterX - (lineSize), screenCenterY + (lineSize), col);
  48.         g_Render.Line(screenCenterX + lineSize * 2, screenCenterY + lineSize * 2, screenCenterX + (lineSize), screenCenterY + (lineSize), col);
  49.         g_Render.Line(screenCenterX + lineSize * 2, screenCenterY - lineSize * 2, screenCenterX + (lineSize), screenCenterY - (lineSize), col);
  50.     }*/
  51. }
  52.  
  53. void ESP::SpectatorList()
  54. {
  55.  
  56. }
  57.  
  58. void ESP::RenderBox(C_BaseEntity* pEnt)
  59. {
  60.     Vector vecScreenOrigin, vecOrigin = pEnt->GetRenderOrigin();
  61.     if (!Utils::WorldToScreen(vecOrigin, vecScreenOrigin))
  62.         return;
  63.  
  64.     Vector vecScreenBottom, vecBottom = vecOrigin;
  65.     vecBottom.z += (pEnt->GetFlags() & FL_DUCKING) ? 54.f : 72.f;
  66.     if (!Utils::WorldToScreen(vecBottom, vecScreenBottom))
  67.         return;
  68.  
  69.     const auto sx = int(std::roundf(vecScreenOrigin.x)),
  70.         sy = int(std::roundf(vecScreenOrigin.y)),
  71.         h = int(std::roundf(vecScreenBottom.y - vecScreenOrigin.y)),
  72.         w = int(std::roundf(h * 0.25f));
  73.  
  74.     /* Draw rect around the entity */
  75.     g_Render.Rect(sx - w, sy, sx + w, sy + h, g_Settings.boxcolor(255));
  76.  
  77.     /* Draw rect outline */
  78.     g_Render.Rect(sx - w - 1, sy - 1, sx + w + 1, sy + h + 1, Color(0, 0, 0, 100));
  79.     g_Render.Rect(sx - w + 1, sy + 1, sx + w - 1, sy + h - 1, Color(0, 0, 0, 100));
  80. }
  81.  
  82. void ESP::RenderHealth(C_BaseEntity* pEnt)
  83. {
  84.     Vector vecScreenOrigin, vecOrigin = pEnt->GetRenderOrigin();
  85.     if (!Utils::WorldToScreen(vecOrigin, vecScreenOrigin))
  86.         return;
  87.  
  88.     Vector vecScreenBottom, vecBottom = vecOrigin;
  89.     vecBottom.z += (pEnt->GetFlags() & FL_DUCKING) ? 54.f : 72.f;
  90.     if (!Utils::WorldToScreen(vecBottom, vecScreenBottom))
  91.         return;
  92.  
  93.     const auto sx = int(std::roundf(vecScreenOrigin.x)),
  94.         sy = int(std::roundf(vecScreenOrigin.y)),
  95.         h = int(std::roundf(vecScreenBottom.y - vecScreenOrigin.y)),
  96.         w = int(std::roundf(h * 0.25f));
  97.  
  98.     int HPEnemy = 100;
  99.     HPEnemy = pEnt->GetHealth();
  100.     char nameBuffer[512];
  101.     sprintf_s(nameBuffer, "%d", HPEnemy);
  102.     if (HPEnemy > 100)
  103.         HPEnemy = 100;
  104.  
  105.     if (HPEnemy >= 100)
  106.     {
  107.         g_Render.String(sx + w - 8.5, sy + h, CD3DFONT_CENTERED_X | CD3DFONT_DROPSHADOW,
  108.             (localTeam == pEnt->GetTeam()) ? teamColor : enemyColor,
  109.             g_Fonts.pFontSmallestPixel7.get(), nameBuffer);
  110.     }
  111.     else if (HPEnemy < 100)
  112.     {
  113.         g_Render.String(sx + w - 6.5, sy + h, CD3DFONT_CENTERED_X | CD3DFONT_DROPSHADOW,
  114.             (localTeam == pEnt->GetTeam()) ? teamColor : enemyColor,
  115.             g_Fonts.pFontSmallestPixel7.get(), nameBuffer);
  116.     }
  117.     else if (HPEnemy < 10)
  118.     {
  119.         g_Render.String(sx + w, sy + h, CD3DFONT_CENTERED_X | CD3DFONT_DROPSHADOW,
  120.             (localTeam == pEnt->GetTeam()) ? teamColor : enemyColor,
  121.             g_Fonts.pFontSmallestPixel7.get(), nameBuffer);
  122.     }
  123. }
  124.  
  125. void ESP::RenderHealthBar(C_BaseEntity* pEnt)
  126. {
  127.     Vector vecScreenOrigin, vecOrigin = pEnt->GetRenderOrigin();
  128.     if (!Utils::WorldToScreen(vecOrigin, vecScreenOrigin))
  129.         return;
  130.  
  131.     Vector vecScreenBottom, vecBottom = vecOrigin;
  132.     vecBottom.z += (pEnt->GetFlags() & FL_DUCKING) ? 54.f : 72.f;
  133.     if (!Utils::WorldToScreen(vecBottom, vecScreenBottom))
  134.         return;
  135.  
  136.     const auto sx = int(std::roundf(vecScreenOrigin.x)),
  137.         sy = int(std::roundf(vecScreenOrigin.y)),
  138.         h = int(std::roundf(vecScreenBottom.y - vecScreenOrigin.y)),
  139.         w = int(std::roundf(h * 0.25f));
  140.  
  141.     int enemyHp = pEnt->GetHealth(),
  142.         hpRed = 255 - (enemyHp * 2.55),
  143.         hpGreen = enemyHp * 2.55;
  144.  
  145.     if (enemyHp > 100)
  146.         enemyHp = 100;
  147.  
  148.     UINT hp = h - (UINT)((h * enemyHp) / 100);
  149.  
  150.     g_Render.RectFilled(sx + w - 3, sy + 2, sx + w - 7, sy + h - 2, Color(0, 0, 0, 100));
  151.     g_Render.Rect(sx + w - 5, sy, sx + w - 5, sy + h - hp, Color(hpRed, hpGreen, 1, 255));
  152.  
  153.     std::string s = std::to_string(enemyHp);
  154.     char const *pchar = s.c_str();
  155.  
  156.     if (pEnt->GetHealth() < 100)
  157.     {
  158.         g_Render.String(sx + w - 5, sy + h - hp, CD3DFONT_CENTERED_Y | CD3DFONT_CENTERED_X | CD3DFONT_DROPSHADOW, (localTeam == pEnt->GetTeam()) ? teamColor : enemyColor, g_Fonts.pFontSmallestPixel7.get(), pchar);
  159.     }
  160. }
  161.  
  162. bool IsWeaponGrenade5(C_BaseCombatWeapon* weapon)
  163. {
  164.     if (weapon == nullptr) return false;
  165.     int id = weapon->sGetItemDefinitionIndex();
  166.     static const std::vector<int> v = { WEAPON_FLASHBANG,WEAPON_HEGRENADE,WEAPON_SMOKEGRENADE,WEAPON_MOLOTOV,WEAPON_DECOY,WEAPON_INCGRENADE };
  167.     return (std::find(v.begin(), v.end(), id) != v.end());
  168. }
  169.  
  170. bool IsKnife4(C_BaseCombatWeapon* pWeapon)
  171. {
  172.     if (pWeapon == nullptr) return false;
  173.     int id = pWeapon->sGetItemDefinitionIndex();
  174.     static const std::vector<int> v = { WEAPON_KNIFE_BAYONET, WEAPON_KNIFE_SURVIVAL_BOWIE, WEAPON_KNIFE_BUTTERFLY, WEAPON_KNIFE_FALCHION, WEAPON_KNIFE_FLIP, WEAPON_KNIFE_GUT, WEAPON_KNIFE_KARAMBIT, WEAPON_KNIFE_M9_BAYONET, WEAPON_KNIFE_PUSH, WEAPON_KNIFE_TACTICAL , WEAPON_KNIFE, WEAPON_KNIFE_T };
  175.     return (std::find(v.begin(), v.end(), id) != v.end());
  176. }
  177.  
  178. void ESP::RenderAmmo(C_BaseEntity* pEnt)
  179. {
  180.     Vector vecScreenPos, vecOrigin = pEnt->GetRenderOrigin();
  181.     if (!Utils::WorldToScreen(vecOrigin, vecScreenPos))
  182.         return;
  183.  
  184.     Vector vecScreenBottom, vecBottom = vecOrigin;
  185.     vecBottom.z += (pEnt->GetFlags() & FL_DUCKING) ? 54.f : 72.f;
  186.     if (!Utils::WorldToScreen(vecBottom, vecScreenBottom))
  187.         return;
  188.  
  189.     const auto sx = int(std::roundf(vecScreenPos.x)),
  190.         sy = int(std::roundf(vecScreenPos.y)),
  191.         h = int(std::roundf(vecScreenBottom.y - vecScreenPos.y)),
  192.         w = int(std::roundf(h * 0.25f));
  193.  
  194.     C_BaseCombatWeapon* weapon = pEnt->GetActiveWeapon();
  195.     if (!weapon)
  196.         return;
  197.  
  198.     auto animLayer = pEnt->GetAnimOverlay(1);
  199.     if (!animLayer.m_pOwner)
  200.         return;
  201.  
  202.     auto activity = pEnt->GetSequenceActivity(animLayer.m_nSequence);
  203.  
  204.     if (!activity)
  205.         return;
  206.  
  207.     int ammo1 = weapon->GetAmmo();
  208.  
  209.     //  if (!ammo1)
  210.     //      return;
  211.  
  212.     if (ammo1 < 0)
  213.         return;
  214.  
  215.     int max_clip = weapon->GetCSWpnData()->iMaxClip1;
  216.  
  217.     int ammo = 0;
  218.  
  219.     ammo = w - (int)((w * ammo1) / max_clip);
  220.  
  221.     std::string s = std::to_string(ammo1);
  222.     char const *pchar = s.c_str();
  223.  
  224.     int visibleammo = max_clip / 4;
  225.  
  226.     if (activity == 967 && animLayer.m_flWeight != 0.f)
  227.     {
  228.         float cycle = animLayer.m_flCycle; // 1 = finished 0 = just started
  229.         ammo = w - (int)((w* cycle) / 1.f);
  230.     }
  231.     else
  232.     {
  233.         if (ammo1 <= visibleammo)
  234.             g_Render.String(sx - w - 1 + ammo * 2, sy + 10, CD3DFONT_CENTERED_Y | CD3DFONT_CENTERED_X | CD3DFONT_DROPSHADOW, localTeam == pEnt->GetTeam() ? teamColor : enemyColor, g_Fonts.pFontSmallestPixel7.get(), pchar);
  235.     }
  236.  
  237.     g_Render.RectFilled(sx + w - 2, sy + 3, sx - w + 2, sy + 7, Color(0, 0, 0, 100));
  238.     g_Render.Rect(sx + w - 1, sy + 4, sx - w + 1 + ammo * 2, sy + 6, g_Settings.ammocolor(255));
  239.  
  240.  
  241.     //sx + w - 5, sy, sx + w - 5, sy + h - hp, Color(hpRed, hpGreen, 1, pEnt->IsDormant() ? 100 : 255));
  242.     /*
  243.     std::string am = "(" + std::to_string(ammo1) + " / " + std::to_string(ammo2) + ")";
  244.  
  245.     if (!g_Settings.bShowWeaponName && !g_Settings.bShowWeaponIcon)
  246.     {
  247.         g_Render.String(vecScreenPos.x, vecScreenPos.y + 2, CD3DFONT_CENTERED_X | CD3DFONT_DROPSHADOW,
  248.             (localTeam == pEnt->GetTeam()) ? teamColor : enemyColor,
  249.             g_Fonts.pFontRando.get(), am.c_str());
  250.     }
  251.     else if (g_Settings.bShowWeaponName && !g_Settings.bShowWeaponIcon)
  252.     {
  253.         g_Render.String(vecScreenPos.x, vecScreenPos.y + 12, CD3DFONT_CENTERED_X | CD3DFONT_DROPSHADOW,
  254.             (localTeam == pEnt->GetTeam()) ? teamColor : enemyColor,
  255.             g_Fonts.pFontRando.get(), am.c_str());
  256.     }
  257.     else if (g_Settings.bShowWeaponName && g_Settings.bShowWeaponIcon)
  258.     {
  259.         g_Render.String(vecScreenPos.x, vecScreenPos.y + 22, CD3DFONT_CENTERED_X | CD3DFONT_DROPSHADOW,
  260.             (localTeam == pEnt->GetTeam()) ? teamColor : enemyColor,
  261.             g_Fonts.pFontRando.get(), am.c_str());
  262.     }
  263.     else if (!g_Settings.bShowWeaponName && g_Settings.bShowWeaponIcon)
  264.     {
  265.         g_Render.String(vecScreenPos.x, vecScreenPos.y + 14, CD3DFONT_CENTERED_X | CD3DFONT_DROPSHADOW,
  266.             (localTeam == pEnt->GetTeam()) ? teamColor : enemyColor,
  267.             g_Fonts.pFontRando.get(), am.c_str());
  268.     }*/
  269. }
  270.  
  271. void ESP::RenderName(C_BaseEntity* pEnt, int iterator)
  272. {
  273.     Vector vecScreenOrigin, vecOrigin = pEnt->GetRenderOrigin();
  274.     if (!Utils::WorldToScreen(vecOrigin, vecScreenOrigin))
  275.         return;
  276.  
  277.     Vector vecScreenBottom, vecBottom = vecOrigin;
  278.     vecBottom.z += (pEnt->GetFlags() & FL_DUCKING) ? 54.f : 72.f;
  279.     if (!Utils::WorldToScreen(vecBottom, vecScreenBottom))
  280.         return;
  281.  
  282.  
  283.     PlayerInfo_t pInfo;
  284.     g_pEngine->GetPlayerInfo(iterator, &pInfo);
  285.  
  286.     auto sx = int(std::roundf(vecScreenOrigin.x)),
  287.         sy = int(std::roundf(vecScreenOrigin.y)),
  288.         h = int(std::roundf(vecScreenBottom.y - vecScreenOrigin.y));
  289.  
  290.     g_Render.String(sx, sy + h - 12, CD3DFONT_CENTERED_X | CD3DFONT_DROPSHADOW, g_Settings.namecolor, g_Fonts.pFontSmallestPixel7.get(), pInfo.szName);
  291. }
  292.  
  293. void ESP::RenderWeaponName(C_BaseEntity* pEnt)
  294. {
  295.     Vector vecScreenOrigin, vecOrigin = pEnt->GetRenderOrigin();
  296.     if (!Utils::WorldToScreen(vecOrigin, vecScreenOrigin))
  297.         return;
  298.  
  299.     C_BaseCombatWeapon* weapon = pEnt->GetActiveWeapon();
  300.     if (!weapon)
  301.         return;
  302.  
  303.     int ammo = weapon->GetAmmo();
  304.     bool ya = false;
  305.     if (ammo < 0)
  306.         ya = true;
  307.  
  308.     if (g_Settings.WeaponName && !g_Settings.WeaponIcon)
  309.     {
  310.         if (ya)
  311.         {
  312.             g_Render.String(int(vecScreenOrigin.x), int(vecScreenOrigin.y) + 1, CD3DFONT_CENTERED_X | CD3DFONT_DROPSHADOW,
  313.                 (pEnt->GetTeam() == localTeam ? teamColor : enemyColor(255)),
  314.                 g_Fonts.pFontSmallestPixel7.get(), weapon->GetWeaponName());
  315.         }
  316.         else
  317.         {
  318.             g_Render.String(int(vecScreenOrigin.x), int(vecScreenOrigin.y) + 6, CD3DFONT_CENTERED_X | CD3DFONT_DROPSHADOW,
  319.                 (pEnt->GetTeam() == localTeam ? teamColor : enemyColor(255)),
  320.                 g_Fonts.pFontSmallestPixel7.get(), weapon->GetWeaponName());
  321.         }
  322.     }
  323.     else if (g_Settings.WeaponIcon && !g_Settings.WeaponName)
  324.     {
  325.         g_Render.String(int(vecScreenOrigin.x), int(vecScreenOrigin.y) + 13, CD3DFONT_CENTERED_X | CD3DFONT_DROPSHADOW,
  326.             (pEnt->GetTeam() == localTeam ? teamColor : enemyColor(255)),
  327.             g_Fonts.pFontIcons.get(), weapon->GunIconCustom());
  328.     }
  329.     else if (g_Settings.WeaponName && g_Settings.WeaponIcon)
  330.     {
  331.         if (ya)
  332.         {
  333.             g_Render.String(int(vecScreenOrigin.x), int(vecScreenOrigin.y) + 1, CD3DFONT_CENTERED_X | CD3DFONT_DROPSHADOW,
  334.                 (pEnt->GetTeam() == localTeam ? teamColor : enemyColor(255)),
  335.                 g_Fonts.pFontSmallestPixel7.get(), weapon->GetWeaponName());
  336.  
  337.             g_Render.String(int(vecScreenOrigin.x), int(vecScreenOrigin.y) + 16, CD3DFONT_CENTERED_X | CD3DFONT_DROPSHADOW,
  338.                 (pEnt->GetTeam() == localTeam ? teamColor : enemyColor(255)),
  339.                 g_Fonts.pFontIcons.get(), weapon->GunIconCustom());
  340.         }
  341.         else
  342.         {
  343.             g_Render.String(int(vecScreenOrigin.x), int(vecScreenOrigin.y) + 6, CD3DFONT_CENTERED_X | CD3DFONT_DROPSHADOW,
  344.                 (pEnt->GetTeam() == localTeam ? teamColor :enemyColor(255)),
  345.                 g_Fonts.pFontSmallestPixel7.get(), weapon->GetWeaponName());
  346.  
  347.             g_Render.String(int(vecScreenOrigin.x), int(vecScreenOrigin.y) + 19, CD3DFONT_CENTERED_X | CD3DFONT_DROPSHADOW,
  348.                 (pEnt->GetTeam() == localTeam ? teamColor : enemyColor(255)),
  349.                 g_Fonts.pFontIcons.get(), weapon->GunIconCustom());
  350.         }
  351.     }
  352. }
  353.  
  354. void ESP::DrawSkeleton(C_BaseEntity* pEntity)
  355. {
  356. }
  357.  
  358. void ESP::DroppedWeapons(C_BaseEntity * entity)
  359. {
  360.     Vector vecScreenPos, vecOrigin = entity->GetRenderOrigin();
  361.     if (!Utils::WorldToScreen(vecOrigin, vecScreenPos))
  362.         return;
  363.  
  364.     Vector vecScreenBottom, vecBottom = vecOrigin;
  365.     vecBottom.z += (entity->GetFlags() & FL_DUCKING) ? 54.f : 72.f;
  366.     if (!Utils::WorldToScreen(vecBottom, vecScreenBottom))
  367.         return;
  368.  
  369.     const auto sx = int(std::roundf(vecScreenPos.x)),
  370.         sy = int(std::roundf(vecScreenPos.y)),
  371.         h = int(std::roundf(vecScreenBottom.y - vecScreenPos.y)),
  372.         w = int(std::roundf(h * 0.25f));
  373.  
  374.     auto * weapon = reinterpret_cast<C_BaseCombatWeapon*>(entity);
  375.  
  376.     if (!weapon)
  377.         return;
  378.  
  379.     if (weapon->IsDormant())
  380.         return;
  381.  
  382.     auto class_id = entity->GetClientClass()->m_ClassID;
  383.  
  384.     if (class_id == (int)EClassIds::CBaseCSGrenadeProjectile || class_id == (int)EClassIds::CMolotovProjectile
  385.         || class_id == (int)EClassIds::CDecoyProjectile || class_id == (int)EClassIds::CSmokeGrenadeProjectile
  386.         || class_id == (int)EClassIds::CSensorGrenadeProjectile || class_id == (int)EClassIds::CBreachChargeProjectile)
  387.         return;
  388.  
  389.     if (weapon && !(entity->GetVecOrigin().x == 0 && entity->GetVecOrigin().y == 0 && entity->GetVecOrigin().z == 0))
  390.     {
  391.         WeaponInfo_t* weapon_data = weapon->GetCSWpnData();
  392.  
  393.         if (!weapon_data)
  394.             return;
  395.  
  396.         std::string weaponName = weapon->GetWeaponName();
  397.  
  398.         int ammo1 = weapon->GetAmmo();
  399.  
  400.         if (ammo1 < 0)
  401.             return;
  402.  
  403.         int max_clip = weapon->GetCSWpnData()->iMaxClip1;
  404.  
  405.         int ammo = 0;
  406.  
  407.         ammo = w - (int)((w * ammo1) / max_clip);
  408.  
  409.         if (g_Settings.bDroppedItems[0])
  410.             g_Render.String(sx, sy + 9, CD3DFONT_CENTERED_X | CD3DFONT_DROPSHADOW, Color(255,255,255), g_Fonts.pFontSmallestPixel7.get(), weaponName.c_str());
  411.  
  412.         if (g_Settings.bDroppedItems[1])
  413.         {
  414.             g_Render.RectFilled(sx + w - 2, sy + 7, sx - w + 1, sy + 11, Color(0, 0, 0, 100));
  415.             g_Render.Rect(sx + w - 1, sy + 8, sx - w + ammo * 2, sy + 10, g_Settings.droppedweaponname(255));
  416.         }
  417.     }
  418. }
  419.  
  420. void ESP::DrawProjectiles(C_BaseEntity * entity)
  421. {
  422.     const model_t* model = entity->GetModel();
  423.  
  424.     if (!model)
  425.         return;
  426.  
  427.  
  428.     const studiohdr_t* hdr = g_pModelInfo->GetStudiomodel(model);
  429.  
  430.     if (!hdr)
  431.         return;
  432.  
  433.     const auto client_class = entity->GetClientClass();
  434.  
  435.     if (!client_class)
  436.         return;
  437.  
  438.     std::string to_render = "error";
  439.  
  440.     switch (client_class->m_ClassID)
  441.     {
  442.     case (int)EClassIds::CMolotovProjectile:
  443.         to_render = "K";
  444.         break;
  445.     case (int)EClassIds::CSmokeGrenadeProjectile:
  446.         to_render = "J";
  447.         break;
  448.     case (int)EClassIds::CDecoyProjectile:
  449.         to_render = "L";
  450.         break;
  451.     case (int)EClassIds::CBaseCSGrenadeProjectile:
  452.         if (hdr->name[16] == 's')
  453.             to_render = "H";
  454.         else
  455.             to_render = "I";
  456.         break;
  457.     default:
  458.         break;
  459.     }
  460.  
  461.     Vector screen;
  462.  
  463.     if (Utils::WorldToScreen(entity->GetAbsOrigin(), screen))
  464.     {
  465.         g_Render.String(screen.x, screen.y + 5, CD3DFONT_CENTERED_X | CD3DFONT_DROPSHADOW, Color(255,255,255), g_Fonts.pFontIcons13.get(), to_render.c_str());
  466.     }
  467. }
  468. void ESP::Render()
  469. {
  470.     if (!g::pLocalEntity || !g_pEngine->IsInGame())
  471.         return;
  472.  
  473.     localTeam = g::pLocalEntity->GetTeam();
  474.  
  475.     for (int it = 1; it <= g_pEngine->GetMaxClients(); ++it)
  476.     {
  477.         C_BaseEntity* pPlayerEntity = g_pEntityList->GetClientEntity(it);
  478.  
  479.         if (!pPlayerEntity
  480.             || !pPlayerEntity->IsAlive()
  481.             || pPlayerEntity == g::pLocalEntity)
  482.             continue;
  483.  
  484.  
  485.         teamColor = Color(150, 200, 60, 255);
  486.         enemyColor = Color(230, 230, 230, 255);
  487.         Color ammocolor = Color(230, 230, 230, 255);
  488.  
  489.         if (g_Settings.boxEnable)
  490.             this->RenderBox(pPlayerEntity);
  491.  
  492.         if (g_Settings.Name)
  493.             this->RenderName(pPlayerEntity, it);
  494.  
  495.         if (g_Settings.Health)
  496.             this->RenderHealthBar(pPlayerEntity);
  497.  
  498.         if (g_Settings.Ammo)
  499.             this->RenderAmmo(pPlayerEntity);
  500.  
  501.         this->RenderWeaponName(pPlayerEntity);
  502.  
  503.     }
  504.     for (auto i = 0; i < g_pEntityList->GetHighestEntityIndex(); i++)
  505.     {
  506.         C_BaseEntity* entity = g_pEntityList->GetClientEntity(i);
  507.  
  508.         if (!entity || !g::pLocalEntity)
  509.             continue;
  510.  
  511.         const auto class_id = entity->GetClientClass();
  512.  
  513.         if ((strstr(class_id->pNetworkName, "Weapon") || class_id->m_ClassID == (int)EClassIds::CDEagle || class_id->m_ClassID == (int)EClassIds::CAK47))
  514.             this->DroppedWeapons(entity);
  515.  
  516.         if (class_id->m_ClassID == (int)EClassIds::CMolotovProjectile || class_id->m_ClassID == (int)EClassIds::CSmokeGrenadeProjectile
  517.             || class_id->m_ClassID == (int)EClassIds::CDecoyProjectile || class_id->m_ClassID == (int)EClassIds::CBaseCSGrenadeProjectile)
  518.             DrawProjectiles(entity);
  519.     }
  520.  
  521.     //SpectatorList();
  522.  
  523. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top