а как реализовать проверку на ближайшего игрока? типо с помощью DistTo() как-то?fire_data.distance и проверка на игрока который ближе к тебе, весь скан закончен, ну или переделай scan targets
да, можешь еще через хитбокс матрикс юзануть чек от своей головы к голове противникаа как реализовать проверку на ближайшего игрока? типо с помощью DistTo() как-то?
не оч разбираюсь в этом всем, но это должно как-то так выглядеть?да, можешь еще через хитбокс матрикс юзануть чек от своей головы к голове противника
еще чекай через eye_pos в лв где ты и твой противник
auto position = g_ctx.globals.eye_pos.DistTo(player->hitbox_position_matrix(HITBOX_HEAD, player_record->matrixes_data.first));
auto distance = g_ctx.local()->GetAbsOrigin().DistTo(player->GetAbsOrigin())
if (position > distance) {
//жоскискан
}
не оч разбираюсь в этом всем, но это должно как-то так выглядеть?
если нет, можно хотябы какой-то пример? а то пока-что я понял что сам ничего не понялКод:auto position = g_ctx.globals.eye_pos.DistTo(player->hitbox_position_matrix(HITBOX_HEAD, player_record->matrixes_data.first)); auto distance = g_ctx.local()->GetAbsOrigin().DistTo(player->GetAbsOrigin()) if (position > distance) { //жоскискан }
auto position = g_ctx.globals.eye_pos.DistTo(player->hitbox_position_matrix(HITBOX_HEAD, player_record->matrixes_data.main));
auto distance = g_ctx.local()->GetAbsOrigin().DistTo(player->GetAbsOrigin())
if (position > distance) {
//жоскискан
}
ну все получается теперь пихаем это в скан таким макаром:auto position = g_ctx.globals.eye_pos.DistTo(player->hitbox_position_matrix(HITBOX_HEAD, player_record->matrixes_data.main));
auto distance = g_ctx.local()->GetAbsOrigin().DistTo(player->GetAbsOrigin())
if (position > distance) {
//жоскискан
}
делай дальше
void aim::scan(adjust_data* record, scan_data& data, const Vector& shoot_position, bool optimized)
{
player_t* player;
auto position = g_ctx.globals.eye_pos.DistTo(player->hitbox_position_matrix(HITBOX_HEAD, record->matrixes_data.first));
auto distance = g_ctx.local()->GetAbsOrigin().DistTo(player->GetAbsOrigin());
if (position > distance) {
auto weapon = optimized ? g_ctx.local()->m_hActiveWeapon().Get() : g_ctx.globals.weapon;
if (!weapon)
return;
auto weapon_info = weapon->get_csweapon_info();
if (!weapon_info)
return;
auto hitboxes = get_hitboxes(record, optimized);
if (hitboxes.empty())
return;
auto force_safe_points = record->player->m_iHealth() <= weapon_info->iDamage || key_binds::get().get_key_bind_state(3) || g_cfg.player_list.force_safe_points[record->i] || g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].max_misses && g_ctx.globals.missed_shots[record->i] >= g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].max_misses_amount; //-V648
auto best_damage = 0;
auto minimum_damage = get_minimum_damage(false, record->player->m_iHealth());
auto minimum_visible_damage = get_minimum_damage(true, record->player->m_iHealth());
auto get_hitgroup = [](const int& hitbox)
{
if (hitbox == HITBOX_HEAD)
return 0;
else if (hitbox == HITBOX_PELVIS)
return 1;
else if (hitbox == HITBOX_STOMACH)
return 2;
else if (hitbox >= HITBOX_LOWER_CHEST && hitbox <= HITBOX_UPPER_CHEST)
return 3;
else if (hitbox >= HITBOX_RIGHT_THIGH && hitbox <= HITBOX_LEFT_FOOT)
return 4;
else if (hitbox >= HITBOX_RIGHT_HAND && hitbox <= HITBOX_LEFT_FOREARM)
return 5;
return -1;
};
std::vector <scan_point> points; //-V826
for (auto& hitbox : hitboxes)
{
if (optimized)
{
points.emplace_back(scan_point(record->player->hitbox_position_matrix(hitbox, record->matrixes_data.main), hitbox, true));
continue;
}
auto current_points = get_points(record, hitbox);
for (auto& point : current_points)
{
if (!record->bot)
{
auto safe = 0.0f;
if (record->matrixes_data.zero[0].GetOrigin() == record->matrixes_data.first[0].GetOrigin() || record->matrixes_data.zero[0].GetOrigin() == record->matrixes_data.second[0].GetOrigin() || record->matrixes_data.first[0].GetOrigin() == record->matrixes_data.second[0].GetOrigin())
safe = 0.0f;
else if (!hitbox_intersection(record->player, record->matrixes_data.zero, hitbox, shoot_position, point.point, &safe))
safe = 0.0f;
else if (!hitbox_intersection(record->player, record->matrixes_data.first, hitbox, shoot_position, point.point, &safe))
safe = 0.0f;
else if (!hitbox_intersection(record->player, record->matrixes_data.second, hitbox, shoot_position, point.point, &safe))
safe = 0.0f;
point.safe = safe;
}
else
point.safe = 1.0f;
if (!force_safe_points || point.safe)
points.emplace_back(point);
}
}
if (!optimized)
{
for (auto& point : points)
{
if (points.empty())
return;
if (point.hitbox == HITBOX_HEAD)
continue;
for (auto it = points.begin(); it != points.end(); ++it)
{
if (point.point == it->point)
continue;
auto first_angle = math::calculate_angle(shoot_position, point.point);
auto second_angle = math::calculate_angle(shoot_position, it->point);
auto distance = shoot_position.DistTo(point.point);
auto fov = math::fast_sin(DEG2RAD(math::get_fov(first_angle, second_angle))) * distance;
if (fov < 5.0f)
{
points.erase(it);
break;
}
}
}
}
if (points.empty())
return;
if (!optimized)
std::sort(points.begin(), points.end(), compare_points);
auto body_hitboxes = true;
for (auto& point : points)
{
if (!optimized && body_hitboxes && (point.hitbox < HITBOX_PELVIS || point.hitbox > HITBOX_UPPER_CHEST))
{
body_hitboxes = false;
if (g_cfg.player_list.force_body_aim[record->i])
break;
if (key_binds::get().get_key_bind_state(22))
break;
if (best_damage >= record->player->m_iHealth())
break;
if (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].prefer_body_aim && best_damage >= 1)
break;
}
if (!optimized && (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].prefer_safe_points || force_safe_points) && data.point.safe && data.point.safe < point.safe)
continue;
auto fire_data = autowall::get().wall_penetration(shoot_position, point.point, record->player);
if (!fire_data.valid)
continue;
if (fire_data.damage < 1)
continue;
if (!fire_data.visible && !g_cfg.ragebot.autowall)
continue;
if (!optimized && get_hitgroup(fire_data.hitbox) != get_hitgroup(point.hitbox))
continue;
auto current_minimum_damage = fire_data.visible ? minimum_visible_damage : minimum_damage;
if (fire_data.damage >= current_minimum_damage && fire_data.damage >= best_damage)
{
if (!optimized && !should_stop)
{
should_stop = true;
if (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop_modifiers[AUTOSTOP_LETHAL] && fire_data.damage < record->player->m_iHealth())
should_stop = false;
else if (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop_modifiers[AUTOSTOP_VISIBLE] && !fire_data.visible)
should_stop = false;
else if (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop_modifiers[AUTOSTOP_CENTER] && !point.center)
should_stop = false;
}
if (!optimized && force_safe_points && !point.safe)
continue;
best_damage = fire_data.damage;
data.point = point;
data.visible = fire_data.visible;
data.damage = fire_data.damage;
data.hitbox = fire_data.hitbox;
if (optimized)
return;
}
}
}
}
умничка!ну все получается теперь пихаем это в скан таким макаром:
а в скан таргет просто ограничиваем сканируемых до 3 или 4 человКод:void aim::scan(adjust_data* record, scan_data& data, const Vector& shoot_position, bool optimized) { player_t* player; auto position = g_ctx.globals.eye_pos.DistTo(player->hitbox_position_matrix(HITBOX_HEAD, record->matrixes_data.first)); auto distance = g_ctx.local()->GetAbsOrigin().DistTo(player->GetAbsOrigin()); if (position > distance) { auto weapon = optimized ? g_ctx.local()->m_hActiveWeapon().Get() : g_ctx.globals.weapon; if (!weapon) return; auto weapon_info = weapon->get_csweapon_info(); if (!weapon_info) return; auto hitboxes = get_hitboxes(record, optimized); if (hitboxes.empty()) return; auto force_safe_points = record->player->m_iHealth() <= weapon_info->iDamage || key_binds::get().get_key_bind_state(3) || g_cfg.player_list.force_safe_points[record->i] || g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].max_misses && g_ctx.globals.missed_shots[record->i] >= g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].max_misses_amount; //-V648 auto best_damage = 0; auto minimum_damage = get_minimum_damage(false, record->player->m_iHealth()); auto minimum_visible_damage = get_minimum_damage(true, record->player->m_iHealth()); auto get_hitgroup = [](const int& hitbox) { if (hitbox == HITBOX_HEAD) return 0; else if (hitbox == HITBOX_PELVIS) return 1; else if (hitbox == HITBOX_STOMACH) return 2; else if (hitbox >= HITBOX_LOWER_CHEST && hitbox <= HITBOX_UPPER_CHEST) return 3; else if (hitbox >= HITBOX_RIGHT_THIGH && hitbox <= HITBOX_LEFT_FOOT) return 4; else if (hitbox >= HITBOX_RIGHT_HAND && hitbox <= HITBOX_LEFT_FOREARM) return 5; return -1; }; std::vector <scan_point> points; //-V826 for (auto& hitbox : hitboxes) { if (optimized) { points.emplace_back(scan_point(record->player->hitbox_position_matrix(hitbox, record->matrixes_data.main), hitbox, true)); continue; } auto current_points = get_points(record, hitbox); for (auto& point : current_points) { if (!record->bot) { auto safe = 0.0f; if (record->matrixes_data.zero[0].GetOrigin() == record->matrixes_data.first[0].GetOrigin() || record->matrixes_data.zero[0].GetOrigin() == record->matrixes_data.second[0].GetOrigin() || record->matrixes_data.first[0].GetOrigin() == record->matrixes_data.second[0].GetOrigin()) safe = 0.0f; else if (!hitbox_intersection(record->player, record->matrixes_data.zero, hitbox, shoot_position, point.point, &safe)) safe = 0.0f; else if (!hitbox_intersection(record->player, record->matrixes_data.first, hitbox, shoot_position, point.point, &safe)) safe = 0.0f; else if (!hitbox_intersection(record->player, record->matrixes_data.second, hitbox, shoot_position, point.point, &safe)) safe = 0.0f; point.safe = safe; } else point.safe = 1.0f; if (!force_safe_points || point.safe) points.emplace_back(point); } } if (!optimized) { for (auto& point : points) { if (points.empty()) return; if (point.hitbox == HITBOX_HEAD) continue; for (auto it = points.begin(); it != points.end(); ++it) { if (point.point == it->point) continue; auto first_angle = math::calculate_angle(shoot_position, point.point); auto second_angle = math::calculate_angle(shoot_position, it->point); auto distance = shoot_position.DistTo(point.point); auto fov = math::fast_sin(DEG2RAD(math::get_fov(first_angle, second_angle))) * distance; if (fov < 5.0f) { points.erase(it); break; } } } } if (points.empty()) return; if (!optimized) std::sort(points.begin(), points.end(), compare_points); auto body_hitboxes = true; for (auto& point : points) { if (!optimized && body_hitboxes && (point.hitbox < HITBOX_PELVIS || point.hitbox > HITBOX_UPPER_CHEST)) { body_hitboxes = false; if (g_cfg.player_list.force_body_aim[record->i]) break; if (key_binds::get().get_key_bind_state(22)) break; if (best_damage >= record->player->m_iHealth()) break; if (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].prefer_body_aim && best_damage >= 1) break; } if (!optimized && (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].prefer_safe_points || force_safe_points) && data.point.safe && data.point.safe < point.safe) continue; auto fire_data = autowall::get().wall_penetration(shoot_position, point.point, record->player); if (!fire_data.valid) continue; if (fire_data.damage < 1) continue; if (!fire_data.visible && !g_cfg.ragebot.autowall) continue; if (!optimized && get_hitgroup(fire_data.hitbox) != get_hitgroup(point.hitbox)) continue; auto current_minimum_damage = fire_data.visible ? minimum_visible_damage : minimum_damage; if (fire_data.damage >= current_minimum_damage && fire_data.damage >= best_damage) { if (!optimized && !should_stop) { should_stop = true; if (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop_modifiers[AUTOSTOP_LETHAL] && fire_data.damage < record->player->m_iHealth()) should_stop = false; else if (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop_modifiers[AUTOSTOP_VISIBLE] && !fire_data.visible) should_stop = false; else if (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop_modifiers[AUTOSTOP_CENTER] && !point.center) should_stop = false; } if (!optimized && force_safe_points && !point.safe) continue; best_damage = fire_data.damage; data.point = point; data.visible = fire_data.visible; data.damage = fire_data.damage; data.hitbox = fire_data.hitbox; if (optimized) return; } } } }
спасибо)))))умничка!
why the fuck are you continuing in a void ????????????what?
I threw an application in others. By the way, wouldn't it be better to check right away in run? sort of like this:
Код:player_t*player; auto position = g_ctx.globals.eye_pos.DistTo(player->hitbox_position_matrix(HITBOX_HEAD, record->matrixes_data.first)); auto distance = g_ctx.local()->GetAbsOrigin().DistTo(player->GetAbsOrigin()); if (position > distance) { scan(target.last_record, last_data, predicted_eye_pos, true); } else{ continue; }
for(auto& target : targets)why the fuck are you continuing in a void ????????????
Код и вправду залупа, но тебе же похуй)а понял, я просто думал ты о том что код залупа
Блять, а не легче было это пихнуть в prepare_targets?ну все получается теперь пихаем это в скан таким макаром:
а в скан таргет просто ограничиваем сканируемых до 3 или 4 человКод:void aim::scan(adjust_data* record, scan_data& data, const Vector& shoot_position, bool optimized) { player_t* player; auto position = g_ctx.globals.eye_pos.DistTo(player->hitbox_position_matrix(HITBOX_HEAD, record->matrixes_data.first)); auto distance = g_ctx.local()->GetAbsOrigin().DistTo(player->GetAbsOrigin()); if (position > distance) { auto weapon = optimized ? g_ctx.local()->m_hActiveWeapon().Get() : g_ctx.globals.weapon; if (!weapon) return; auto weapon_info = weapon->get_csweapon_info(); if (!weapon_info) return; auto hitboxes = get_hitboxes(record, optimized); if (hitboxes.empty()) return; auto force_safe_points = record->player->m_iHealth() <= weapon_info->iDamage || key_binds::get().get_key_bind_state(3) || g_cfg.player_list.force_safe_points[record->i] || g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].max_misses && g_ctx.globals.missed_shots[record->i] >= g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].max_misses_amount; //-V648 auto best_damage = 0; auto minimum_damage = get_minimum_damage(false, record->player->m_iHealth()); auto minimum_visible_damage = get_minimum_damage(true, record->player->m_iHealth()); auto get_hitgroup = [](const int& hitbox) { if (hitbox == HITBOX_HEAD) return 0; else if (hitbox == HITBOX_PELVIS) return 1; else if (hitbox == HITBOX_STOMACH) return 2; else if (hitbox >= HITBOX_LOWER_CHEST && hitbox <= HITBOX_UPPER_CHEST) return 3; else if (hitbox >= HITBOX_RIGHT_THIGH && hitbox <= HITBOX_LEFT_FOOT) return 4; else if (hitbox >= HITBOX_RIGHT_HAND && hitbox <= HITBOX_LEFT_FOREARM) return 5; return -1; }; std::vector <scan_point> points; //-V826 for (auto& hitbox : hitboxes) { if (optimized) { points.emplace_back(scan_point(record->player->hitbox_position_matrix(hitbox, record->matrixes_data.main), hitbox, true)); continue; } auto current_points = get_points(record, hitbox); for (auto& point : current_points) { if (!record->bot) { auto safe = 0.0f; if (record->matrixes_data.zero[0].GetOrigin() == record->matrixes_data.first[0].GetOrigin() || record->matrixes_data.zero[0].GetOrigin() == record->matrixes_data.second[0].GetOrigin() || record->matrixes_data.first[0].GetOrigin() == record->matrixes_data.second[0].GetOrigin()) safe = 0.0f; else if (!hitbox_intersection(record->player, record->matrixes_data.zero, hitbox, shoot_position, point.point, &safe)) safe = 0.0f; else if (!hitbox_intersection(record->player, record->matrixes_data.first, hitbox, shoot_position, point.point, &safe)) safe = 0.0f; else if (!hitbox_intersection(record->player, record->matrixes_data.second, hitbox, shoot_position, point.point, &safe)) safe = 0.0f; point.safe = safe; } else point.safe = 1.0f; if (!force_safe_points || point.safe) points.emplace_back(point); } } if (!optimized) { for (auto& point : points) { if (points.empty()) return; if (point.hitbox == HITBOX_HEAD) continue; for (auto it = points.begin(); it != points.end(); ++it) { if (point.point == it->point) continue; auto first_angle = math::calculate_angle(shoot_position, point.point); auto second_angle = math::calculate_angle(shoot_position, it->point); auto distance = shoot_position.DistTo(point.point); auto fov = math::fast_sin(DEG2RAD(math::get_fov(first_angle, second_angle))) * distance; if (fov < 5.0f) { points.erase(it); break; } } } } if (points.empty()) return; if (!optimized) std::sort(points.begin(), points.end(), compare_points); auto body_hitboxes = true; for (auto& point : points) { if (!optimized && body_hitboxes && (point.hitbox < HITBOX_PELVIS || point.hitbox > HITBOX_UPPER_CHEST)) { body_hitboxes = false; if (g_cfg.player_list.force_body_aim[record->i]) break; if (key_binds::get().get_key_bind_state(22)) break; if (best_damage >= record->player->m_iHealth()) break; if (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].prefer_body_aim && best_damage >= 1) break; } if (!optimized && (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].prefer_safe_points || force_safe_points) && data.point.safe && data.point.safe < point.safe) continue; auto fire_data = autowall::get().wall_penetration(shoot_position, point.point, record->player); if (!fire_data.valid) continue; if (fire_data.damage < 1) continue; if (!fire_data.visible && !g_cfg.ragebot.autowall) continue; if (!optimized && get_hitgroup(fire_data.hitbox) != get_hitgroup(point.hitbox)) continue; auto current_minimum_damage = fire_data.visible ? minimum_visible_damage : minimum_damage; if (fire_data.damage >= current_minimum_damage && fire_data.damage >= best_damage) { if (!optimized && !should_stop) { should_stop = true; if (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop_modifiers[AUTOSTOP_LETHAL] && fire_data.damage < record->player->m_iHealth()) should_stop = false; else if (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop_modifiers[AUTOSTOP_VISIBLE] && !fire_data.visible) should_stop = false; else if (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop_modifiers[AUTOSTOP_CENTER] && !point.center) should_stop = false; } if (!optimized && force_safe_points && !point.safe) continue; best_damage = fire_data.damage; data.point = point; data.visible = fire_data.visible; data.damage = fire_data.damage; data.hitbox = fire_data.hitbox; if (optimized) return; } } } }
да я уже понял всё с этим + в скане оно крашилоБлять, а не легче было это пихнуть в prepare_targets?
Проект предоставляет различный материал, относящийся к сфере киберспорта, программирования, ПО для игр, а также позволяет его участникам общаться на многие другие темы. Почта для жалоб: admin@yougame.biz