Аимбот не ворк чота

Забаненный
Статус
Оффлайн
Регистрация
8 Ноя 2019
Сообщения
176
Реакции[?]
63
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Проблема с сурсом xy0
Есть такой момент когда начал переписывать аим и чото сломал , он не работает , антиаимы тоже ( как и все функции в хуке креатемув не ебу как ета получилось)
Но рофл в том что клантег работает 0_o
Чекал дебаггером , работу аимбота ( он не ходил индекс таргета хз поч )
Свой старый сурс вроде обновил индексы тоже с паттернами
Все работает после переписывание этой ебучий залупы​
C++:
bool __fastcall Hooks::CreateMove(IClientMode* thisptr, void* edx, float sample_frametime, CUserCmd* pCmd)
{
    static auto oCreateMove = g_Hooks.pClientModeHook->GetOriginal<CreateMove_t>(vtable_indexes::createMove);
    oCreateMove(thisptr, edx, sample_frametime, pCmd);

    if (!pCmd || !pCmd->command_number)
        return false;
    uintptr_t *framePtr;
    __asm mov framePtr, ebp;

    Globals::pCmd = pCmd;
    Globals::LocalPlayer = n_pEntityList->GetClientEntity(n_pEngine->GetLocalPlayer());

    Globals::FakeLagg = false;
    Globals::bSendPacket = true;

    if (n_pEngine->GetNetChannel()->m_nChokedPackets > 14)
        Globals::bSendPacket = true;

    if (!Globals::LocalPlayer)
        return false;


    

    Globals::OriginalView = Globals::pCmd->viewangles;


    n_backtracking::get()->setup_records();

    g_Misc.OnCreateMove();
    g_Resolver.OnCreateMove();

    if (config2::get()->fastcrouch)
        pCmd->buttons |= IN_BULLRUSH;

    engine_prediction::RunEnginePred();
    n_AntiAim.OnCreateMove();
    n_Aimbot.OnCreateMove();
    Vector OrigAng = Globals::pCmd->viewangles;



    static int counter = 0;
    static std::string clantag = "eblan ";
    if (++counter > 25) {
        std::rotate(clantag.begin(), clantag.begin() + 1, clantag.end());
        SetClan(clantag.c_str(), clantag.c_str());
        counter = 0;
    }
    engine_prediction::EndEnginePred();
    for (auto hk : c_lua::get()->hooks->getHooks("on_create_move"))
        hk.func(pCmd, &Globals::bSendPacket);
    n_Misc.NoRecoil(pCmd);
    n_Misc.MovementFix(Globals::OriginalView);
    n_Math.Clamp(Globals::pCmd->viewangles);
    

    if (Globals::bSendPacket)
        Globals::RealAngle = Globals::pCmd->viewangles;
    else
        Globals::FakeAngle = Globals::pCmd->viewangles;

    *(bool*)(*framePtr - 0x1C) = Globals::bSendPacket;
    return false;
}
 
Олдфаг
Статус
Оффлайн
Регистрация
6 Мар 2019
Сообщения
2,936
Реакции[?]
1,002
Поинты[?]
0
Есть такой момент когда начал переписывать аим​
И нахуя ты тогда запостил функцию createmove, в которой только объявление этого аймбота?
Поподробнее давай, поподробнее.
 
Забаненный
Статус
Оффлайн
Регистрация
21 Авг 2019
Сообщения
1,461
Реакции[?]
502
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
А нахуя тебе в крейтмуве только аим. Поставь то что в деф хуо
 
Забаненный
Статус
Оффлайн
Регистрация
8 Ноя 2019
Сообщения
176
Реакции[?]
63
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Забаненный
Статус
Оффлайн
Регистрация
8 Ноя 2019
Сообщения
176
Реакции[?]
63
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
всем кто просил сам код аима хз мб разберетесь
C++:
#include "../..//Configuration/Config.h"
#include "Aimbot.h"
#include "Autowall.h"
#include "LagComp.h"



Aimbot n_Aimbot;

float Aimbot::SynchronizeHitchance() {
    auto me = Globals::LocalPlayer;
    auto cmd = Globals::pCmd;

    if (!me->GetActiveWeapon())
        return 0;

    return c_config::get()->other_hitchance;
}

float Aimbot::SynchronizeMinDamage() {
    auto me = Globals::LocalPlayer;
    auto cmd = Globals::pCmd;

    if (!me->GetActiveWeapon())
        return 0;

    return c_config::get()->other_mindamage;
}
static int sinceUse;


bool BoneS(N_BasEntity* Target, int Bone)
{
    Vector vEnd;
    vEnd = Target->GetBonePosition(Bone);

    C_Trace Trace;
    C_TraceFilter Filter(Target);
    Filter.pSkip1 = Globals::LocalPlayer;

    p_Trace->TraceRay(C_Ray(Globals::LocalPlayer->GetEyePosition(), vEnd), mask_shot, &Filter, &Trace);

    if (Trace.m_pEnt && Trace.m_pEnt->GetTeam() != Globals::LocalPlayer->GetTeam() && !(Trace.m_pEnt->GetHealth() <= 0) && !(Trace.m_pEnt->IsDormant()))
    {
        if (Trace.physicsBone <= 128 && Trace.physicsBone > 0)
        {
            return true;
        }
    }

    return false;
}

bool TargetVisuble(N_BasEntity* target)
{
    for (int i = 0; i < 128; i++)
    {
        if (BoneS(target, i))
        {
            return true;
        }
    }
    return false;
}

void Aimbot::Autostop()
{
    if (!c_config::get()->autostop)
        return;

    Vector Velocity = Globals::LocalPlayer->GetVelocity();

    if (Velocity.Length2D() == 0)
        return;

    static float Speed = 450.f;

    Vector Direction;
    Vector RealView;
    n_Math.VectorAngles(Velocity, Direction);
    p_Engine->GetViewAngles(RealView);
    Direction.y = RealView.y - Direction.y;

    Vector Forward;
    n_Math.AngleVectors(Direction, &Forward);
    Vector NegativeDirection = Forward * -Speed;

    Globals::pCmd->forwardmove = NegativeDirection.x;
    Globals::pCmd->sidemove = NegativeDirection.y;
}

void SinCosBitch(float a, float* s, float*c)
{
    *s = sin(a);
    *c = cos(a);
}
void AngleVectorsv2(const Vector &angles, Vector& forward)
{
    float    sp, sy, cp, cy;

    SinCosBitch(DEG2RAD(angles[1]), &sy, &cy);
    SinCosBitch(DEG2RAD(angles[0]), &sp, &cp);

    forward.x = cp * cy;
    forward.y = cp * sy;
    forward.z = -sp;
}

