..................................................
-
Автор темы
- #1
Вроде без щиткода, потому что спастил ну или спизиздил
SS
Индикатор бомбы только две нижних строчки, т.к оно там где и индикаторы
Код:
if (!g_cfg.esp.bomb_timer)
return;
if (!g_ctx.globals.bomb_timer_enable)
return;
static auto mp_c4timer = m_cvar()->FindVar(crypt_str("mp_c4timer"));
auto bomb = (CCSBomb*)entity;
auto c4timer = mp_c4timer->GetFloat();
auto bomb_timer = bomb->m_flC4Blow() - m_globals()->m_curtime;
if (bomb_timer < 0.0f)
return;
static int width, height;
m_engine()->GetScreenSize(width, height);
auto factor = bomb_timer / c4timer * height;
auto red_factor = (int)(255.0f - bomb_timer / c4timer * 255.0f);
auto green_factor = (int)(bomb_timer / c4timer * 255.0f);
Vector screen;
if (math::world_to_screen(entity->GetAbsOrigin(), screen))
render::get().text(fonts[ESP], screen.x, screen.y, Color(red_factor, green_factor, 0), HFONT_CENTERED_X | HFONT_CENTERED_Y, "BOMB");
auto site = bomb->m_nBombSite();
std::string time;
if (bomb->m_nBombSite() == 0)
{
time += "A STIE- ";
}
else if (bomb->m_nBombSite() == 1)
{
time += "B SITE - ";
}
time += std::to_string((int)(bomb_timer));
time += "s";
otheresp::get().m_indicators.push_back(m_indicator(time.c_str(), Color(255, 255, 255)));
float flDistance = g_ctx.local()->GetEyePosition().DistTo(entity->GetEyePosition());
float a = 450.7f;
float b = 75.68f;
float c = 789.2f;
float d = ((flDistance - b) / c);
float flDamage = a * exp(-d * d);
damage = float((std::max)((int)ceilf(CSGO_Armor(flDamage, g_ctx.local()->m_ArmorValue())), 0));
sprintf_s(bombdamagestringdead, sizeof(bombdamagestringdead) - 1, "");
std::string dmg;
dmg += "-";
dmg += std::to_string((int)(damage));
dmg += "HP";
Color clr;
if (damage >= g_ctx.local()->m_iHealth())
{
dmg = "FATAL";
clr = Color(255, 0, 0);
}
else
{
clr = Color(255, 255, 255);
}
otheresp::get().m_indicators.push_back(m_indicator(dmg.c_str(), clr));
if (math::world_to_screen(entity->GetAbsOrigin(), screen))
render::get().text(fonts[ESP], screen.x, screen.y, Color(red_factor, green_factor, 0), HFONT_CENTERED_X | HFONT_CENTERED_Y, "BOMB");
Над кодом бомбтаймера
В IClietnEntity
NETVAR(int, m_nBombSite, crypt_str("CPlantedC4"), crypt_str("m_nBombSite"));
C++:
float damage;
char bombdamagestringdead[24];
char bombdamagestringalive[24];
inline float CSGO_Armor(float flDamage, int ArmorValue)
{
float flArmorRatio = 0.5f;
float flArmorBonus = 0.5f;
if (ArmorValue > 0) {
float flNew = flDamage * flArmorRatio;
float flArmor = (flDamage - flNew) * flArmorBonus;
if (flArmor > static_cast<float>(ArmorValue)) {
flArmor = static_cast<float>(ArmorValue) * (1.f / flArmorBonus);
flNew = flDamage - flArmor;
}
flDamage = flNew;
}
return flDamage;
}
#include "other_esp.h"
В IClietnEntity
C++:
Vector GetEyePosition() {
Vector Origin = *(Vector*)((DWORD)this + 0x138);
Vector View = *(Vector*)((DWORD)this + 0x108);
return(Origin + View);
}
NETVAR(int, m_nBombSite, crypt_str("CPlantedC4"), crypt_str("m_nBombSite"));
Индикатор бомбы только две нижних строчки, т.к оно там где и индикаторы
Пожалуйста, авторизуйтесь для просмотра ссылки.
Последнее редактирование: