Вопрос [GMOD] не стреляет по ботам

Начинающий
Статус
Оффлайн
Регистрация
10 Апр 2022
Сообщения
183
Реакции[?]
16
Поинты[?]
5K
убираю проверку на игрока и чит начинает стрелять в рандомные точки, хотя мне надо что бы стрелял по ботом, заранее спасибо за помощь

C++:
target_info aimbot::find_best_target(c_user_cmd* cmd, c_base_entity* local_player)
{
    target_info target;
    priority_info& priority = target.priority_info;

    q_angle view_angles = cmd->view_angles;
    c_vector origin = local_player->get_abs_origin();

    c_vector eye_pos;
    local_player->get_eye_position(eye_pos);

    for (size_t i = 1; i <= interfaces::entity_list->get_highest_entity_index(); i++)
    {
        c_base_entity* entity = interfaces::entity_list->get_entity(i);


        if (!entity || !entity->is_player() || !entity->is_alive() || entity == local_player)
            continue;

        float simulation_time = entity->get_simulation_time();
        int distance = origin.distance_to(entity->get_abs_origin());
        int health = entity->get_health();
        c_vector shoot_pos;

        if (!get_hit_position(local_player, entity, shoot_pos))
        {
            if (!settings::aimbot::accuracy::backtrack)
                continue;

            lag_record record;
            if (!history::get_latest_record(i, record))
                continue;

            if (!get_hit_position(local_player, entity, shoot_pos, record.bone_to_world))
                continue;

            simulation_time = record.simulation_time;
            distance = record.origin.distance_to(entity->get_abs_origin());
        }

        q_angle angle = math::calc_angle(globals::view_origin, shoot_pos);

        float fov = utilities::get_fov(globals::view_angles, angle);
        if (fov > settings::aimbot::globals::fov)
            continue;

        q_angle shoot_angle = math::calc_angle(eye_pos, shoot_pos);

        bool should_skip = false;
        switch (settings::aimbot::globals::priority)
        {
        case 0: should_skip = fov > priority.fov; break;
        case 1: should_skip = distance > priority.distance; break;
        case 2: should_skip = health > priority.health; break;
        }

        if (should_skip)
            continue;

        priority.fov = fov;
        priority.distance = distance;
        priority.health = health;

        target.entity = entity;
        target.shoot_pos = shoot_pos;
        target.shoot_angle = shoot_angle;
        target.simulation_time = simulation_time;
    }

    return target;
}
 
Сверху Снизу