bool Aimbot::HitChance(N_BasEntity* pEnt, C_BaseCombatWeapon* pWeapon, Vector Angle, Vector Point, int chance)
{
    if (chance == 0 || SynchronizeHitchance() == 0)
        return true;

    float Seeds = 256.f;

    Angle -= (Globals::LocalPlayer->GetAimPunchAngle() * p_Cvar->FindVar("weapon_recoil_scale")->GetFloat());

    Vector forward, right, up;

    n_Math.AngleVectors(Angle, &forward, &right, &up);

    int Hits = 0, neededHits = (Seeds * (chance / 100.f));

    float weapSpread = pWeapon->GetSpread(), weapInaccuracy = pWeapon->GetInaccuracy();

    for (int i = 0; i < Seeds; i++)
    {
        float Inaccuracy = n_Math.RandomFloat(0.f, 1.f) * weapInaccuracy;
        float Spread = n_Math.RandomFloat(0.f, 1.f) * weapSpread;

        Vector spreadView((cos(n_Math.RandomFloat(0.f, 2.f * M_PI)) * Inaccuracy) + (cos(n_Math.RandomFloat(0.f, 2.f * M_PI)) * Spread), (sin(n_Math.RandomFloat(0.f, 2.f * M_PI)) * Inaccuracy) + (sin(n_Math.RandomFloat(0.f, 2.f * M_PI)) * Spread), 0), direction;
        direction = Vector(forward.x + (spreadView.x * right.x) + (spreadView.y * up.x), forward.y + (spreadView.x * right.y) + (spreadView.y * up.y), forward.z + (spreadView.x * right.z) + (spreadView.y * up.z)).Normalize();

        Vector viewanglesSpread, viewForward;

        n_Math.VectorAngles(direction, up, viewanglesSpread);
        n_Math.NormalizeAngles(viewanglesSpread);

        n_Math.AngleVectors(viewanglesSpread, &viewForward);
        viewForward.NormalizeInPlace();

        viewForward = Globals::LocalPlayer->GetEyePosition() + (viewForward * pWeapon->GetCSWpnData()->range);

        C_Trace Trace;

        p_Trace->ClipRayToEntity(C_Ray(Globals::LocalPlayer->GetEyePosition(), viewForward), mask_shot | contents_grate, pEnt, &Trace);

        if (Trace.m_pEnt == pEnt)
            Hits++;

        if (((Hits / Seeds) * 100.f) >= chance)
            return true;

        if ((Seeds - i + Hits) < neededHits)
            return false;
    }

    return false;
}

bool ShouldBaim(N_BasEntity* pEnt)
{
    if (c_config::get()->after_shots_baim > 0 && Globals::Total_shots[pEnt->EntIndex()] > c_config::get()->after_shots_baim)
        return true;

    if (!(pEnt->GetFlags() & FL_ONGROUND) && c_config::get()->baim_if_air)
        return true;

    if (c_config::get()->baim_if_lethal && pEnt->GetHealth() < 50)
        return true;

    if (c_config::get()->fallback && GetAsyncKeyState(c_config::get()->fallback_bind))
        return true;

    return false;
}

void AAAngleVectors(const Vector &angles, Vector *forward)
{
    Assert(s_bMathlibInitialized);
    Assert(forward);

    float    sp, sy, cp, cy;

    sy = sin(DEG2RAD(angles[1]));
    cy = cos(DEG2RAD(angles[1]));

    sp = sin(DEG2RAD(angles[0]));
    cp = cos(DEG2RAD(angles[0]));

    forward->x = cp * cy;
    forward->y = cp * sy;
    forward->z = -sp;
}

mstudiobbox_t* get_hitboxvx(N_BasEntity* entity, int hitbox_index)
{
    if (entity->IsDormant() || entity->GetHealth() <= 0)
        return NULL;

    const auto pModel = entity->GetModel();
    if (!pModel)
        return NULL;

    auto pStudioHdr = p_ModelInfo->GetStudiomodel(pModel);
    if (!pStudioHdr)
        return NULL;

    auto pSet = pStudioHdr->GetHitboxSet(0);
    if (!pSet)
        return NULL;

    if (hitbox_index >= pSet->numhitboxes || hitbox_index < 0)
        return NULL;

    return pSet->GetHitbox(hitbox_index);
}
Vector GetHitboxPositionAim(N_BasEntity* entity, int hitbox_id)
{
    auto hitbox = get_hitboxvx(entity, hitbox_id);
    if (!hitbox)
        return Vector(0, 0, 0);

    auto bone_matrix = entity->GetBoneMatrix(hitbox->bone);

    Vector bbmin, bbmax;
    n_Math.VectorTransform(hitbox->min, bone_matrix, bbmin);
    n_Math.VectorTransform(hitbox->max, bone_matrix, bbmax);

    return (bbmin + bbmax) * 0.5f;
}

void getpoints(N_BasEntity * entity, int hitbox_id, std::vector< Vector > & points) {
    auto hitbox = get_hitboxvx(entity, hitbox_id);
    if (!hitbox) return;
    auto bones = entity->GetBoneMatrix(hitbox->bone);
    Vector min, max;
    n_Math.VectorTransform(hitbox->min, bones, min);
    n_Math.VectorTransform(hitbox->max, bones, max);
    Vector
        center = (min + max) * 0.5f,
        angle = n_Math.CalcAngle(center, Globals::LocalPlayer->GetEyePosition());
    Vector forward;
    AngleVectorsv2(angle, forward);
    Vector
        right = forward.Cross(Vector(0, 0, 1)),
        left = Vector(-right.x, -right.y, right.z),
        top = Vector(0, 0, 1),
        bot = Vector(0, 0, -1);

    auto normalize_scale_head = c_config::get()->aimbot_headpointscale / 100;
    auto normalize_scale_body = c_config::get()->aimbot_bodypointscale / 100;

    if (hitbox_id == HITBOX_HEAD || hitbox_id == HITBOX_NECK) {
        points.push_back(center + (top * (hitbox->radius * normalize_scale_head)));
        points.push_back(center + (right * (hitbox->radius * normalize_scale_head)));
        points.push_back(center + (left * (hitbox->radius * normalize_scale_head)));
    }
    else if (hitbox_id == HITBOX_PELVIS || hitbox_id == HITBOX_THORAX || hitbox_id == HITBOX_LOWER_CHEST || hitbox_id == HITBOX_UPPER_CHEST)
    {
        points.push_back(center + (right * (hitbox->radius * normalize_scale_body)));
        points.push_back(center + (left * (hitbox->radius * normalize_scale_body)));
    }
    else {
        points.push_back(center + (right * (hitbox->radius * 0.1f)));
        points.push_back(center + (left * (hitbox->radius * 0.1f)));
    }
}

struct record_point
{
    Vector point;
    Vector multipoint;
};

Vector Aimbot::Hitscan(N_BasEntity* pEnt) // supremeemmemememememe
{
    float DamageArray[28];
    float tempDmg = 0.f;
    Vector tempHitbox = { 0,0,0 };
    static int HitboxForMuti[] = { 2,2,4,4,6,6 };
    float angToLocal = n_Math.CalcAngle(Globals::LocalPlayer->GetOrigin(), pEnt->GetOrigin()).y;
    Vector2D MutipointXY = { (sin(n_Math.GRD_TO_BOG(angToLocal))),(cos(n_Math.GRD_TO_BOG(angToLocal))) };
    Vector2D MutipointXY180 = { (sin(n_Math.GRD_TO_BOG(angToLocal + 180))) ,(cos(n_Math.GRD_TO_BOG(angToLocal + 180))) };
    Vector2D Mutipoint[] = { Vector2D(MutipointXY.x, MutipointXY.y), Vector2D(MutipointXY180.x, MutipointXY180.y) };
    std::vector<int> Scan;
    int HeadHeight = 0;
    bool Baim = ShouldBaim(pEnt);

    bool ignore_limbs_when_move = c_config::get()->ignore_limbs_at_moving && pEnt->GetVelocity().Length2D() > 10.f;
    bool ignore_limbs_when_air = c_config::get()->ignore_limbs_at_air && !(pEnt->GetFlags() & FL_ONGROUND);

    if (!Baim && c_config::get()->hitboxes[0]) {
        Scan.push_back(HITBOX_HEAD);
        //    Scan.push_back(HITBOX_NECK);
        Scan.push_back(25);
        Scan.push_back(26);
        Scan.push_back(27);
    }

    if (c_config::get()->hitboxes[1])
    {
        Scan.push_back(HITBOX_LOWER_CHEST);
        Scan.push_back(HITBOX_UPPER_CHEST);
        Scan.push_back(23);
        Scan.push_back(24);
    }

    if (c_config::get()->hitboxes[2])
    {
        Scan.push_back(HITBOX_PELVIS);
        Scan.push_back(HITBOX_THORAX);
        Scan.push_back(19);
        Scan.push_back(20);
        Scan.push_back(21);
        Scan.push_back(22);
    }

    if (c_config::get()->hitboxes[3])
    {
        if (!ignore_limbs_when_move || !ignore_limbs_when_air)
        {
            Scan.push_back(HITBOX_LEFT_UPPER_ARM);
            Scan.push_back(HITBOX_RIGHT_UPPER_ARM);
        }
    }

    if (c_config::get()->hitboxes[4])
    {
        if (!ignore_limbs_when_move || !ignore_limbs_when_air)
        {
            Scan.push_back(HITBOX_LEFT_THIGH);
            Scan.push_back(HITBOX_RIGHT_THIGH);
        }
    }

    HeadHeight = c_config::get()->aimbot_headpointscale;

    if (c_config::get()->hitboxes[5])
    {
        if (!ignore_limbs_when_move || !ignore_limbs_when_air)
        {
            Scan.push_back(HITBOX_LEFT_FOOT);
            Scan.push_back(HITBOX_RIGHT_FOOT);
        }
    }

    Vector vector_best_point = Vector(0, 0, 0);

    float maxDamage;
    maxDamage = c_config::get()->other_mindamage;

    record_point scaned;

    for (auto point : Scan)
    {
        auto hitbox = GetHitboxPositionAim(pEnt, point);

        int damage = c_autowall::get()->get_point_damage(hitbox, pEnt);

        if (damage > maxDamage && damage >= SynchronizeMinDamage())
        {
            maxDamage = damage;
            vector_best_point = hitbox;

            if (maxDamage >= pEnt->GetHealth() || damage >= pEnt->GetHealth())
                return hitbox;
        }
    }

    for (auto multipoint : Scan)
    {
        std::vector< Vector > points;
        getpoints(pEnt, multipoint, points);

        for (auto point : points)
        {
            int damage = c_autowall::get()->get_point_damage(point, pEnt);
            if (damage > maxDamage)
            {
                maxDamage = damage;
                vector_best_point = point;

                if (maxDamage >= pEnt->GetHealth() || damage >= pEnt->GetHealth())
                    return point;
            }
        }
    }

    for (auto local_points : Scan)
    {
        std::vector< Vector > vecr;
        getpoints(pEnt, local_points, vecr);

        for (auto point : vecr)
        {
            int damage = c_autowall::get()->get_point_damage(point, pEnt);
            if (damage + 3 > maxDamage)
            {
                maxDamage = damage;

                if (maxDamage >= pEnt->GetHealth() || damage >= pEnt->GetHealth())
                    scaned.point = point;
            }
        }
    }

    for (auto point : Scan)
    {
        auto hitbox = GetHitboxPositionAim(pEnt, point);

        int damage = c_autowall::get()->get_point_damage(hitbox, pEnt);

        if (damage > maxDamage && damage >= SynchronizeMinDamage())
        {
            maxDamage = damage;

            if (maxDamage >= pEnt->GetHealth() || damage >= pEnt->GetHealth())
                scaned.point = hitbox;
        }
    }

    return vector_best_point;
}

