Advertisement
iPatientZero

KardofflHook | Client.cpp

Sep 5th, 2015
1,637
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 16.00 KB | None | 0 0
  1. #include "Includes.h"
  2. #include "sdk.h"
  3.  
  4. #define MakePtr( Type, dwBase, dwOffset ) ( ( Type )( DWORD( dwBase ) + (DWORD)( dwOffset ) ) )
  5. #define M_RADPI 57.295779513082f
  6. #define square( x ) ( x * x )
  7. ScreenSize_t sScreenSize2;
  8. bool bResChange = false;
  9. int iTarget = -1;
  10. float flDistance = 9999.0f;
  11. QAngle qAngle;
  12.  
  13. float GetFov(QAngle angle, Vector src, Vector dst)
  14. {
  15.     QAngle ang, aim;
  16.     float fov;
  17.  
  18.     Vector tmp = dst - src;
  19.     VectorAngles(tmp, ang);
  20.     QAngle vTempAngles = ang - angle;
  21.     NormalizeAngles(vTempAngles);
  22.  
  23.     return vTempAngles.Length();
  24. }
  25.  
  26. bool GetVisible(Vector& vAbsStart, Vector& vAbsEnd, IClientEntity* pEntity)
  27. {
  28.     trace_t tr;
  29.     Ray_t ray;
  30.     CTraceFilterNoPlayers filter;
  31.     filter.pSkip = Ikaros.m_pEntity->Ent();
  32.  
  33.     ray.Init(vAbsStart, vAbsEnd);
  34.     Ikaros.m_pEnginetrace->TraceRay(ray, 0x4600400B, &filter, &tr);
  35.  
  36.     return (tr.m_pEnt == pEntity || tr.fraction > 0.99f);
  37. }
  38.  
  39. bool GetHitboxPosition(IClientEntity* ClientEntity, int iHitBox, Vector* vOut)
  40. {
  41.     matrix3x4a_t pmatrix[128];
  42.  
  43.     Vector vMin, vMax;
  44.  
  45.     const model_t* model = ClientEntity->GetModel();
  46.  
  47.     if (!model)
  48.         return false;
  49.  
  50.     studiohdr_t *pStudioHdr = Ikaros.m_pModelinfo->GetStudiomodel(model);
  51.  
  52.     if (pStudioHdr == NULL)
  53.         return false;
  54.  
  55.     if (!ClientEntity->SetupBones(pmatrix, 128, 0x00000100, 0))
  56.         return false;
  57.  
  58.     mstudiohitboxset_t *set = pStudioHdr->pHitboxSet(Ikaros.m_pEntity->GetHitboxSet(ClientEntity));
  59.  
  60.     if (!set)
  61.         return false;
  62.  
  63.     mstudiobbox_t* pbox = set->pHitbox(iHitBox);
  64.  
  65.     // center and all the points of the hitbox
  66.     Vector points[9] = { ((pbox->bbmin + pbox->bbmax) * .5f), // center
  67.         Vector(pbox->bbmin.x, pbox->bbmin.y, pbox->bbmin.z), // left bottom back corner
  68.         Vector(pbox->bbmin.x, pbox->bbmax.y, pbox->bbmin.z), // left bottom front corner
  69.         Vector(pbox->bbmax.x, pbox->bbmax.y, pbox->bbmin.z), // left top front corner
  70.         Vector(pbox->bbmax.x, pbox->bbmin.y, pbox->bbmin.z), // left top back corner
  71.         Vector(pbox->bbmax.x, pbox->bbmax.y, pbox->bbmax.z), // right top front corner
  72.         Vector(pbox->bbmin.x, pbox->bbmax.y, pbox->bbmax.z), // right bottom front corner
  73.         Vector(pbox->bbmin.x, pbox->bbmin.y, pbox->bbmax.z), // right bottom back corner
  74.         Vector(pbox->bbmax.x, pbox->bbmin.y, pbox->bbmax.z)  // right top back corner
  75.     };
  76.  
  77.     for (int index = 0; index <= 8; ++index)
  78.     {
  79.         if (index != 0)
  80.         {
  81.             // scale down the hitbox size
  82.             points[index] = ((((points[index] + points[0]) * .5f) + points[index]) * .5f);
  83.         }
  84.  
  85.         // transform the vector
  86.         VectorTransform(points[index], pmatrix[pbox->bone], vOut[index]);
  87.     }
  88.  
  89.     return true;
  90. }
  91.  
  92. void SmoothAngles(QAngle &src, QAngle &back, QAngle &flLocalAngles, float smooth)
  93. {
  94.     float smoothdiff[2];
  95.     src[0] -= flLocalAngles.x;
  96.     src[1] -= flLocalAngles.y;
  97.     NormalizeAngles(src);
  98.     smoothdiff[0] = src[0] / smooth;
  99.     smoothdiff[1] = src[1] / smooth;
  100.     back[0] = flLocalAngles.x + smoothdiff[0];
  101.     back[1] = flLocalAngles.y + smoothdiff[1];
  102.     back[2] = 0;
  103.     NormalizeAngles(back);
  104. }
  105. C_BaseCombatWeapon* GetBaseCombatActiveWeapon()
  106. {
  107.     C_BaseEntity *pLocal = (C_BaseEntity*)entitylist->GetClientEntity(engine->GetLocalPlayer());
  108.  
  109.     ULONG pWeepEhandle = *(PULONG)((DWORD)pLocal + 0x12C0);
  110.     return (C_BaseCombatWeapon*)(entitylist->GetClientEntityFromHandle(pWeepEhandle));
  111. }
  112. void CalcAngles(Vector src, Vector dst, QAngle &ang)
  113. {
  114.     double delta[3] = { src[0] - dst[0], src[1] - dst[1], src[2] - dst[2] };
  115.     double hyp = sqrt(delta[0] * delta[0] + delta[1] * delta[1]);
  116.  
  117.     ang[0] = (float)(atan(delta[2] / hyp) * M_RADPI);
  118.     ang[1] = (float)(atan(delta[1] / delta[0]) * M_RADPI);
  119.     ang[2] = 0.0f;
  120.  
  121.     if (delta[0] >= 0.0) ang[1] += 180.0f;
  122. }
  123. void Aimbot(CUserCmd* cmd, C_BaseCombatWeapon* Weapon)
  124. {
  125.     iTarget = -1;
  126.     flDistance = 9999.0f;
  127.     qAngle.Init();
  128.     player_info_t playerInfo;
  129.     Vector aiming_Org[64];
  130.     Vector vecTarget, vecEntity[9], vecEyePos = Ikaros.m_pEntity->GetEyePos(Ikaros.m_pEntity->Ent()) + (Ikaros.m_pEntity->GetVelocity(Ikaros.m_pEntity->Ent()) * Ikaros.m_pGlobals->interval_per_tick);
  131.     QAngle qPunch = Ikaros.m_pEntity->GetPunchAngle(Ikaros.m_pEntity->Ent()) * 2;
  132.  
  133.     int WeaponID = GetBaseCombatActiveWeapon()->GetCSWpnData()->WeaponID;
  134.     int WeaponType = GetBaseCombatActiveWeapon()->GetCSWpnData()->WeaponType;
  135.  
  136.     for (int i = Ikaros.m_pEntlist->GetHighestEntityIndex(); i > 0; --i)
  137.     {
  138.         if (i == Ikaros.m_pEngine->GetLocalPlayer())
  139.             continue;
  140.  
  141.         IClientEntity* Entity = Ikaros.m_pEntlist->GetClientEntity(i);
  142.  
  143.         if (Entity == NULL
  144.             || Entity->IsDormant()
  145.             || !Ikaros.m_pEngine->GetPlayerInfo(i, &playerInfo)
  146.             || !Ikaros.m_pEntity->GetLifeState(Entity)
  147.             || Ikaros.m_pEntity->GetRenderColor(Entity).a < 255
  148.             || Ikaros.m_pEntity->GetTeamID(Ikaros.m_pEntity->Ent()) == Ikaros.m_pEntity->GetTeamID(Entity)
  149.             || !GetHitboxPosition(Entity, 11, vecEntity))
  150.             continue;
  151.  
  152.         if (!GetVisible(vecEyePos, vecEntity[0], Entity))
  153.             continue;
  154.  
  155.         float flFieldofView = GetFov(cmd->viewangles + qPunch, vecEyePos, vecEntity[0]);
  156.  
  157.         if (flFieldofView <= Ikaros.m_pConvars->flAimbotFOV && flFieldofView < flDistance)
  158.         {
  159.             flDistance = flFieldofView;
  160.             iTarget = i;
  161.             vecTarget = vecEntity[0];
  162.         }
  163.     }
  164.  
  165.     if (iTarget > -1)
  166.     {
  167.         QAngle qPreAim, qAim;
  168.         Vector tmp = vecTarget - vecEyePos;
  169.         VectorAngles(tmp, qPreAim);
  170.  
  171.         if (Ikaros.m_pConvars->flAimbotRCS && !Ikaros.m_pUtilities->IsPistol(Weapon) && !Ikaros.m_pUtilities->IsSniper(Weapon))
  172.             qPreAim -= qPunch;
  173.  
  174.         NormalizeAngles(qPreAim);
  175.  
  176.         SmoothAngles(qPreAim, qAim, cmd->viewangles, Ikaros.m_pConvars->flAimbotSmooth);
  177.  
  178.         if (Ikaros.m_pConvars->flAimbotStopCrouch == 1){
  179.             cmd->forwardmove = 0.f;
  180.             cmd->sidemove = 0.f;
  181.             cmd->buttons |= IN_DUCK;
  182.         }
  183.  
  184.         if (Ikaros.m_pConvars->flAimbotSilent == 0.0f)
  185.             Ikaros.m_pEngine->SetViewAngles(qAim);
  186.         else if (Ikaros.m_pConvars->flAimbotSilent == 1.0f)
  187.             cmd->viewangles = qAim;
  188.         else if (Ikaros.m_pConvars->flAimbotSilent == 2.0f)
  189.             qAngle = qAim;
  190.  
  191.         if (Ikaros.m_pConvars->flAimbotAutoshoot == 1.0f)
  192.             cmd->buttons |= IN_ATTACK;
  193.  
  194.     }
  195. }
  196.  
  197. void __stdcall CL_FixMove(CUserCmd* cmd, QAngle viewangles)
  198. {
  199.     Vector move, movenorm, dir, set;
  200.     QAngle movenormang, adjusted;
  201.  
  202.     float len;
  203.  
  204.     move.Init(cmd->forwardmove, cmd->sidemove, cmd->upmove);
  205.  
  206.     movenorm = move;
  207.  
  208.     VectorNormalize(movenorm);
  209.  
  210.     len = move.Length();
  211.  
  212.     VectorAngles(movenorm, movenormang);
  213.  
  214.     if ((cmd->viewangles.x >= 89.0f) || (cmd->viewangles.x <= -89.0f))
  215.     {
  216.         if (viewangles.x >= 0.0f && viewangles.x <= 89.0f)
  217.         {
  218.             viewangles.x = cmd->viewangles.x + 180.0f;
  219.         }
  220.         if (viewangles.x <= 0.0f && viewangles.x >= -89.0f)
  221.         {
  222.             viewangles.x = cmd->viewangles.x - 180.0f;
  223.         }
  224.     }
  225.  
  226.     adjusted = movenormang + (cmd->viewangles - viewangles);
  227.  
  228.     AngleVectors(adjusted, &dir);
  229.  
  230.     set = dir * len;
  231.  
  232.     if ((cmd->viewangles.x > 89.0f) || (cmd->viewangles.x < -89.0f))
  233.         cmd->forwardmove = set.x;
  234.     else if ((cmd->viewangles.x == 89.0f || cmd->viewangles.x == -89.0f))
  235.         cmd->forwardmove = -set.x;
  236.     else
  237.         cmd->forwardmove = set.x;
  238.  
  239.     if ((cmd->viewangles.x >= 89.0f) || (cmd->viewangles.x <= -89.0f))
  240.         cmd->sidemove = -set.y;
  241.     else
  242.         cmd->sidemove = set.y;
  243.  
  244.     if (cmd->sidemove < -450)
  245.         cmd->sidemove = -450;
  246.  
  247.     if (cmd->sidemove > 450)
  248.         cmd->sidemove = 450;
  249.  
  250.     if (cmd->forwardmove < -450)
  251.         cmd->forwardmove = -450;
  252.  
  253.     if (cmd->forwardmove > 450)
  254.         cmd->forwardmove = 450;
  255. }
  256.  
  257. void AntiAntiAimXProxy(const CRecvProxyData *pData, void *pStruct, void *pOut)
  258. {
  259.     float flPitch = pData->m_Value.m_Float;
  260.  
  261.     if (flPitch > 180.0)
  262.         flPitch -= 360.0;
  263.     else if (flPitch < -180.0)
  264.         flPitch += 360.0;
  265.  
  266.     //Fakedown autofix
  267.     if (flPitch < -179.648438f || flPitch > 179.648438f)
  268.     {
  269.         flPitch = -10.0f;
  270.     }
  271.  
  272.     if (flPitch <= -88.945313f && flPitch >= -179.648438f)
  273.     {
  274.         flPitch = -89.0f;
  275.     }
  276.  
  277.     if (flPitch >= 88.945313f && flPitch <= 179.648438f)
  278.     {
  279.         flPitch = 89.0f;
  280.     }
  281.  
  282.     *(float*)pOut = flPitch;
  283. }
  284.  
  285. void __stdcall new_PaintTraverse(vgui::VPANEL vguiPanel, bool forceRepaint, bool allowForce)
  286. {
  287.     Ikaros.m_pPanelVMT->Function<PaintTraverse_t>(41)(vguiPanel, forceRepaint, allowForce);
  288.  
  289.     const char* pszPanelName = Ikaros.m_pPanel->GetName(vguiPanel);
  290.     bool isValidPanel = false;
  291.  
  292.     if (pszPanelName && pszPanelName[0] == 'F' && pszPanelName[5] == 'O')
  293.         isValidPanel = true;
  294.  
  295.     if (isValidPanel)
  296.     {
  297.         Ikaros.m_pEngine->GetScreenSize(sScreenSize2.iWidth, sScreenSize2.iHeight);
  298.  
  299.         if (!bResChange && (sScreenSize2.iWidth != sScreenSize.iWidth || sScreenSize2.iHeight != sScreenSize.iHeight))
  300.         {
  301.             sScreenSize.iWidth = sScreenSize2.iWidth;
  302.             sScreenSize.iHeight = sScreenSize2.iHeight;
  303.             bResChange = true;
  304.         }
  305.  
  306.         if (bResChange)
  307.         {
  308.             Ikaros.m_pDraw->FontInit(Ikaros.m_pFont, "Tahoma", 13, FONTFLAG_OUTLINE);
  309.             bResChange = false;
  310.         }
  311.  
  312.         if (Ikaros.m_pConvars->flMiscAntiUntrust > 0)
  313.             Ikaros.m_pConvars->flRemovalsSpread = 0;
  314.  
  315.         if (Ikaros.m_pEngine->IsTakingScreenshot())
  316.             return;
  317.  
  318.         if (Ikaros.m_pEngine->IsInGame())
  319.         {
  320.             if (Ikaros.m_pConvars->flESPActive)
  321.                 Ikaros.m_pESP->DrawESP();
  322.  
  323.             if (Ikaros.m_pConvars->flMiscCrosshair)
  324.             {
  325.                 Ikaros.m_pDraw->FillRGBA((sScreenSize.iWidth / 2) - 5, (sScreenSize.iHeight / 2) - 1, 11, 3, 0, 0, 0, 255);
  326.                 Ikaros.m_pDraw->FillRGBA((sScreenSize.iWidth / 2) - 1, (sScreenSize.iHeight / 2) - 5, 3, 11, 0, 0, 0, 255);
  327.                 Ikaros.m_pDraw->FillRGBA((sScreenSize.iWidth / 2) - 4, (sScreenSize.iHeight / 2), 9, 1, 255, 255, 255, 255);
  328.                 Ikaros.m_pDraw->FillRGBA((sScreenSize.iWidth / 2), (sScreenSize.iHeight / 2) - 4, 1, 9, 255, 255, 255, 255);
  329.             }
  330.         }
  331.  
  332.         Ikaros.m_pDraw->Text(5, 5, 255, 255, 255, 255, 0, Ikaros.m_pFont, "Kardofflhook");
  333.  
  334.  
  335.         Ikaros.m_pMenu->InitializeMenu();
  336.         Ikaros.m_pMenu->MenuDrawing();
  337.     }
  338. }
  339.  
  340.  
  341. #define WEAPON_SPREAD_OFFSET 0x778
  342.  
  343. QAngle GetSpreadAngle(UINT iSeed, CUserCmd* cmd, C_BaseCombatWeapon* Weapon)
  344. {
  345.     typedef float(__thiscall *getfloat)(void*);
  346.     typedef void(__thiscall *funcvoid)(void*);
  347.     ((funcvoid)((*(DWORD*)(*(DWORD*)(Weapon)+WEAPON_SPREAD_OFFSET + 0x8))))(Weapon);
  348.     const float constInaccuracy = ((getfloat)((*(DWORD*)(*(DWORD*)(Weapon)+WEAPON_SPREAD_OFFSET))))(Weapon);
  349.     const float constSpread = ((getfloat)((*(DWORD*)(*(DWORD*)(Weapon)+WEAPON_SPREAD_OFFSET + 0x4))))(Weapon);
  350.     QAngle view(cmd->viewangles);
  351.     Vector direction, right, up;
  352.     AngleVectors(view, &direction, &right, &up);
  353.     iSeed &= 0xFF;
  354.     RandomSeed(iSeed + 1);
  355.     float pi_1 = RandomFloat(0.f, 2.0f * M_PI_F);
  356.     float inaccuracy = RandomFloat(0.f, constInaccuracy);
  357.     Vector2D leftSpread((cos(pi_1) * inaccuracy), (sin(pi_1) * inaccuracy));
  358.     Vector2D rightSpread[0xFF];
  359.     for (int bullet = 0; bullet < 1; ++bullet)
  360.     {
  361.         float pi_2 = RandomFloat(0.f, 2.0f * M_PI_F);
  362.         float spread = RandomFloat(0.f, constSpread);
  363.         rightSpread[bullet] = Vector2D((cos(pi_2) * spread), (sin(pi_2) * spread));
  364.     }
  365.     for (int bullet = 0; bullet < 1; ++bullet)
  366.     {
  367.         Vector2D totalSpread = (leftSpread + rightSpread[bullet]);
  368.         totalSpread = -totalSpread;
  369.         Vector shot = (direction + (right * totalSpread.x) + (up * totalSpread.y));
  370.         VectorNormalize(shot);
  371.         float flIdentity[3][3];
  372.         flIdentity[2][0] = 1.0f;
  373.         flIdentity[2][1] = -totalSpread[0];
  374.         flIdentity[2][2] = totalSpread[1];
  375.         VectorNormalize(flIdentity[2]);
  376.         flIdentity[0][0] = 0.0f;
  377.         flIdentity[0][1] = -totalSpread[0];
  378.         flIdentity[0][2] = (1.0f / totalSpread[1]) + (1.0f / flIdentity[2][2]) + totalSpread[1];
  379.         if (totalSpread[0] > 0.0f && totalSpread[1] < 0.0f)
  380.         {
  381.             if (flIdentity[0][1] < 0.0f)
  382.                 flIdentity[0][1] = -flIdentity[0][1];
  383.         }
  384.         else if (totalSpread[0] < 0.0f && totalSpread[1] < 0.0f)
  385.         {
  386.             if (flIdentity[0][1] > 0.0f)
  387.                 flIdentity[0][1] = -flIdentity[0][1];
  388.         }
  389.         if (flIdentity[0][2] < 0.0f)
  390.             flIdentity[0][2] = -flIdentity[0][2];
  391.         VectorNormalize(flIdentity[0]);
  392.         CrossProduct(flIdentity[0], flIdentity[2], flIdentity[1]);
  393.         VectorNormalize(flIdentity[1]);
  394.         float flCross = (flIdentity[1][1] * flIdentity[2][0]) - (flIdentity[1][0] * flIdentity[2][1]);
  395.         float flRoll;
  396.         if (view[0] > 84.0f || view[0] < -84.0f)
  397.             flRoll = RAD2DEG(atan2(flIdentity[1][2], sqrt(flCross)));
  398.         else
  399.             flRoll = RAD2DEG(atan2(flIdentity[1][2], flCross));
  400.         if (flRoll < 0.0f)
  401.             flRoll += 360.0f;
  402.         QAngle angles;
  403.         VectorAngles(shot, up, angles);
  404.         angles[2] += flRoll;
  405.         angles -= view;
  406.         NormalizeAngles(angles);
  407.         return angles;
  408.     }
  409.     return QAngle(0, 0, 0);
  410. }
  411.  
  412. void __stdcall new_CreateMove(int sequence_number)
  413. {
  414.     if (Ikaros.m_pInput)
  415.     {
  416.         CUserCmd* cmd = Ikaros.m_pInput->GetUserCmd(-1, sequence_number);
  417.         CVerifiedUserCmd* vcmd = *(CVerifiedUserCmd**)((DWORD)Ikaros.m_pInput + 0xF0) + (sequence_number % 150);
  418.  
  419.         bSendPacket = 1;
  420.  
  421.         if (!cmd || !vcmd || !Ikaros.m_pEntity->Ent())
  422.             return;
  423.  
  424.         C_BaseCombatWeapon* pWeapon = Ikaros.m_pEntity->GetBaseCombatWeapon(Ikaros.m_pEntity->Ent());
  425.  
  426.         QAngle qOldView(cmd->viewangles);
  427.  
  428.  
  429.         if (Ikaros.m_pConvars->flMiscAntiAim == 1){
  430.             cmd->viewangles.y = cmd->viewangles.y + 90.f + (float)(rand() % 55);
  431.         }
  432.  
  433.         if (Ikaros.m_pConvars->flMiscAntiAim == 2){
  434.             cmd->viewangles.y = cmd->viewangles.y - (90.f + (float)(rand() % 55));
  435.         }
  436.  
  437.         if (Ikaros.m_pConvars->flMiscAntiAim == 3){
  438.             cmd->viewangles.y = cmd->viewangles.y + 90.f + (float)(rand() % 360);
  439.         }
  440.  
  441.         if (Ikaros.m_pConvars->flMiscAntiAim == 4){
  442.             cmd->viewangles.y = cmd->viewangles.y + 90.0f + (float)(rand() % 360);
  443.             cmd->viewangles.y = cmd->viewangles.y + 150.0f + (float)(rand() % 360);
  444.             cmd->viewangles.y = cmd->viewangles.y - 43.0f + (float)(rand() % 360);
  445.             cmd->viewangles.y = cmd->viewangles.y - 44.0f + (float)(rand() % 360);
  446.             cmd->viewangles.x = 89;
  447.  
  448.         }
  449.  
  450.         if (Ikaros.m_pConvars->flMiscFakeLag == 1){
  451.             int iChoke = 15;
  452.             static int iFakeLag = 0;
  453.  
  454.             if (iFakeLag < iChoke)
  455.                 bSendPacket = false;
  456.  
  457.             if (iFakeLag > iChoke + 3)
  458.                 iFakeLag = 0;
  459.  
  460.             iFakeLag++;
  461.  
  462.         }
  463.  
  464.         if (pWeapon)
  465.         {
  466.             float flCurTime = float(*(int*)((DWORD)Ikaros.m_pEntity->Ent() + Ikaros.m_pOffsets->TickBase) * Ikaros.m_pGlobals->interval_per_tick);
  467.             float flNextAttack = *(float*)((DWORD)pWeapon + Ikaros.m_pOffsets->NextPrimaryAttack);
  468.             static int iChokedPackets = 0;
  469.  
  470.             if ((Ikaros.m_pConvars->flAimbotActive == 1.0f || (Ikaros.m_pConvars->flAimbotActive == 2.0f && GetAsyncKeyState(VK_LBUTTON))) && !Ikaros.m_pUtilities->IsKnife(pWeapon) && !Ikaros.m_pUtilities->IsMisc(pWeapon))
  471.             {
  472.                 Aimbot(cmd, pWeapon);
  473.  
  474.                 if (cmd->buttons & IN_ATTACK)
  475.                 {
  476.                     if (Ikaros.m_pConvars->flAimbotSilent == 2.0f)
  477.                     {
  478.                         if ((flNextAttack <= flCurTime))
  479.                         {
  480.                             if (iChokedPackets <= 10)
  481.                             {
  482.                                 ++iChokedPackets;
  483.                                 bSendPacket = false;
  484.  
  485.                                 if (iTarget > -1)
  486.                                     cmd->viewangles = qAngle;
  487.  
  488.                                 if (Ikaros.m_pConvars->flRemovalsSpread && !Ikaros.m_pConvars->flMiscAntiUntrust)
  489.                                     cmd->viewangles += GetSpreadAngle(cmd->random_seed, cmd, pWeapon);
  490.  
  491.                                 if (Ikaros.m_pConvars->flRemovalsRecoil)
  492.                                     cmd->viewangles -= Ikaros.m_pEntity->GetPunchAngle(Ikaros.m_pEntity->Ent()) * 2;
  493.                             }
  494.                             else
  495.                             {
  496.                                 iChokedPackets = 0;
  497.                                 cmd->buttons &= ~IN_ATTACK;
  498.                                 bSendPacket = 1;
  499.                             }
  500.                         }
  501.                         else
  502.                         {
  503.                             if (Ikaros.m_pConvars->flMiscAutoPistol)
  504.                                 cmd->buttons &= ~IN_ATTACK;
  505.                         }
  506.                     }
  507.                     else
  508.                     {
  509.                         if (Ikaros.m_pConvars->flRemovalsSpread && !Ikaros.m_pConvars->flMiscAntiUntrust)
  510.                             cmd->viewangles += GetSpreadAngle(cmd->random_seed, cmd, pWeapon);
  511.  
  512.                         if (Ikaros.m_pConvars->flRemovalsRecoil)
  513.                             cmd->viewangles -= Ikaros.m_pEntity->GetPunchAngle(Ikaros.m_pEntity->Ent()) * 2;
  514.  
  515.                         if (Ikaros.m_pConvars->flMiscAutoPistol)
  516.                         {
  517.                             if (flNextAttack > flCurTime)
  518.                             {
  519.                                 cmd->buttons &= ~IN_ATTACK;
  520.                             }
  521.                         }
  522.                     }
  523.                 }
  524.                 else
  525.                 {
  526.                     if (Ikaros.m_pConvars->flAimbotSilent == 2.0f)
  527.                     {
  528.                         iChokedPackets = 0;
  529.                         bSendPacket = true;
  530.                         cmd->viewangles = qOldView;
  531.                     }
  532.                 }
  533.             }
  534.  
  535.             if (Ikaros.m_pConvars->flMiscBunnyhop)
  536.             {
  537.                 if (cmd->buttons & IN_JUMP && !(Ikaros.m_pEntity->GetFlags(Ikaros.m_pEntity->Ent()) & FL_ONGROUND))
  538.                     cmd->buttons &= ~IN_JUMP;
  539.             }
  540.         }
  541.  
  542.         CL_FixMove(cmd, qOldView);
  543.         ClampAngles(cmd->viewangles);
  544.  
  545.         vcmd->m_cmd = *cmd;
  546.         vcmd->m_crc = cmd->GetChecksum();
  547.     }
  548. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement