C++ Fix for rifk7 desync

Забаненный
Статус
Оффлайн
Регистрация
12 Май 2019
Сообщения
48
Реакции[?]
38
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Код:
void c_antiaim::fakelag(c_cs_player* local, c_user_cmd* cmd, bool& send_packet)
{
    static constexpr auto target_standing = 1;
    static constexpr auto target_moving = 13;
    static constexpr auto target_air = 8;

    static auto last_origin = c_vector3d();
    static auto last_simtime = 0.f;
    static auto last_ducked = false;
    static auto fakeland = false;

    static auto onpeek_timer = 0.f;
    static auto unduck_timer = 0.f;

    static auto onpeek = false;

    auto choke_amount = target_standing;

    choke_amount = std::max(14, target_standing);

    if (!local || !local->is_alive() || !cmd || game_rules->is_freeze_period())
        return;

    const auto weapon = reinterpret_cast<c_base_combat_weapon*>(
        client_entity_list()->get_client_entity_from_handle(local->get_current_weapon_handle()));

    if (!weapon)
        return;

    const auto info = weapon_system->get_weapon_data(weapon->get_item_definition());

    if (!info)
        return;

    const auto max_choke_amount = game_rules->is_valve_ds() ? 9u : 15u;

    if (local->get_velocity().length2d() > info->get_standing_accuracy(weapon) || local->get_duck_amount() > 0.f)
        choke_amount = target_moving;

    if (!local->is_on_ground())
        choke_amount = target_air;

    // are we in on peek?
    if (onpeek_timer > global_vars_base->curtime + ticks_to_time(16))
    {
        onpeek_timer = 0.f;
        onpeek = false;
    }

    // are we in unduck?
    if (unduck_timer > global_vars_base->curtime + ticks_to_time(16))
        unduck_timer = 0.f;

    // extend fake lag to maximum.
    if (onpeek_timer >= global_vars_base->curtime || unduck_timer >= global_vars_base->curtime)
        choke_amount = max_choke_amount + 1;

    // force enemy to extrapolate us.
    if (last_simtime == global_vars_base->curtime - global_vars_base->interval_per_tick
        && (local->get_origin() - last_origin).length2dsqr() > 4096.f)
        choke_amount = 1;

    auto missing_target = false;

    if (on_peek(local, missing_target))
    {
        if (!onpeek && onpeek_timer < global_vars_base->curtime)
        {
            onpeek_timer = global_vars_base->curtime + ticks_to_time(16);
            if (client_state->choked_commands > 1)
                choke_amount = 1;
        }

        onpeek = true;
    }
    else if (missing_target)
        onpeek = false;

    if (local->get_flags() & c_base_player::flags::on_ground
        && !(cmd->buttons & c_user_cmd::flags::duck) && last_ducked)
    {
        if (unduck_timer < global_vars_base->curtime)
        {
            unduck_timer = global_vars_base->curtime + ticks_to_time(16);

            if (client_state->choked_commands > 1)
            {
                cmd->buttons |= c_user_cmd::flags::duck;
                choke_amount = 1;
            }
        }
    }

    if (unduck_timer > global_vars_base->curtime - ticks_to_time(2) && !client_state->choked_commands)
        cmd->buttons |= c_user_cmd::flags::duck;

    // fake land to desync animations for pasted cheats.
    auto origin = local->get_origin();
    auto velocity = local->get_velocity();
    auto flags = local->get_flags();
    c_trace_system::extrapolate(local, origin, velocity, flags,
        prediction_system->unpredicted_flags & c_base_player::on_ground);
    if (flags & c_base_player::flags::on_ground
        && !(local->get_flags() & c_base_player::flags::on_ground))
    {
        fakeland = fabsf(math::normalize_yaw(local->get_lby()
            - animation_system->local_animation.eye_angles.y)) > 35.f;

        choke_amount = fakeland ? max_choke_amount : 0;
    }
    else if (local->get_flags() & c_base_player::flags::on_ground && fakeland)
    {
        fakeland = false;
        choke_amount = 1;
    }

    if (global_vars_base->curtime + global_vars_base->interval_per_tick > next_lby_update
        || lby_update >= global_vars_base->curtime - global_vars_base->interval_per_tick)
        choke_amount = max_choke_amount;


    const auto shot_last_tick = antiaim->shot_cmd <= cmd->command_number && antiaim->shot_cmd > cmd->command_number - client_state->choked_commands;
    estimated_choke = choke_amount;

    static int fox = 0;
    if (fox >= 0 && fox < choke_amount)
    {

        client_state->choked_commands = fox;
        fox++;
    }
    else
        fox = 0;

    // store data of current tick for next evaluation.
    last_origin = local->get_origin();
    last_simtime = global_vars_base->curtime;
    last_ducked = cmd->buttons & c_user_cmd::flags::duck;

} [/ CODE]
 
Последнее редактирование:
Забаненный
Статус
Оффлайн
Регистрация
12 Май 2019
Сообщения
48
Реакции[?]
38
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Забаненный
Статус
Оффлайн
Регистрация
28 Июн 2019
Сообщения
99
Реакции[?]
7
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
и как их в код ставить ?
 
Эксперт
Статус
Оффлайн
Регистрация
17 Фев 2017
Сообщения
864
Реакции[?]
420
Поинты[?]
1K
Код:
void c_antiaim::fakelag(c_cs_player* local, c_user_cmd* cmd, bool& send_packet)
{
    static constexpr auto target_standing = 1;
    static constexpr auto target_moving = 13;
    static constexpr auto target_air = 8;

    static auto last_origin = c_vector3d();
    static auto last_simtime = 0.f;
    static auto last_ducked = false;
    static auto fakeland = false;

    static auto onpeek_timer = 0.f;
    static auto unduck_timer = 0.f;

    static auto onpeek = false;

    auto choke_amount = target_standing;

    choke_amount = std::max(14, target_standing);

    if (!local || !local->is_alive() || !cmd || game_rules->is_freeze_period())
        return;

    const auto weapon = reinterpret_cast<c_base_combat_weapon*>(
        client_entity_list()->get_client_entity_from_handle(local->get_current_weapon_handle()));

    if (!weapon)
        return;

    const auto info = weapon_system->get_weapon_data(weapon->get_item_definition());

    if (!info)
        return;

    const auto max_choke_amount = game_rules->is_valve_ds() ? 9u : 15u;

    if (local->get_velocity().length2d() > info->get_standing_accuracy(weapon) || local->get_duck_amount() > 0.f)
        choke_amount = target_moving;

    if (!local->is_on_ground())
        choke_amount = target_air;

    // are we in on peek?
    if (onpeek_timer > global_vars_base->curtime + ticks_to_time(16))
    {
        onpeek_timer = 0.f;
        onpeek = false;
    }

    // are we in unduck?
    if (unduck_timer > global_vars_base->curtime + ticks_to_time(16))
        unduck_timer = 0.f;

    // extend fake lag to maximum.
    if (onpeek_timer >= global_vars_base->curtime || unduck_timer >= global_vars_base->curtime)
        choke_amount = max_choke_amount + 1;

    // force enemy to extrapolate us.
    if (last_simtime == global_vars_base->curtime - global_vars_base->interval_per_tick
        && (local->get_origin() - last_origin).length2dsqr() > 4096.f)
        choke_amount = 1;

    auto missing_target = false;

    if (on_peek(local, missing_target))
    {
        if (!onpeek && onpeek_timer < global_vars_base->curtime)
        {
            onpeek_timer = global_vars_base->curtime + ticks_to_time(16);
            if (client_state->choked_commands > 1)
                choke_amount = 1;
        }

        onpeek = true;
    }
    else if (missing_target)
        onpeek = false;

    if (local->get_flags() & c_base_player::flags::on_ground
        && !(cmd->buttons & c_user_cmd::flags::duck) && last_ducked)
    {
        if (unduck_timer < global_vars_base->curtime)
        {
            unduck_timer = global_vars_base->curtime + ticks_to_time(16);

            if (client_state->choked_commands > 1)
            {
                cmd->buttons |= c_user_cmd::flags::duck;
                choke_amount = 1;
            }
        }
    }

    if (unduck_timer > global_vars_base->curtime - ticks_to_time(2) && !client_state->choked_commands)
        cmd->buttons |= c_user_cmd::flags::duck;

    // fake land to desync animations for pasted cheats.
    auto origin = local->get_origin();
    auto velocity = local->get_velocity();
    auto flags = local->get_flags();
    c_trace_system::extrapolate(local, origin, velocity, flags,
        prediction_system->unpredicted_flags & c_base_player::on_ground);
    if (flags & c_base_player::flags::on_ground
        && !(local->get_flags() & c_base_player::flags::on_ground))
    {
        fakeland = fabsf(math::normalize_yaw(local->get_lby()
            - animation_system->local_animation.eye_angles.y)) > 35.f;

        choke_amount = fakeland ? max_choke_amount : 0;
    }
    else if (local->get_flags() & c_base_player::flags::on_ground && fakeland)
    {
        fakeland = false;
        choke_amount = 1;
    }

    if (global_vars_base->curtime + global_vars_base->interval_per_tick > next_lby_update
        || lby_update >= global_vars_base->curtime - global_vars_base->interval_per_tick)
        choke_amount = max_choke_amount;


    const auto shot_last_tick = antiaim->shot_cmd <= cmd->command_number && antiaim->shot_cmd > cmd->command_number - client_state->choked_commands;
    estimated_choke = choke_amount;

    static int fox = 0;
    if (fox >= 0 && fox < choke_amount)
    {

        client_state->choked_commands = fox;
        fox++;
    }
    else
        fox = 0;

    // store data of current tick for next evaluation.
    last_origin = local->get_origin();
    last_simtime = global_vars_base->curtime;
    last_ducked = cmd->buttons & c_user_cmd::flags::duck;

} [/ CODE]
I just updated client state struct because of it's outdate on rifk7 sources. You can paste newest one from some virtuosity src.
It's works fine for me, but I have a problem with prediction when I turning rage on. Also rifk7 have issues with shooting and I missing due to spread most of the time. It's not a hitchance issue, but the problem with shooting
 
Забаненный
Статус
Оффлайн
Регистрация
12 Май 2019
Сообщения
48
Реакции[?]
38
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Пожалуйста, авторизуйтесь для просмотра ссылки.

Пожалуйста, авторизуйтесь для просмотра ссылки.
I just updated client state struct because of it's outdate on rifk7 sources. You can paste newest one from some virtuosity src.
It's works fine for me, but I have a problem with prediction when I turning rage on. Also rifk7 have issues with shooting and I missing due to spread most of the time. It's not a hitchance issue, but the problem with shooting
i havent had any problems with shooting and stuff apart from when it comes to fps do u know what are the main fps drops in rifk7 and how i can fix that
 
Последнее редактирование:
Забаненный
Статус
Оффлайн
Регистрация
28 Июн 2019
Сообщения
99
Реакции[?]
7
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
how to add damage ofite?
 
Эксперт
Статус
Оффлайн
Регистрация
17 Фев 2017
Сообщения
864
Реакции[?]
420
Поинты[?]
1K
Пожалуйста, авторизуйтесь для просмотра ссылки.

Пожалуйста, авторизуйтесь для просмотра ссылки.

i havent had any problems with shooting and stuff apart from when it comes to fps do u know what are the main fps drops in rifk7 and how i can fix that
All that I know, that rifk7 have fps drops while rage is scanning. So the main problem you should find in your scan_record method.

It is caused by scanning like ENEMY_COUNT * SCAN_RECORDS COUNT * HITSCAN_BOXES * MULTIPOINTS_PER_BOX.

You can save your fps by decreasing ragebot sensity like removing your backtrack away or just remove multipoints from your hitscan by commenting this function called select_multipoints.
It's a stupid ghetto method. But the best idea of fixing this this is just add safety check to your autowall for fraction. Because cheat is scanning mp while enemies behind unpenetrable walls, while it makes no real sense.
 
Забаненный
Статус
Оффлайн
Регистрация
12 Май 2019
Сообщения
48
Реакции[?]
38
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
g
 
Последнее редактирование:
Сверху Снизу