Vector Aimbot::HitscanSmartMethod(N_BasEntity* pEnt)
{
    float DamageArray[28];
    float tempDmg = 0.f;
    Vector tempHitbox = { 0,0,0 };
    static int HitboxForMuti[] = { 2,2,4,4,6,6 };
    float angToLocal = n_Math.CalcAngle(Globals::LocalPlayer->GetOrigin(), pEnt->GetOrigin()).y;
    Vector2D MutipointXY = { (sin(n_Math.GRD_TO_BOG(angToLocal))),(cos(n_Math.GRD_TO_BOG(angToLocal))) };
    Vector2D MutipointXY180 = { (sin(n_Math.GRD_TO_BOG(angToLocal + 180))) ,(cos(n_Math.GRD_TO_BOG(angToLocal + 180))) };
    Vector2D Mutipoint[] = { Vector2D(MutipointXY.x, MutipointXY.y), Vector2D(MutipointXY180.x, MutipointXY180.y) };
    std::vector<int> Scan;
    int HeadHeight = 0;
    bool Baim = ShouldBaim(pEnt);

    bool ignore_limbs_when_move = c_config::get()->ignore_limbs_at_moving && pEnt->GetVelocity().Length2D() > 10.f;
    bool ignore_limbs_when_air = c_config::get()->ignore_limbs_at_air && !(pEnt->GetFlags() & FL_ONGROUND);

    if (!Baim && c_config::get()->hitboxes[0]) {
        Scan.push_back(HITBOX_HEAD);
        //    Scan.push_back(HITBOX_NECK);
        Scan.push_back(25);
        Scan.push_back(26);
        Scan.push_back(27);
    }

    if (c_config::get()->hitboxes[1])
    {
        Scan.push_back(HITBOX_LOWER_CHEST);
        Scan.push_back(HITBOX_UPPER_CHEST);
        Scan.push_back(23);
        Scan.push_back(24);
    }

    if (c_config::get()->hitboxes[2])
    {
        Scan.push_back(HITBOX_PELVIS);
        Scan.push_back(HITBOX_THORAX);
        Scan.push_back(19);
        Scan.push_back(20);
        Scan.push_back(21);
        Scan.push_back(22);
    }

    if (c_config::get()->hitboxes[3])
    {
        if (!ignore_limbs_when_move || !ignore_limbs_when_air)
        {
            Scan.push_back(HITBOX_LEFT_UPPER_ARM);
            Scan.push_back(HITBOX_RIGHT_UPPER_ARM);
        }
    }

    if (c_config::get()->hitboxes[4])
    {
        if (!ignore_limbs_when_move || !ignore_limbs_when_air)
        {
            Scan.push_back(HITBOX_LEFT_THIGH);
            Scan.push_back(HITBOX_RIGHT_THIGH);
        }
    }

    HeadHeight = c_config::get()->aimbot_headpointscale;

    if (c_config::get()->hitboxes[5])
    {
        if (!ignore_limbs_when_move || !ignore_limbs_when_air)
        {
            Scan.push_back(HITBOX_LEFT_FOOT);
            Scan.push_back(HITBOX_RIGHT_FOOT);
        }
    }
    Vector Hitbox;
    int bestHitboxint = 0;

    float damage;
    damage = c_config::get()->other_mindamage;

    for (int hitbox : Scan)
    {
        if (hitbox < 19)
            Hitbox = pEnt->GetHitboxPosition1(hitbox);
        else if (hitbox > 18 && hitbox < 25)
        {
            float Radius = 0;
            Hitbox = pEnt->GetHitboxPosition2(HitboxForMuti[hitbox - 19], &Radius);
            Radius *= (c_config::get()->aimbot_bodypointscale / 100.f);
            Hitbox = Vector(Hitbox.x + (Radius * Mutipoint[((hitbox - 19) % 2)].x), Hitbox.y - (Radius * Mutipoint[((hitbox - 19) % 2)].y), Hitbox.z);
        }
        else if (hitbox > 24 && hitbox < 28)
        {
            float Radius = 0;
            Hitbox = pEnt->GetHitboxPosition2(0, &Radius);
            Radius *= (HeadHeight / 100.f);
            if (hitbox != 27)
                Hitbox = Vector(Hitbox.x + (Radius * Mutipoint[((hitbox - 25) % 2)].x), Hitbox.y - (Radius * Mutipoint[((hitbox - 25) % 2)].y), Hitbox.z);
            else
                Hitbox += Vector(0, 0, Radius);
        }

        float Damage = c_autowall::get()->get_point_damage(Hitbox, pEnt);

        if (Damage > 0.f)
            DamageArray[hitbox] = Damage;
        else
            DamageArray[hitbox] = 0;

        if (Baim && hitbox != 0 && hitbox != 25 && hitbox != 26 && hitbox != 27 && Damage >= (pEnt->GetHealth() + 10))
        {
            DamageArray[hitbox] = 400;
            Baim = true;
        }

        if (DamageArray[hitbox] > tempDmg)
        {
            tempHitbox = Hitbox;
            bestHitboxint = hitbox;
            tempDmg = DamageArray[hitbox];
        }

        Globals::AimbotHitbox[pEnt->EntIndex()][hitbox] = Hitbox;
    }

    if (tempDmg >= damage)
    {
        bestEntDmg = tempDmg;

        if ((bestHitboxint == 25 || bestHitboxint == 26 || bestHitboxint == 27) && abs(DamageArray[HITBOX_HEAD] - DamageArray[bestHitboxint]) <= 10.f)
            return pEnt->GetHitboxPosition1(HITBOX_HEAD);
        else if ((bestHitboxint == 19 || bestHitboxint == 20) && DamageArray[HITBOX_PELVIS] > 30)
            return pEnt->GetHitboxPosition1(HITBOX_PELVIS);
        else if ((bestHitboxint == 21 || bestHitboxint == 22) && DamageArray[HITBOX_THORAX] > 30)
            return pEnt->GetHitboxPosition1(HITBOX_THORAX);
        else if ((bestHitboxint == 23 || bestHitboxint == 24) && DamageArray[HITBOX_UPPER_CHEST] > 30)
            return pEnt->GetHitboxPosition1(HITBOX_UPPER_CHEST);

        return tempHitbox;
    }

    return Vector(0, 0, 0);
}

bool target_meets_requirements(N_BasEntity* e) {
    if (e && !e->IsDormant() && e->IsAlive() && e->GetTeam() != Globals::LocalPlayer->GetTeam())
        return true;
    else
        return false;
}

void Aimbot::Extrapolation()
{
    for (int i = 1; i < p_GlobalVars->maxClients; i++) {
        N_BasEntity* e = p_EntityList->GetClientEntity(i);
        if (!target_meets_requirements(e))
            continue;

        float simtime_delta = e->GetSimulationTime() - e->GetOldSimulationTime();
        int choked_ticks = std::clamp(TIME_TO_TICKS(simtime_delta), 1, 15);
        Vector lastOrig;

        if (lastOrig.Length() != e->GetVecOrigin().Length())
            lastOrig = e->GetVecOrigin();

        float delta_distance = (e->GetVecOrigin() - lastOrig).LengthSqr();
        if (delta_distance > 4096.f) {
            Vector velocity_per_tick = e->GetVelocity() * p_GlobalVars->intervalPerTick;
            auto new_origin = e->GetVecOrigin() + (velocity_per_tick * choked_ticks);
            e->SetAbsOrigin(new_origin);
        }
    }
}


void Aimbot::OnCreateMove()
{
    if (!p_Engine->IsInGame())
        return;

    Vector Aimpoint = { 0,0,0 };
    N_BasEntity* Target = nullptr;
    targetID = 0;

    int tempDmg = 0;
    static bool shot = false;
    CanShootWithCurrentHitchanceAndValidTarget = false;

    for (int i = 1; i <= p_Engine->GetMaxClients(); ++i)
    {
        N_BasEntity* pPlayerEntity = p_EntityList->GetClientEntity(i);

        if (!pPlayerEntity
            || !pPlayerEntity->IsAlive()
            || pPlayerEntity->IsDormant()
            || pPlayerEntity->IsImmune())
        {
            continue;
        }

        if (pPlayerEntity == Globals::LocalPlayer || pPlayerEntity->GetTeam() == Globals::LocalPlayer->GetTeam())
            continue;

        Globals::EnemyEyeAngs[i] = pPlayerEntity->GetEyeAngles();

        if (!Globals::LocalPlayer->IsAlive() || !c_config::get()->b["rage_aimbot"])
            continue;

        if (!Globals::LocalPlayer->GetActiveWeapon() || Globals::LocalPlayer->IsKnifeorNade())
            continue;

        bestEntDmg = 0;

        Vector Hitbox = Hitscan(pPlayerEntity);

        if (c_config::get()->hitscan_method == 0)
            Hitbox = Hitscan(pPlayerEntity);
        else
            Hitbox = HitscanSmartMethod(pPlayerEntity);

        if (Hitbox != Vector(0, 0, 0) && tempDmg <= bestEntDmg)
        {
            Aimpoint = Hitbox;
            Target = pPlayerEntity;
            targetID = Target->EntIndex();
            tempDmg = bestEntDmg;
        }
    }

    if (!Globals::LocalPlayer->IsAlive())
    {
        shot = false;
        return;
    }

    if (!Globals::LocalPlayer->GetActiveWeapon() || Globals::LocalPlayer->IsKnifeorNade())
    {
        shot = false;
        return;
    }

    if (shot)
    {
        if (c_config::get()->hide_shot)
        {
            static int32_t iTicks = 72;
            if (iTicks <= 0)
            {
                Globals::bSendPacket = false;
                iTicks = 0;
            }
            else
            {
                Globals::bSendPacket = true;
                iTicks--;
            }
        }
        shot = false;
    }

    float flServerTime = Globals::LocalPlayer->GetTickBase() * p_GlobalVars->intervalPerTick;
    bool canShoot = (Globals::LocalPlayer->GetActiveWeapon()->GetNextPrimaryAttack() <= flServerTime && Globals::LocalPlayer->GetActiveWeapon()->GetAmmo() > 0);
    static bool delay;

    if (Target)
    {
        Globals::TargetIndex = targetID;

        float simtime;
        n_backtracking::get()->records[targetID].at(c_backtracking::get()->records[targetID].size() - 1).sim_time;

        Vector Angle = n_Math.CalcAngle(Globals::LocalPlayer->GetEyePosition(), Aimpoint);

        Globals::BackPoint = Angle;

        static int MinimumVelocity = 0;

        if (c_config::get()->autostop_mode == 0)
        {
            MinimumVelocity = Globals::LocalPlayer->GetActiveWeapon()->GetCSWpnData()->max_speed_alt * .34f;
        }
        else if (c_config::get()->autostop_mode == 1)
        {
            MinimumVelocity = 0;
        }

        bool shouldstop = c_config::get()->stop_inbetween_shots ? true : canShoot;

        if (Globals::LocalPlayer->GetVelocity().Length() >= MinimumVelocity && shouldstop && !GetAsyncKeyState(VK_SPACE))
            Autostop();

        auto me = Globals::LocalPlayer;
        auto cmd = Globals::pCmd;

        if ((Globals::LocalPlayer->GetActiveWeapon()->GetItemDefinitionIndex() == ItemDefinitionIndex::WEAPON_SCAR20 || Globals::LocalPlayer->GetActiveWeapon()->GetItemDefinitionIndex() == ItemDefinitionIndex::WEAPON_G3SG1 || Globals::LocalPlayer->GetActiveWeapon()->GetItemDefinitionIndex() == ItemDefinitionIndex::WEAPON_SSG08)) {
            if (!me->IsScoped()) {
                cmd->buttons |= IN_ATTACK2;
                return;
            }
        }

        if (delay && HitChance(Target, Globals::LocalPlayer->GetActiveWeapon(), Angle, Aimpoint, SynchronizeHitchance()))
        {
            CanShootWithCurrentHitchanceAndValidTarget = true;

            if (Globals::pCmd->buttons & IN_ATTACK)
                return;

            if (!Backtrack[targetID] && !ShotBacktrack[targetID])
                Globals::Shot[targetID] = true;

            Globals::Total_shots[targetID] += 1;

            Globals::bSendPacket = true;

            shot = true;

            n_backtracking::get()->rec_aimbot(Target);

            Globals::pCmd->viewangles = Angle;

            Globals::pCmd->buttons |= IN_ATTACK;

            // double_tap();

            Globals::pCmd->tick_count = TIME_TO_TICKS(simtime + LagComp::get()->LerpTime());

            n_backtracking::get()->orig_aimbot(Target);
        }
    }
}
 
Сверху Снизу