-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
C++:
bool c_aimbot::calculate_hitchance( Vector& aim_angle, int& final_hitchance ) {
const auto weapon_info = globals::weapon->get_cs_weapon_info( );
if ( !weapon_info ) {
final_hitchance = 0;
return false;
}
const auto hitchance_cfg = g_cfg.ragebot.hitchance_amount;
if ( ( globals::shoot_position - final_target.point.point ).Length( ) > info->flRange ) {
final_hitchance = 0;
return false;
}
static auto nospread = cvar->FindVar( "weapon_accuracy_nospread" );
if ( nospread->GetBool( ) ) {
final_hitchance = 100;
return true;
}
auto forward = Vector( 0, 0, 0 );
auto right = Vector( 0, 0, 0 );
auto up = Vector( 0, 0, 0 );
Math::AngleVectors(aim_angle, &forward, &right, &up);
Math::FastVecNormalize( forward );
Math::FastVecNormalize( right );
Math::FastVecNormalize( up );
auto total_hits = 0;
float /*c_value, */spread_value, inaccuracy_value;
Vector spread_view, direction, end;
for (auto i = 0; i < 256; i++) {
float a = Math::RandomFloat(0.f, 1.f);
float b = Math::RandomFloat(0.f, M_PI * 2.f);
float c = Math::RandomFloat(0.f, 1.f);
float d = Math::RandomFloat(0.f, M_PI * 2.f);
inaccuracy_value = a * globals::inaccuracy;
spread_value = c * globals::spread;
spread_view = ( ( cos(b ) * inaccuracy_value ) + ( cos ( d ) * spread_value ), ( sin ( b ) * inaccuracy_value ) + ( sin( d ) * spread_value ), 0 );
direction.x = forward.x + ( spread_view.x * right.x ) + ( spread_view.y * up.x );
direction.y = forward.y + ( spread_view.x * right.y ) + ( spread_view.y * up.y );
direction.z = forward.z + ( spread_view.x * right.z ) + ( spread_view.y * up.z );
end = globals::shoot_position + ( direction * info->flRange );
if ( HitboxIntersection( final_target.record->player, final_target.record->MainMatrix, final_target.hitbox, globals::shoot_position, end ) )
++total_hits;
if ( ( static_cast< float >( total_hits ) / 256.f ) * 100.f >= hitchance_cfg )
{
final_hitchance = (static_cast< float >( total_hits ) / 256.f) * 100.f;
return true;
}
}
return false;
}
LNK1181, slazy, и TTX никак не причастны это всего лишь пастирония
Последнее редактирование: