Исходник AutoStop for lw

Статус
В этой теме нельзя размещать новые ответы.
Начинающий
Статус
Оффлайн
Регистрация
26 Дек 2021
Сообщения
51
Реакции[?]
2
Поинты[?]
0
C++:
void aim::AutoStop(CUserCmd* cmd)
{
    Vector real_view;

    m_engine()->GetViewAngles(real_view);
    Vector vMove(abs(cmd->m_forwardmove), abs(cmd->m_sidemove), abs(cmd->m_upmove));
    float flSpeed = sqrt(vMove.x * vMove.x + vMove.y * vMove.y), flYaw;
    Vector vMove2;
    math::VectorAngles(vMove, vMove2);
    vMove2.Normalize();
    flYaw = DEG2RAD(cmd->m_viewangles.y - g_ctx.globals.original.y + vMove2.y);
    cmd->m_forwardmove = cos(flYaw) * flSpeed;
    cmd->m_sidemove = sin(flYaw) * flSpeed;
    QAngle angResistance = QAngle(0, 0, 0);
    VectorAngles((g_ctx.local()->m_vecVelocity() * -1.f), angResistance);

    angResistance.yaw = real_view.y - angResistance.yaw;
    angResistance.pitch = real_view.x - angResistance.pitch;

    Vector vecResistance = Vector(0, 0, 0);
    AngleVectors(angResistance, vecResistance);

    cmd->m_forwardmove = std::clamp(vecResistance.x, -450.f, 450.f);
    cmd->m_sidemove = std::clamp(vecResistance.y, -450.f, 450.f);
}
bool aim::automatic_stop(CUserCmd* cmd)
{
    if (!should_stop)
        return true;

    if (!g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop)
        return true;

    if (g_ctx.globals.slowwalking)
        return true;

    if (!(g_ctx.local()->m_fFlags() & FL_ONGROUND && engineprediction::get().backup_data.flags & FL_ONGROUND)) //-V807
        return true;

    if (g_ctx.globals.weapon->is_empty())
        return true;

    if (!g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop_modifiers[AUTOSTOP_BETWEEN_SHOTS] && !g_ctx.globals.weapon->can_fire(false))
        return true;

    auto animlayer = g_ctx.local()->get_animlayers()[1];

    if (animlayer.m_nSequence)
    {
        auto activity = g_ctx.local()->sequence_activity(animlayer.m_nSequence);

        if (activity == ACT_CSGO_RELOAD && animlayer.m_flWeight > 0.0f)
            return true;
    }

    auto weapon_info = g_ctx.globals.weapon->get_csweapon_info();

    if (!weapon_info)
        return true;

    auto max_speed = 0.34f * (g_ctx.globals.scoped ? weapon_info->flMaxPlayerSpeedAlt : weapon_info->flMaxPlayerSpeed);

    if (engineprediction::get().backup_data.velocity.Length2D() < max_speed)
        slowwalk::get().create_move(cmd);
    else
    {
            AutoStop(cmd);//суппупирир хуетень, еоторая работает
            if (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop_modifiers[AUTOSTOP_FORCE_ACCURACY]) {
                should_stop = true;
                return false;
            }
    
    }
    should_stop = false;
    return true;
}
credits @Maaaa34
 
Последнее редактирование:
Начинающий
Статус
Оффлайн
Регистрация
14 Янв 2022
Сообщения
21
Реакции[?]
1
Поинты[?]
0
C++:
void aim::AutoStop(CUserCmd* cmd)
{
    Vector real_view;

    m_engine()->GetViewAngles(real_view);
    Vector vMove(abs(cmd->m_forwardmove), abs(cmd->m_sidemove), abs(cmd->m_upmove));
    float flSpeed = sqrt(vMove.x * vMove.x + vMove.y * vMove.y), flYaw;
    Vector vMove2;
    math::VectorAngles(vMove, vMove2);
    vMove2.Normalize();
    flYaw = DEG2RAD(cmd->m_viewangles.y - g_ctx.globals.original.y + vMove2.y);
    cmd->m_forwardmove = cos(flYaw) * flSpeed;
    cmd->m_sidemove = sin(flYaw) * flSpeed;
    QAngle angResistance = QAngle(0, 0, 0);
    VectorAngles((g_ctx.local()->m_vecVelocity() * -1.f), angResistance);

    angResistance.yaw = real_view.y - angResistance.yaw;
    angResistance.pitch = real_view.x - angResistance.pitch;

    Vector vecResistance = Vector(0, 0, 0);
    AngleVectors(angResistance, vecResistance);

    cmd->m_forwardmove = std::clamp(vecResistance.x, -450.f, 450.f);
    cmd->m_sidemove = std::clamp(vecResistance.y, -450.f, 450.f);
}
bool aim::automatic_stop(CUserCmd* cmd)
{
    if (!should_stop)
        return true;

    if (!g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop)
        return true;

    if (g_ctx.globals.slowwalking)
        return true;

    if (!(g_ctx.local()->m_fFlags() & FL_ONGROUND && engineprediction::get().backup_data.flags & FL_ONGROUND)) //-V807
        return true;

    if (g_ctx.globals.weapon->is_empty())
        return true;

    if (!g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop_modifiers[AUTOSTOP_BETWEEN_SHOTS] && !g_ctx.globals.weapon->can_fire(false))
        return true;

    auto animlayer = g_ctx.local()->get_animlayers()[1];

    if (animlayer.m_nSequence)
    {
        auto activity = g_ctx.local()->sequence_activity(animlayer.m_nSequence);

        if (activity == ACT_CSGO_RELOAD && animlayer.m_flWeight > 0.0f)
            return true;
    }

    auto weapon_info = g_ctx.globals.weapon->get_csweapon_info();

    if (!weapon_info)
        return true;

    auto max_speed = 0.34f * (g_ctx.globals.scoped ? weapon_info->flMaxPlayerSpeedAlt : weapon_info->flMaxPlayerSpeed);

    if (engineprediction::get().backup_data.velocity.Length2D() < max_speed)
        slowwalk::get().create_move(cmd);
    else
    {
            AutoStop(cmd);//суппупирир хуетень, еоторая работает
            if (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop_modifiers[AUTOSTOP_FORCE_ACCURACY]) {
                should_stop = true;
                return false;
            }
   
    }
    should_stop = false;
    return true;
}
credits @Maaaa34
Give me AngleVectors1644769467726.png
 
Начинающий
Статус
Оффлайн
Регистрация
26 Дек 2021
Сообщения
51
Реакции[?]
2
Поинты[?]
0
C++:
forceinline void VectorAngles(const Vector vecForward, QAngle& vecAngles) {    float flTemp, flYaw, flPitch;    if (vecForward.y == 0 && vecForward.x == 0)    {        flYaw = 0;        flPitch = 90;        if (vecForward.z > 0)            flPitch = 270;    }    else    {        flYaw = (atan2(vecForward.y, vecForward.x) * 180 / DirectX::XM_PI);        if (flYaw < 0)            flYaw += 360;        flTemp = sqrt(vecForward.x * vecForward.x + vecForward.y * vecForward.y);        flPitch = (atan2(-vecForward.z, flTemp) * 180 / DirectX::XM_PI);        if (flPitch < 0)            flPitch += 360;    }    vecAngles.pitch = flPitch;    vecAngles.yaw = flYaw;    vecAngles.roll = 0; } -----------------------------[/U]
forceinline void AngleVectors(const QAngle& vecAngles, Vector& vecForward) {    float sp, sy, cp, cy;    DirectX::XMScalarSinCos(&sp, &cp, DEG2RAD(vecAngles[0]));    DirectX::XMScalarSinCos(&sy, &cy, DEG2RAD(vecAngles[1]));    vecForward.x = cp * cy;    vecForward.y = cp * sy;    vecForward.z = -sp; }
 
gone
Забаненный
Статус
Оффлайн
Регистрация
8 Апр 2021
Сообщения
285
Реакции[?]
166
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
C++:
void aim::AutoStop(CUserCmd* cmd)
{
    Vector real_view;

    m_engine()->GetViewAngles(real_view);
    Vector vMove(abs(cmd->m_forwardmove), abs(cmd->m_sidemove), abs(cmd->m_upmove));
    float flSpeed = sqrt(vMove.x * vMove.x + vMove.y * vMove.y), flYaw;
    Vector vMove2;
    math::VectorAngles(vMove, vMove2);
    vMove2.Normalize();
    flYaw = DEG2RAD(cmd->m_viewangles.y - g_ctx.globals.original.y + vMove2.y);
    cmd->m_forwardmove = cos(flYaw) * flSpeed;
    cmd->m_sidemove = sin(flYaw) * flSpeed;
    QAngle angResistance = QAngle(0, 0, 0);
    VectorAngles((g_ctx.local()->m_vecVelocity() * -1.f), angResistance);

    angResistance.yaw = real_view.y - angResistance.yaw;
    angResistance.pitch = real_view.x - angResistance.pitch;

    Vector vecResistance = Vector(0, 0, 0);
    AngleVectors(angResistance, vecResistance);

    cmd->m_forwardmove = std::clamp(vecResistance.x, -450.f, 450.f);
    cmd->m_sidemove = std::clamp(vecResistance.y, -450.f, 450.f);
}
bool aim::automatic_stop(CUserCmd* cmd)
{
    if (!should_stop)
        return true;

    if (!g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop)
        return true;

    if (g_ctx.globals.slowwalking)
        return true;

    if (!(g_ctx.local()->m_fFlags() & FL_ONGROUND && engineprediction::get().backup_data.flags & FL_ONGROUND)) //-V807
        return true;

    if (g_ctx.globals.weapon->is_empty())
        return true;

    if (!g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop_modifiers[AUTOSTOP_BETWEEN_SHOTS] && !g_ctx.globals.weapon->can_fire(false))
        return true;

    auto animlayer = g_ctx.local()->get_animlayers()[1];

    if(animlayer.m_nSequence)
    {
        auto activity = g_ctx.local()->sequence_activity(animlayer.m_nSequence);

        if (activity == ACT_CSGO_RELOAD && animlayer.m_flWeight > 0.0f)
            return true;
    }

    auto weapon_info = g_ctx.globals.weapon->get_csweapon_info();

    if (!weapon_info)
        return true;

    auto max_speed = 0.34f * (g_ctx.globals.scoped ? weapon_info->flMaxPlayerSpeedAlt : weapon_info->flMaxPlayerSpeed);

    if (engineprediction::get().backup_data.velocity.Length2D() < max_speed)
        slowwalk::get().create_move(cmd);
    else
    {
            AutoStop(cmd);//Suppupiririr shit that works
            if (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop_modifiers[AUTOSTOP_FORCE_ACCURACY]) {
                should_stop = true;
                return false;
            }
   
    }
    should_stop = false;
    return true;
}
credits @Maaaa34
max_speed should be 0.33 as its the accuracy speed
 
Пользователь
Статус
Оффлайн
Регистрация
20 Мар 2020
Сообщения
166
Реакции[?]
41
Поинты[?]
0
Чел слил мой порт автостопа с nothing для лв. Даже комментарий не убрал
 
KidauStep
Забаненный
Статус
Оффлайн
Регистрация
31 Окт 2020
Сообщения
324
Реакции[?]
54
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
1646386007319.png
 
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу