emS-St1ks

Counter Strike Global Offensive , No Recoil

Oct 3rd, 2014
501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.04 KB | None | 0 0
  1. // st1ks version
  2. #include "stdafx.h"
  3. bool isshooting = false;
  4. Vector viewAngles;
  5. Vector punchAngles;
  6. Vector NewAngles;
  7.  
  8. bool GetRCSKey()
  9. {
  10.     return (GetAsyncKeyState(0x01));
  11. }
  12.  
  13. void NoRecoil()
  14. {
  15.     IClientEntity* pLocalEntity = pClientEntList->GetClientEntity(pEngine->GetLocalPlayer());
  16.    
  17.     if(!pLocalEntity)
  18.         return;
  19.  
  20.     if(cEng.IsAlive(pLocalEntity))
  21.     {      
  22.             if(GetRCSKey())
  23.             {
  24.                 isshooting = true;
  25.             }else
  26.             {
  27.                 isshooting = false;
  28.             }
  29.  
  30.             if(!isshooting)//If you arent pressing mouse1
  31.             {
  32.                 viewAngles = pLocalEntity->GetAngles();//Gets Viewangles
  33.                 punchAngles = cEng.GetPunchAng(pLocalEntity);//Gets punchAngles.
  34.             }
  35.             else if(isshooting)//If you are pressing mouse1
  36.             {
  37.                 punchAngles = cEng.GetPunchAng(pLocalEntity);//Gets punchAngles.
  38.  
  39.                 if(punchAngles.X == 0.0f && punchAngles.Y == 0.0f && punchAngles.Z == 0.0f)//So it doesnt lock xhair when using grenades/knife/c4.
  40.                     return;
  41.  
  42.                 NewAngles = viewAngles - punchAngles *2.f;
  43.                 pEngine->SetViewAngles(NewAngles);//Sets new Viewangles
  44.             }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment