daily pastebin goal
78%
SHARE
TWEET

Untitled

a guest Feb 19th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "aimbot.h"
  2. #include "..\autowall\autowall.h"
  3. #include "..\sdk\animation_state.h"
  4. #define clamp(val, min, max) (((val) > (max)) ? (max) : (((val) < (min)) ? (min) : (val)))
  5. inline float FastSqrt(float x)
  6. {
  7.     unsigned int i = *(unsigned int*)&x;
  8.     i += 127 << 23;
  9.     i >>= 1;
  10.     return *(float*)&i;
  11. }
  12. #define square( x ) ( x * x )
  13. void ClampMovement(CUserCmd* pCommand, float fMaxSpeed)
  14. {
  15.     if (fMaxSpeed <= 0.f)
  16.         return;
  17.     float fSpeed = (float)(FastSqrt(square(pCommand->m_forwardmove) + square(pCommand->m_sidemove) + square(pCommand->m_upmove)));
  18.     if (fSpeed <= 0.f)
  19.         return;
  20.     if (pCommand->m_buttons & IN_DUCK)
  21.         fMaxSpeed *= 2.94117647f; // TO DO: Maybe look trough the leaked sdk for an exact value since this is straight out of my ass...
  22.     if (fSpeed <= fMaxSpeed)
  23.         return;
  24.     float fRatio = fMaxSpeed / fSpeed;
  25.     pCommand->m_forwardmove *= fRatio;
  26.     pCommand->m_sidemove *= fRatio;
  27.     pCommand->m_upmove *= fRatio;
  28. }
  29. void aimbot::create_move(CUserCmd * m_pcmd) {
  30.     g_csgo.m_engine( )->GetViewAngles( this->engine_angles );
  31.     this->local_weapon = g_ctx.m_local->m_hActiveWeapon( ).Get( );
  32.  
  33.     auto weapon_recoil_scale = g_csgo.m_cvar( )->FindVar( "weapon_recoil_scale" );
  34.     this->recoil_scale = weapon_recoil_scale->GetFloat( );
  35.  
  36.     if ( !local_weapon )
  37.         return;
  38.  
  39.     update_config( );
  40.  
  41.     if ( ( g_ctx.m_local->m_flNextAttack( ) > util::server_time( ) ) )
  42.         return;
  43.  
  44.     if ( local_weapon->is_non_aim( ) || local_weapon->m_iClip1( ) < 1 )
  45.         return;
  46.  
  47.     if ( local_weapon->m_iItemDefinitionIndex( ) == WEAPON_REVOLVER ) {
  48.         if ( config.autoshoot )
  49.             g_ctx.get_command( )->m_buttons |= IN_ATTACK;
  50.  
  51.         float flPostponeFireReady = local_weapon->m_flPostponeFireReadyTime( );
  52.         if ( flPostponeFireReady && flPostponeFireReady < g_csgo.m_globals( )->m_curtime + g_csgo.m_globals( )->m_interval_per_tick * g_csgo.m_clientstate( )->m_nChokedCommands && g_cfg.ragebot.autoshoot ) {
  53.             g_ctx.get_command( )->m_buttons &= ~IN_ATTACK;
  54.  
  55.             return;
  56.         }
  57.     }
  58.  
  59.     if ( !local_weapon->can_fire( ) )
  60.         return;
  61.  
  62.     iterate_players( );
  63.     aim(m_pcmd);
  64. }
  65.  
  66. void aimbot::iterate_players( ) {
  67.     target_data.reset( );
  68.  
  69.     static weapon_t * old_weapon;
  70.     if ( local_weapon != old_weapon ) {
  71.         old_weapon = local_weapon;
  72.  
  73.         g_ctx.get_command( )->m_buttons &= ~IN_ATTACK;
  74.  
  75.         return;
  76.     }
  77.  
  78.     for ( int i = 1; i <= g_csgo.m_globals( )->m_maxclients; i++ ) {
  79.         auto e = static_cast< player_t * >( g_csgo.m_entitylist( )->GetClientEntity( i ) );
  80.  
  81.         if ( !e->valid( true ) )
  82.             continue;
  83.  
  84.         matrix3x4_t bones[ 128 ];
  85.         if ( !e->SetupBones( bones, 128, 0x100, 0.f ) )
  86.             continue;
  87.  
  88.         float simulation_time = e->m_flSimulationTime( );
  89.  
  90.         vec3_t location = best_point( e, bones );
  91.     //  bool backtrack = false;
  92.     //  tickrecord_t lag_record;
  93.  
  94.     /*  if ( location == vec3_t( 0, 0, 0 ) && g_cfg.ragebot.lagcomp ) {
  95.             auto & player = lagcompensation::get( ).players[ i ];
  96.  
  97.             if ( player.m_e && !player.get_valid_track( ).empty( ) ) {
  98.                 bt_point_return_t return_info = best_point_backtrack( e, player );
  99.  
  100.                 location = return_info.point;
  101.                 lag_record = return_info.record;
  102.                 simulation_time = lag_record.m_simulation_time;
  103.  
  104.                 backtrack = true;
  105.             }
  106.         }*/
  107.  
  108.         if ( location == vec3_t( 0, 0, 0 ) )
  109.             continue;
  110.  
  111.         float fov = math::get_fov( engine_angles, math::calculate_angle( g_ctx.m_local->get_eye_pos( ), location ) );
  112.         if ( fov > g_cfg.ragebot.field_of_view )
  113.             continue;
  114.  
  115.         get_target( e, fov, location, simulation_time );
  116.     }
  117. }
  118.  
  119. void aimbot::zeus_run( )
  120. {
  121.     Vector aim_pos;
  122.     auto e = static_cast< player_t * >( g_csgo.m_entitylist( )->GetClientEntity( target_data.tid ) );
  123.     if ( !g_ctx.m_local->m_hActiveWeapon( )->m_iItemDefinitionIndex( ) == ( short ) ItemDefinitionIndex::WEAPON_TASER )
  124.         return;;
  125.  
  126.     Vector point = e->hitbox_position( 2 );
  127.     if ( util::visible( g_ctx.m_local->get_eye_pos( ), point, e, g_ctx.m_local ) ) {
  128.         if ( ( g_ctx.m_local->m_vecOrigin( ) - e->m_vecOrigin( ) ).Length( ) <= 1 ) {
  129.             aim_pos = math::calculate_angle( g_ctx.m_local->get_eye_pos( ), point );
  130.             aim_pos.Clamp( );
  131.             g_ctx.get_command( )->m_buttons |= IN_ATTACK;
  132.         }
  133.     }
  134.     if ( g_ctx.get_command( )->m_buttons & IN_ATTACK )
  135.         g_ctx.get_command( )->m_viewangles = aim_pos;
  136. }
  137.  
  138. bool aimbot::can_zeus( Vector &bestpoint )
  139. {
  140.     auto e = static_cast< player_t * >( g_csgo.m_entitylist( )->GetClientEntity( target_data.tid ) );
  141.     Vector forward;
  142.     math::angle_vectors( bestpoint, forward );
  143.     forward *= 183;
  144.  
  145.     Vector eye_pos = g_ctx.m_local->get_eye_pos( );
  146.  
  147.     Ray_t ray;
  148.     trace_t trace;
  149.     ray.Init( eye_pos, eye_pos + forward );
  150.  
  151.     CTraceFilter filter;
  152.     filter.pSkip = g_ctx.m_local;
  153.  
  154.     g_csgo.m_trace( )->TraceRay( ray, MASK_SHOT, &filter, &trace );
  155.  
  156.     return trace.hit_entity == e;
  157. }
  158.  
  159. void aimbot::aim(CUserCmd * m_pcmd) {
  160.     if ( target_data.tid == -1 )
  161.         return;
  162.  
  163.     auto e = static_cast< player_t * >( g_csgo.m_entitylist( )->GetClientEntity( target_data.tid ) );
  164.  
  165.     if ( e->m_bGunGameImmunity( ) )
  166.         return;
  167.  
  168.     vec3_t next_angle = math::calculate_angle( g_ctx.m_local->get_eye_pos( ), target_data.aimspot );
  169.  
  170.     bool hitchanced = false;
  171.  
  172.     if ( config.hitchance )
  173.         hitchanced = hitchance( next_angle, e, config.hitchance_amount );
  174.     else
  175.         hitchanced = true;
  176.  
  177.     if ( hitchanced ) {
  178.         if ( g_cfg.ragebot.zeus_bot ) {
  179.             if ( can_zeus( next_angle ) )
  180.                 zeus_run( );
  181.             else
  182.                 g_ctx.get_command( )->m_viewangles = next_angle;
  183.         }
  184.         else {
  185.             g_ctx.get_command( )->m_viewangles = next_angle;
  186.         }
  187.  
  188.         g_ctx.get_command( )->m_viewangles = next_angle;
  189.  
  190.         if ( g_cfg.ragebot.anti_recoil )
  191.             g_ctx.get_command( )->m_viewangles -= g_ctx.m_local->m_aimPunchAngle( ) * recoil_scale;
  192.  
  193.         if ( !g_cfg.ragebot.silent_aim )
  194.             g_csgo.m_engine( )->SetViewAngles( next_angle );
  195.  
  196.         if ( config.autoshoot ) {
  197.             g_ctx.get_command( )->m_buttons |= IN_ATTACK;
  198.  
  199.             if ( g_cfg.misc.anti_untrusted )
  200.                 g_ctx.send_packet = false;
  201.         }
  202.  
  203.         if ( g_ctx.get_command( )->m_buttons & IN_ATTACK )
  204.             g_ctx.get_command( )->m_tickcount = TIME_TO_TICKS( target_data.simtime + util::lerp_time( ) );
  205.  
  206.         g_ctx.m_globals.aimbotting = true;
  207.     }
  208.  
  209.     if ( hitchanced && config.quickstop && g_ctx.m_local->m_fFlags( ) & FL_ONGROUND )
  210.         quickstop( );
  211.  
  212.     if (g_cfg.ragebot.autostopye && local_weapon->m_iItemDefinitionIndex() != WEAPON_TASER)
  213.         ClampMovement(m_pcmd, 1);
  214.  
  215.     if (config.autoscope && local_weapon->m_zoomLevel() == 0) {
  216.         if (g_ctx.get_command()->m_buttons & IN_ATTACK)
  217.             g_ctx.get_command()->m_buttons &= ~IN_ATTACK;
  218.  
  219.         g_ctx.get_command()->m_buttons |= IN_ATTACK2;
  220.     }
  221.  
  222. }
  223.  
  224. vec3_t aimbot::best_point( player_t * e, matrix3x4_t bones[ 128 ] ) {
  225.     vec3_t output = vec3_t( 0, 0, 0 );
  226.  
  227.     std::vector< int >
  228.         hitboxes = hitboxes_from_vector( e, e->m_fFlags( ), e->m_vecVelocity( ), config.hitscan ),
  229.         multipoints = hitboxes_from_vector( e, e->m_fFlags( ), e->m_vecVelocity( ), config.multipoint );
  230.  
  231.     float best_damage = 0.f;
  232.  
  233.     for ( auto current : hitboxes ) {
  234.         vec3_t location = e->hitbox_position( current, bones );
  235.  
  236.         if ( config.autowall ) {
  237.             float damage = autowall::get( ).calculate_return_info( g_ctx.m_local->get_eye_pos( ), location, g_ctx.m_local, e ).m_damage;
  238.  
  239.             if ( ( damage > best_damage ) && ( damage > config.minimum_damage ) ) {
  240.                 best_damage = damage;
  241.                 output = location;
  242.             }
  243.         }
  244.         else if ( !config.autowall && g_ctx.m_local->point_visible( location ) )
  245.             return output;
  246.     }
  247.  
  248.     for ( auto current : multipoints ) {
  249.         std::vector< vec3_t > points;  getpoints( e, current, bones, points );
  250.  
  251.         for ( auto point : points ) {
  252.             if ( config.autowall ) {
  253.                 float damage = autowall::get( ).calculate_return_info( g_ctx.m_local->get_eye_pos( ), point, g_ctx.m_local, e ).m_damage;
  254.  
  255.                 if ( ( damage > best_damage ) && ( damage > config.minimum_damage ) ) {
  256.                     best_damage = damage;
  257.                     output = point;
  258.                 }
  259.             }
  260.             else if ( !config.autowall && g_ctx.m_local->point_visible( point ) )
  261.                 return point;
  262.         }
  263.     }
  264.  
  265.     return output;
  266. }
  267.  
  268. /*aimbot::bt_point_return_t aimbot::best_point_backtrack( player_t * e, player_record_t & player ) {
  269.     auto hitgroup_from_hitbox = [ ] ( int hitbox ) -> int {
  270.         switch ( hitbox ) {
  271.         case HITBOX_HEAD:
  272.         case HITBOX_NECK:
  273.             return HITGROUP_HEAD;
  274.             break;
  275.         case HITBOX_PELVIS:
  276.         case HITBOX_STOMACH:
  277.             return HITGROUP_STOMACH;
  278.             break;
  279.         case HITBOX_LOWER_CHEST:
  280.         case HITBOX_CHEST:
  281.         case HITBOX_UPPER_CHEST:
  282.             return HITGROUP_CHEST;
  283.             break;
  284.         case HITBOX_RIGHT_THIGH:
  285.         case HITBOX_RIGHT_CALF:
  286.         case HITBOX_RIGHT_FOOT:
  287.             return HITGROUP_RIGHTLEG;
  288.             break;
  289.         case HITBOX_LEFT_THIGH:
  290.         case HITBOX_LEFT_CALF:
  291.         case HITBOX_LEFT_FOOT:
  292.             return HITGROUP_LEFTLEG;
  293.             break;
  294.         case HITBOX_RIGHT_HAND:
  295.         case HITBOX_RIGHT_UPPER_ARM:
  296.         case HITBOX_RIGHT_FOREARM:
  297.             return HITGROUP_RIGHTARM;
  298.             break;
  299.         case HITBOX_LEFT_UPPER_ARM:
  300.         case HITBOX_LEFT_FOREARM:
  301.         case HITBOX_LEFT_HAND:
  302.             return HITGROUP_LEFTARM;
  303.             break;
  304.         }
  305.     };
  306.  
  307.     std::deque< tickrecord_t > track = player.get_valid_track( );
  308.  
  309.     tickrecord_t best_record;
  310.     float best_damage = 1;
  311.     vec3_t best_position;
  312.    
  313.     for ( int i = 0; i < track.size( ); i++ ) {
  314.         tickrecord_t record = track[ i ];
  315.  
  316.         std::vector< int > hitboxes = hitboxes_from_vector( e, record.m_flags, record.m_velocity, config.hitscan_history );
  317.  
  318.         for ( auto hitbox : hitboxes ) {
  319.             vec3_t location = e->hitbox_position( hitbox, record.m_bone_matrix );
  320.  
  321.             if ( config.autowall ) {
  322.                 float damage = autowall::get( ).calculate_return_info( g_ctx.m_local->get_eye_pos( ), location, g_ctx.m_local, e, hitgroup_from_hitbox( hitbox ) ).m_damage;
  323.  
  324.                 if ( damage > best_damage ) {
  325.                     best_position = location;
  326.                     best_damage = damage;
  327.                     best_record = record;
  328.                 }
  329.             } else if ( !config.autowall && g_ctx.m_local->point_visible( location ) ) {
  330.                 float damage = 50; autowall::get( ).scale_damage( e, local_weapon->get_csweapon_info( ), hitgroup_from_hitbox( hitbox ), damage );
  331.  
  332.                 if ( damage > best_damage ) {
  333.                     best_position = location;
  334.                     best_damage = damage;
  335.                     best_record = record;
  336.                 }
  337.             }
  338.         }
  339.     }
  340.  
  341.     return bt_point_return_t{ best_record, best_position };
  342. }*/
  343.  
  344. void aimbot::getpoints( player_t * e, int hitbox_id, matrix3x4_t bones[ 128 ], std::vector< vec3_t > & points ) {
  345.     studiohdr_t * studio_model = g_csgo.m_modelinfo( )->GetStudiomodel( e->GetModel( ) );
  346.     mstudiohitboxset_t * set = studio_model->pHitboxSet( e->m_nHitboxSet( ) );
  347.  
  348.     mstudiobbox_t * hitbox = set->pHitbox( hitbox_id );
  349.     if ( !hitbox )
  350.         return;
  351.  
  352.     vec3_t min, max;
  353.     math::vector_transform( hitbox->bbmin, bones[ hitbox->bone ], min );
  354.     math::vector_transform( hitbox->bbmax, bones[ hitbox->bone ], max );
  355.  
  356.     vec3_t
  357.         center = ( min + max ) * 0.5f,
  358.         angle = math::calculate_angle( center, g_ctx.m_local->get_eye_pos( ) );
  359.  
  360.     vec3_t forward;
  361.     math::angle_vectors( angle, forward );
  362.  
  363.     vec3_t
  364.         right = forward.Cross( vec3_t( 0, 0, 1 ) ),
  365.         left = vec3_t( -right.x, -right.y, right.z ),
  366.         top = vec3_t( 0, 0, 1 ),
  367.         bot = vec3_t( 0, 0, -1 );
  368.  
  369.     if ( hitbox_id == HITBOX_HEAD ) {
  370.         points.push_back( center + ( top * ( hitbox->m_flRadius * config.pointscale ) ) );
  371.         points.push_back( center + ( right * ( hitbox->m_flRadius * config.pointscale ) ) );
  372.         points.push_back( center + ( left * ( hitbox->m_flRadius * config.pointscale ) ) );
  373.     } else {
  374.         points.push_back( center + ( right * ( hitbox->m_flRadius * config.pointscale ) ) );
  375.         points.push_back( center + ( left * ( hitbox->m_flRadius * config.pointscale ) ) );
  376.     }
  377. }
  378.  
  379. void aimbot::quickstop( ) {
  380.     g_ctx.get_command()->m_sidemove = 0;
  381.     g_ctx.get_command()->m_forwardmove = g_ctx.m_local->m_vecVelocity().Length2D() > 20.f ? 450.f : 0.f;
  382.  
  383.     math::rotate_movement(math::calculate_angle(vec3_t(0, 0, 0), g_ctx.m_local->m_vecVelocity()).y + 180.f);
  384. }
  385.  
  386. bool aimbot::hitchance( vec3_t angles, player_t * e, float chance ) {
  387.     angles -= g_ctx.m_local->m_aimPunchAngle( ) * recoil_scale;
  388.  
  389.     vec3_t
  390.         forward,
  391.         right,
  392.         up,
  393.         src = g_ctx.m_local->get_eye_pos( );
  394.  
  395.     math::angle_vectors( angles, &forward, &right, &up );
  396.  
  397.     int
  398.         hits = 0,
  399.         needed_hits = static_cast<int>( 256.f * ( chance / 100.f ) );
  400.  
  401.     float
  402.         weap_spread = local_weapon->get_spread( ),
  403.         weap_inaccuracy = local_weapon->get_innacuracy( );
  404.  
  405.     for ( int i = 0; i < 256; i++ ) {
  406.         float
  407.             a = math::random_float( 0.f, 1.f ),
  408.             b = math::random_float( 0.f, 2.f * DirectX::XM_PI ),
  409.             c = math::random_float( 0.f, 1.f ),
  410.             d = math::random_float( 0.f, 2.f * DirectX::XM_PI ),
  411.             inaccuracy = a * weap_inaccuracy,
  412.             spread = c * weap_spread;
  413.  
  414.         if ( local_weapon->m_iItemDefinitionIndex( ) == WEAPON_REVOLVER ) {
  415.             if ( g_ctx.get_command( )->m_buttons & IN_ATTACK2 ) {
  416.                 a = 1.f - a * a;
  417.                 c = 1.f - c * c;
  418.             }
  419.         }
  420.  
  421.         vec3_t
  422.             spread_view( ( cos( b ) * inaccuracy ) + ( cos( d ) * spread ), ( sin( b ) * inaccuracy ) + ( sin( d ) * spread ), 0 ),
  423.             direction;
  424.  
  425.         direction.x = forward.x + ( spread_view.x * right.x ) + ( spread_view.y * up.x );
  426.         direction.y = forward.y + ( spread_view.x * right.y ) + ( spread_view.y * up.y );
  427.         direction.z = forward.z + ( spread_view.x * right.z ) + ( spread_view.y * up.z );
  428.         direction.Normalized( );
  429.  
  430.         vec3_t
  431.             viewangles_spread,
  432.             view_forward;
  433.  
  434.         math::vector_angles( direction, up, viewangles_spread );
  435.         math::normalize_angles( viewangles_spread );
  436.  
  437.         math::angle_vectors( viewangles_spread, view_forward );
  438.         view_forward.NormalizeInPlace( );
  439.  
  440.         view_forward = src + ( view_forward * local_weapon->get_csweapon_info( )->range );
  441.  
  442.         trace_t tr;
  443.         Ray_t ray;
  444.  
  445.         ray.Init( src, view_forward );
  446.         g_csgo.m_trace( )->ClipRayToEntity( ray, MASK_SHOT | CONTENTS_GRATE, e, &tr );
  447.  
  448.         if ( tr.hit_entity == e )
  449.             hits++;
  450.  
  451.         if ( static_cast<int>( ( static_cast<float>( hits ) / 256.f ) * 100.f ) >= chance )
  452.             return true;
  453.  
  454.         if ( ( 256 - i + hits ) < needed_hits )
  455.             return false;
  456.     }
  457.  
  458.     return false;
  459. }
  460.  
  461. void aimbot::get_target( player_t * e, float fov, vec3_t location, float simulation_time) {
  462.     switch ( g_cfg.ragebot.selection_type ) {
  463.     case 0:
  464.         if ( target_data.best_distance < fov )
  465.             return;
  466.  
  467.         target_data.best_distance = fov;
  468.         target_data.tid = e->EntIndex( );
  469.         target_data.aimspot = location;
  470.         target_data.simtime = simulation_time;
  471.     //  target_data.backtrack = backtrack;
  472.     //  target_data.best_record = lag_record;
  473.  
  474.         break;
  475.     case 1:
  476.         if ( target_data.best_distance < e->m_iHealth( ) )
  477.             return;
  478.  
  479.         target_data.best_distance = e->m_iHealth( );
  480.         target_data.tid = e->EntIndex( );
  481.         target_data.aimspot = location;
  482.         target_data.simtime = simulation_time;
  483.     //  target_data.backtrack = backtrack;
  484.     //  target_data.best_record = lag_record;
  485.  
  486.         break;
  487.     case 2:
  488.         float distance = sqrt(
  489.             pow( double( location.x - g_ctx.m_local->m_vecOrigin( ).x ), 2 ) +
  490.             pow( double( location.y - g_ctx.m_local->m_vecOrigin( ).y ), 2 ) +
  491.             pow( double( location.z - g_ctx.m_local->m_vecOrigin( ).z ), 2 ) );
  492.  
  493.         if ( target_data.best_distance < distance )
  494.             return;
  495.  
  496.         target_data.best_distance = distance;
  497.         target_data.tid = e->EntIndex( );
  498.         target_data.aimspot = location;
  499.         target_data.simtime = simulation_time;
  500.     //  target_data.backtrack = backtrack;
  501.     //  target_data.best_record = lag_record;
  502. //
  503.         break;
  504.     }
  505. }
  506.  
  507.  
  508.     bool aimbot::head_check(player_t * e, int m_fFlags, vec3_t m_vecVelocity) {
  509.         bool use = true;
  510.  
  511.         if (config.baim[BAIM_INAIR].enabled && !(m_fFlags & FL_ONGROUND))
  512.             use = false;
  513.  
  514.         if (config.baim[BAIM_STAND].enabled && e->m_vecVelocity().Length() < 1)
  515.             use = false;
  516.  
  517.         if (e->m_iHealth() < g_cfg.ragebot.hp_lower)
  518.             use = false;
  519.  
  520.         if (g_csgo.m_inputsys()->IsButtonDown(g_cfg.ragebot.baim_key))
  521.             use = false;
  522.  
  523.         if (g_ctx.m_local->m_hActiveWeapon()->m_iItemDefinitionIndex() == (short)ItemDefinitionIndex::WEAPON_TASER)
  524.             use = false;
  525.  
  526.         return use;
  527.     }
  528. std::vector< int > aimbot::hitboxes_from_vector( player_t * e, int m_fFlags, vec3_t m_vecVelocity, std::vector< MultiDropdownItem_t > arr ) {
  529.     std::vector< int > hitboxes;
  530.     bool head_valid = head_check( e, m_fFlags, m_vecVelocity );
  531.  
  532.     if ( arr[ 0 ].enabled && head_valid ) {
  533.         hitboxes.push_back( HITBOX_HEAD ); 
  534.     }
  535.    
  536.  
  537.     if (arr[1].enabled) {
  538.         hitboxes.push_back(HITBOX_NECK);
  539.     }
  540.  
  541.     if (arr[2].enabled) {
  542.         hitboxes.push_back(HITBOX_UPPER_CHEST);
  543.         hitboxes.push_back(HITBOX_CHEST);
  544.     }
  545.  
  546.     if (arr[3].enabled) {
  547.         hitboxes.push_back(HITBOX_PELVIS);;
  548.     }
  549.     if (arr[4].enabled) {
  550.        
  551.         hitboxes.push_back(HITBOX_STOMACH);
  552.     }
  553.  
  554.  
  555.     if ( arr[ 5 ].enabled ) {
  556.         hitboxes.push_back( HITBOX_RIGHT_UPPER_ARM );
  557.         hitboxes.push_back( HITBOX_LEFT_UPPER_ARM );
  558.  
  559.         hitboxes.push_back( HITBOX_RIGHT_FOREARM );
  560.         hitboxes.push_back( HITBOX_LEFT_FOREARM );
  561.  
  562.         hitboxes.push_back( HITBOX_RIGHT_HAND );
  563.         hitboxes.push_back( HITBOX_LEFT_HAND );
  564.     }
  565.  
  566.     if ( arr[ 6 ].enabled ) {
  567.         hitboxes.push_back( HITBOX_RIGHT_THIGH );
  568.         hitboxes.push_back( HITBOX_LEFT_THIGH );
  569.  
  570.         hitboxes.push_back( HITBOX_RIGHT_CALF );
  571.         hitboxes.push_back( HITBOX_LEFT_CALF );
  572.     }
  573.  
  574.     return hitboxes;
  575. }
  576.  
  577. void aimbot::update_config( ) {
  578.     auto id = local_weapon->m_iItemDefinitionIndex( );
  579.  
  580.     int element = -1;
  581.  
  582.     if ( local_weapon->is_pistol( ) && id != WEAPON_DEAGLE )
  583.         element = 0;
  584.  
  585.     if ( local_weapon->m_iItemDefinitionIndex( ) == WEAPON_DEAGLE )
  586.         element = 1;
  587.  
  588.     if ( local_weapon->is_smg( ) )
  589.         element = 3;
  590.  
  591.     if ( id == WEAPON_SSG08 )
  592.         element = 4;
  593.  
  594.     if ( id == WEAPON_SCAR20 || id == WEAPON_G3SG1 )
  595.         element = 5;
  596.  
  597.     if (id == WEAPON_AWP)
  598.         element = 6;
  599.     if ( element == -1 )
  600.         element = 2;
  601.  
  602.     config.autoshoot = g_cfg.ragebot.autoshoot[ element ];
  603.     config.autowall = g_cfg.ragebot.autowall[ element ];
  604.     config.minimum_damage = g_cfg.ragebot.minimum_damage[ element ];
  605.     config.hitscan = g_cfg.ragebot.hitscan[ element ];
  606. //  config.hitscan_history = g_cfg.ragebot.hitscan_history[ element ];
  607.     config.multipoint = g_cfg.ragebot.multipoint_hitboxes[ element ]; // fps issue
  608.     config.pointscale = g_cfg.ragebot.pointscale[ element ];
  609.     config.hitchance = g_cfg.ragebot.hitchance[ element ];
  610.     config.hitchance_amount = g_cfg.ragebot.hitchance_amount[ element ];
  611.     config.baim = g_cfg.ragebot.baim_settings[ element ];
  612.     config.quickstop = g_cfg.ragebot.quickstop[ element ];
  613.  
  614.     config.autoscope = false;
  615.  
  616.     if ( element == 4 || element == 5 || element == 6) {
  617.         config.autoscope = g_cfg.ragebot.autoscope[ element - 3 ];
  618.     } else if ( element == 2 && ( id == WEAPON_AUG || id == WEAPON_SG553 ) ) {
  619.         config.autoscope = g_cfg.ragebot.autoscope[ 0 ];
  620.     }
  621. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top