daily pastebin goal
78%
SHARE
TWEET

Untitled

a guest Jan 20th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "manual_aa.h"
  2.  
  3. void manual_aa::update( ) {
  4.     static bool
  5.         holding_left = false,
  6.         holding_right = false,
  7.         holding_back = false;
  8.  
  9.     if ( g_csgo.m_inputsys( )->IsButtonDown( g_cfg.antiaim.left_manualkey ) && !holding_left ) {
  10.         if ( side == SIDE_LEFT ) {
  11.             side = SIDE_NONE;
  12.         } else {
  13.             side = SIDE_LEFT;
  14.         }
  15.  
  16.         holding_left = true;
  17.     } else if ( holding_left && !g_csgo.m_inputsys( )->IsButtonDown( g_cfg.antiaim.left_manualkey ) ) {
  18.         holding_left = false;
  19.     }
  20.  
  21.     if ( g_csgo.m_inputsys( )->IsButtonDown( g_cfg.antiaim.right_manualkey ) && !holding_right ) {
  22.         if ( side == SIDE_RIGHT ) {
  23.             side = SIDE_NONE;
  24.         } else {
  25.             side = SIDE_RIGHT;
  26.         }
  27.  
  28.         holding_right = true;
  29.     } else if ( holding_right && !g_csgo.m_inputsys( )->IsButtonDown( g_cfg.antiaim.right_manualkey ) ) {
  30.         holding_right = false;
  31.     }
  32.  
  33.     if ( g_csgo.m_inputsys( )->IsButtonDown( g_cfg.antiaim.back_manualkey ) && !holding_back ) {
  34.         if ( side == SIDE_BACK ) {
  35.             side = SIDE_NONE;
  36.         } else {
  37.             side = SIDE_BACK;
  38.         }
  39.  
  40.         holding_back = true;
  41.     } else if ( holding_back && !g_csgo.m_inputsys( )->IsButtonDown( g_cfg.antiaim.back_manualkey ) ) {
  42.         holding_back = false;
  43.     }
  44. }
  45.  
  46. bool manual_aa::run( ) {
  47.     vec3_t engine_angles; g_csgo.m_engine( )->GetViewAngles( engine_angles );
  48.     float yaw = engine_angles.y;
  49.  
  50.     switch ( side ) {
  51.     case SIDE_LEFT:
  52.         if ( g_ctx.send_packet ) {
  53.             g_ctx.get_command( )->m_viewangles.y = yaw - ( 90.0f + ( math::random_float( 0.f, 30.f ) - 15.f ) );
  54.         } else {
  55.             g_ctx.get_command( )->m_viewangles.y = yaw + 90.0f;
  56.         }
  57.  
  58.         break;
  59.     case SIDE_RIGHT:
  60.         if ( g_ctx.send_packet ) {
  61.             g_ctx.get_command( )->m_viewangles.y = yaw + ( 90.0f + ( math::random_float( 0.f, 30.f ) - 15.f ) );
  62.         } else {
  63.             g_ctx.get_command( )->m_viewangles.y = yaw - 90.0f;
  64.         }
  65.  
  66.         break;
  67.     case SIDE_BACK:
  68.         if ( g_ctx.send_packet ) {
  69.             static bool side[ 2 ] = { false, true };
  70.  
  71.             float range = side[ 1 ] ? 100 : 80;
  72.  
  73.             g_ctx.get_command( )->m_viewangles.y = yaw + ( side[ 0 ] ? range : -range );
  74.  
  75.             side[ 1 ] = !side[ 1 ];
  76.  
  77.             if ( side[ 1 ] ) {
  78.                 side[ 0 ] = !side[ 0 ];
  79.             }
  80.         } else {
  81.             g_ctx.get_command( )->m_viewangles.y = yaw + 180.0f;
  82.         }
  83.  
  84.         break;
  85.     }
  86.  
  87.     return side != SIDE_NONE;
  88. }
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