- Статус
- Оффлайн
- Регистрация
- 24 Сен 2020
- Сообщения
- 61
- Реакции
- 14
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
C++:
bool HitTraces(animation* _animation, const Vector position, const float chance, int box)
{
const auto weapon = csgo->weapon;
if (!weapon)
return false;
const auto studio_model = interfaces.models.model_info->GetStudioModel(_animation->player->GetModel());
if (!studio_model)
return false;
auto start = csgo->local->GetEyePosition();
const auto aim_angle = Math::CalculateAngle(start, position);
Vector forward, right, up;
Math::AngleVectors(aim_angle, forward, right, up);
size_t total_hits{ }, needed_hits{ (size_t)_CMATH_::ceil((chance * 255) / 100.f) };
auto current = 0;
float a = random_float(0.f, 1.f);
float b = random_float(0.f, 2.f * pi);
float c = random_float(0.f, 1.f);
float d = random_float(0.f, 2.f * pi);
Vector total_spread, spread_angle, end;
for (auto i = 0u; i < total_seeds; i++)
{
float spread_lol = weapon->GetSpread();
float inaccuracy_lol = weapon->GetInaccuracy();
float inaccuracy = a * inaccuracy_lol;
float spread = c * spread_lol;
Vector spreadView((cos(b) * inaccuracy) + (cos(d) * spread), (sin(b) * inaccuracy) + (sin(d) * spread), 0), total_spread;
total_spread.x = forward.x + (spreadView.x * right.x) + (spreadView.y * up.x);
total_spread.y = forward.y + (spreadView.x * right.y) + (spreadView.y * up.y);
total_spread.z = forward.z + (spreadView.x * right.z) + (spreadView.y * up.z);
total_spread.NormalizeInPlace();
Math::VectorAngles(total_spread, spread_angle, up);
Math::normalize(spread_angle);
end.Normalize();
Math::AngleVectors(spread_angle, spread_angle);
end = start + (end * info->m_flRange);
if (CanHitHitbox(start, end, _animation, studio_model, box))
total_hits++;
if (static_cast<int>((static_cast<float>(total_hits) / total_seeds) * 100.f) >= chance)
return true;
if ((total_seeds - i + total_hits) < needed_hits)
return false;
}
return false;
}
}