Advertisement
Guest User

Untitled

a guest
Jun 28th, 2015
1,373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. void cAimbot::ExtraPolation( cEntity *pLocal, cEntity *pEntity, static Vector m_vecPosition, Vector &vEyePos, int Index )
  2. {
  3. Vector vOld[ 65 ];
  4. Vector vOldMe;
  5. Vector vAccel[ 65 ];
  6. Vector vMyAccel;
  7. Vector vecEnemyVelocity = pEntity->GetVelocity( );
  8. Vector vMyVel = pLocal->GetVelocity( );
  9. Vector vDelta = vecEnemyVelocity - vOld[ Index ];
  10.  
  11. vOld[ Index ] = vecEnemyVelocity;
  12. if( vDelta != Vector( 0.0f, 0.0f, 0.0f ) )
  13. {
  14. vAccel[ Index ] = vDelta;
  15. }
  16.  
  17. Vector vDeltaMe = vMyVel - vOldMe;
  18. vOldMe = vMyVel;
  19.  
  20. if( vDeltaMe != Vector( 0.0f, 0.0f, 0.0f ) )
  21. {
  22. vMyAccel = vDeltaMe;
  23. }
  24.  
  25. float flTick = pGlobals->interval_per_tick;
  26. int iFakeLagCmd = sPlayerList[ Index ].flLostTick;
  27.  
  28. if( iFakeLagCmd > 5.0f )
  29. {
  30. flTick += pGlobals->interval_per_tick * sPlayerList[ Index ].flLostTick;
  31.  
  32. if( vAccel[ Index ] != Vector( 0.0f, 0.0f, 0.0f ) || vMyAccel != Vector( 0.0f, 0.0f, 0.0f ) )
  33. {
  34. Vector vDivide;
  35. VectorDivide( ( vAccel[ Index ] - vMyAccel ) * sqrt( flTick ) + ( vecEnemyVelocity - vMyVel ) * flTick + m_vecPosition - vEyePos , 0.5f, vDivide );
  36. m_vecPosition -= vDivide;
  37. g_pCvar->FindVar( "cl_interpolate" )->SetValue( "0.695" );
  38. g_pCvar->FindVar( "cl_updaterate" )->SetValue( "1048576" );
  39. g_pCvar->FindVar( "cl_cmdrate" )->SetValue( "1048576" );
  40. }
  41. }
  42.  
  43. if( iFakeLagCmd <= 5.0f && iFakeLagCmd > 1.0f )
  44. {
  45. flTick += pGlobals->interval_per_tick * sPlayerList[ Index ].flLostTick;
  46.  
  47. if( vAccel[ Index ] != Vector( 0.0f, 0.0f, 0.0f ) || vMyAccel != Vector( 0.0f, 0.0f, 0.0f ) )
  48. {
  49. Vector vDivide;
  50. VectorDivide( ( vAccel[ Index ] - vMyAccel ) * sqrt( flTick ) + ( vecEnemyVelocity - vMyVel ) * flTick + m_vecPosition - vEyePos , 0.5f, vDivide );
  51. m_vecPosition -= vDivide;
  52. g_pCvar->FindVar( "cl_interpolate" )->SetValue( "0.7" );
  53. g_pCvar->FindVar( "cl_updaterate" )->SetValue( "66" );
  54. g_pCvar->FindVar( "cl_cmdrate" )->SetValue( "66" );
  55. }
  56. }
  57.  
  58. if( iFakeLagCmd == 1.0f )
  59. {
  60. if( vAccel[ Index ] != Vector( 0.0f, 0.0f, 0.0f ) || vMyAccel != Vector( 0.0f, 0.0f, 0.0f ) )
  61. {
  62. Vector vDivide;
  63. VectorDivide( ( vAccel[ Index ] - vMyAccel ) * sqrt( flTick ) + ( vecEnemyVelocity - vMyVel ) * flTick + m_vecPosition - vEyePos , 0.5f, vDivide );
  64. m_vecPosition += vDivide;
  65. g_pCvar->FindVar( "cl_updaterate" )->SetValue( "67" );
  66. g_pCvar->FindVar( "cl_cmdrate" )->SetValue( "67" );
  67. g_pCvar->FindVar( "cl_interpolate" )->SetValue( "1" );
  68. }
  69. }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement