Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Visuals::Misc::RenderPlantedC4(C_BasePlayer* entity)
- {
- Vector vOrig; Vector vScreen;
- vOrig = entity->m_vecOrigin();
- CCSBomb* Bomb = (CCSBomb*)entity;
- if (!Bomb) return;
- float flBlow = Bomb->GetC4BlowTime();
- float lifetime = flBlow - (gpHC_GlobalVars->interval_per_tick * gpHC_LocalPlayer->m_nTickBase());
- float countdown = Bomb->GetC4DefuseCountDown() - (gpHC_LocalPlayer->m_nTickBase() * gpHC_GlobalVars->interval_per_tick);
- if (Bomb->IsBombDefused()) return;
- float flDistance = gpHC_LocalPlayer->GetEyePos().DistTo(entity->GetEyePos());
- float a = 450.7f;
- float b = 75.68f;
- float c = 789.2f;
- float d = ((flDistance - b) / c);
- float flDamage = a * exp(-d * d) - 1;
- float damage = float((std::max)((int)ceilf(CSGO_Armor(flDamage, gpHC_LocalPlayer->m_ArmorValue())), 0));
- char buffer[32];
- char buffer2[32];
- char buffer3[32];
- sprintf(buffer, "Bomb: %.2f", lifetime);
- sprintf(buffer2, "Damage: %.0f", damage);
- sprintf(buffer3, "Defuse: %.2f", countdown);
- if (Math::WorldToScreen(vOrig, vScreen))
- {
- if (damage >= gpHC_LocalPlayer->m_iHealth())
- {
- Visuals::DrawString(defuse_font, vScreen.x, vScreen.y, Color(240, 30, 30), 2, buffer2);
- }
- else
- {
- Visuals::DrawString(defuse_font, vScreen.x, vScreen.y, Color(30, 240, 30), 2, buffer2);
- }
- if (Bomb->GetBombDefuser() > 0)
- {
- if (countdown > 0.01f)
- {
- if (lifetime > countdown)
- {
- Visuals::DrawString(defuse_font, vScreen.x, vScreen.y + 22, Color(30, 240, 30), 2, buffer3);
- }
- else
- {
- Visuals::DrawString(defuse_font, vScreen.x, vScreen.y + 22, Color(240, 30, 30), 2, buffer3);
- }
- }
- }
- Visuals::DrawString(defuse_font, vScreen.x, vScreen.y + 12, g_Options.color_esp_c4, 2, buffer);
- }
- int x, y;
- gpHC_EngineClient->GetScreenSize(x, y);
- if (damage >= gpHC_LocalPlayer->m_iHealth())
- {
- Visuals::DrawString(defuse_font, 40, y / 2 + 12, Color(240, 30, 30), 2, buffer2);
- }
- else
- {
- Visuals::DrawString(defuse_font, 40, y / 2 + 12, Color(30, 240, 30), 2, buffer2);
- }
- if (Bomb->GetBombDefuser() > 0)
- {
- if (countdown > 0.01f)
- {
- if (lifetime > countdown)
- {
- Visuals::DrawString(defuse_font, 40, y / 2 + 22, Color(30, 240, 30), 2, buffer3);
- }
- else
- {
- Visuals::DrawString(defuse_font, 40, y / 2 + 22, Color(240, 30, 30), 2, buffer3);
- }
- }
- }
- Visuals::DrawString(defuse_font, 40, y / 2, g_Options.color_esp_c4, 2, buffer);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement