2d box expand, radar/glow pink on aimbot aim

This commit is contained in:
nullifiedcat 2017-04-18 19:07:54 +03:00
parent e05774d39f
commit d8742dd83a
6 changed files with 32 additions and 7 deletions

View File

@ -170,6 +170,7 @@ void EffectGlow::Init() {
int EffectGlow::GlowColor(IClientEntity* entity) {
CachedEntity* ent = ENTITY(entity->entindex());
if (CE_BAD(ent)) return colors::white;
if (ent == hacks::shared::aimbot::target_highest) return colors::pink;
if (vfunc<bool(*)(IClientEntity*)>(entity, 0xBE, 0)(entity)) {
IClientEntity* owner = vfunc<IClientEntity*(*)(IClientEntity*)>(entity, 0x1C3, 0)(entity);
if (owner) {

View File

@ -210,6 +210,8 @@ List& MainList() {
"esp_distance"
"esp_box"
"esp_box_text_position"
"esp_box_nodraw"
"esp_box_expand"
"3D Box" [
"3D Box Settings"
"esp_3d_box"

View File

@ -41,7 +41,10 @@ int ClosestHitbox(CachedEntity* target) {
return closest;
}
CachedEntity* target_highest = 0;
void CreateMove() {
target_highest = 0;
if (!enabled) return;
if (HasCondition(g_pLocalPlayer->entity, TFCond_Taunting)) return;
@ -78,7 +81,6 @@ void CreateMove() {
if (proj_gravity)
cur_proj_grav = (float)proj_gravity;
// TODO priority modes (FOV, Smart, Distance, etc)
CachedEntity* target_highest = 0;
float target_highest_score = -256;
for (int i = 0; i < HIGHEST_ENTITY; i++) {
CachedEntity* ent = ENTITY(i);

View File

@ -29,6 +29,8 @@ struct AimKeyMode_t {
void CreateMove();
void Reset();
extern CachedEntity* target_highest;
int ShouldTarget(CachedEntity* entity);
bool Aim(CachedEntity* entity, CUserCmd* cmd);
bool ShouldAim(CUserCmd* cmd);

View File

@ -219,6 +219,9 @@ void Draw3DBox(CachedEntity* ent, int clr, bool healthbar, int health, int healt
}
}
static CatVar box_nodraw(CV_SWITCH, "esp_box_nodraw", "0", "Invisible 2D Box", "Don't draw 2D box");
static CatVar box_expand(CV_INT, "esp_box_expand", "0", "Expand 2D Box", "Expand 2D box by N units");
void DrawBox(CachedEntity* ent, int clr, float widthFactor, float addHeight, bool healthbar, int health, int healthmax) {
if (CE_BAD(ent)) return;
bool cloak = ent->m_iClassID == g_pClassID->C_Player && IsPlayerInvisible(ent);
@ -251,6 +254,15 @@ void DrawBox(CachedEntity* ent, int clr, float widthFactor, float addHeight, boo
min_y = so.y - height;
max_y = so.y;
min_x = so.x - width / 2;
if (box_expand) {
const float& exp = (float)box_expand;
max_x += exp;
max_y += exp;
min_x -= exp;
min_y -= exp;
}
switch ((int)esp_box_text_position) {
case 0: { // TOP RIGHT
data.at(ent->m_IDX).esp_origin = Vector(max_x, min_y, 0);
@ -270,15 +282,20 @@ void DrawBox(CachedEntity* ent, int clr, float widthFactor, float addHeight, boo
unsigned char alpha = clr >> 24;
float trf = (float)((float)alpha / 255.0f);
int border = cloak ? colors::Create(160, 160, 160, alpha) : colors::Transparent(colors::black, trf);
if (!box_nodraw) {
draw::OutlineRect(min_x, min_y, max_x - min_x, max_y - min_y, border);
draw::OutlineRect(min_x + 1, min_y + 1, max_x - min_x - 2, max_y - min_y - 2, clr);
draw::OutlineRect(min_x + 2, min_y + 2, max_x - min_x - 4, max_y - min_y - 4, border);
//draw::OutlineRect(so.x - width / 2 - 1, so.y - 1 - height, width + 2, height + 2, border);
//draw::OutlineRect(so.x - width / 2, so.y - height, width, height, clr);
//draw::OutlineRect(so.x - width / 2 + 1, so.y + 1 - height, width - 2, height - 2, border);
}
draw::OutlineRect(so.x - width / 2 - 1, so.y - 1 - height, width + 2, height + 2, border);
draw::OutlineRect(so.x - width / 2, so.y - height, width, height, clr);
draw::OutlineRect(so.x - width / 2 + 1, so.y + 1 - height, width - 2, height - 2, border);
if (healthbar) {
int hp = colors::Transparent(colors::Health(health, healthmax), trf);
int hbh = (height) * min((float)health / (float)healthmax, 1.0f);
draw::DrawRect(so.x - width / 2 - 7, so.y - 1 - height, 6, height + 2, border);
draw::DrawRect(so.x - width / 2 - 6, so.y - hbh, 5, hbh, hp);
draw::OutlineRect(min_x - 6, min_y, 7, max_y - min_y, border);
draw::DrawRect(min_x - 5, max_y - hbh - 1, 5, hbh, hp);
}
//draw::OutlineRect(min(smin.x, smax.x) - 1, min(smin.y, smax.y) - 1, max(smin.x, smax.x), max(smin.y, smax.y), draw::black);
//draw::OutlineRect(min(smin.x, smax.x), min(smin.y, smax.y), max(smin.x, smax.x), max(smin.y, smax.y), clr);

View File

@ -125,7 +125,8 @@ void Draw() {
const int x = (int)radar_x;
const int y = (int)radar_y;
draw::DrawRect(x, y, (int)size, (int)size, colors::Transparent(colors::black, 0.4f));
draw::OutlineRect(x, y, (int)size, (int)size, GUIColor());
int outlineclr = hacks::shared::aimbot::target_highest ? colors::pink : GUIColor();
draw::OutlineRect(x, y, (int)size, (int)size, outlineclr);
draw::DrawLine(x + (int)size / 2, y, 0, (int)size, GUIColor());
draw::DrawLine(x, y + (int)size / 2, (int)size, 0, GUIColor());
static std::vector<CachedEntity*> enemies {};