Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. static QAngle OldAimPunch = QAngle(0, 0, 0);
  2.  
  3. if (Vars.Misc.NoRecoil && !Vars.Ragebot.Enabled)
  4. {
  5. int activewep = G::LocalPlayer->GetWeapon()->GetWeaponID();
  6. if (Vars.Misc.NoRecoil && !activewep == WEAPON_NEGEV || !activewep == WEAPON_M249 || !activewep == WEAPON_CZ75A || !activewep == WEAPON_SCAR20 || !activewep == WEAPON_G3SG1);
  7. {
  8.  
  9. if (G::UserCmd->buttons & IN_ATTACK && pLocal->GetShotsFired() > 1)
  10. {
  11. CBaseEntity* pLocal = I::ClientEntList->GetClientEntity(I::Engine->GetLocalPlayer());
  12. // Get the current aim punch angles and multiply the recoil scale.
  13. auto AimPunch = G::LocalPlayer->GetPunch() *2.0f;
  14.  
  15. QAngle Delta = OldAimPunch - AimPunch;
  16.  
  17. // Set compensated view angles.
  18. cmd->viewangles += Delta;
  19. cmd->viewangles.Clamp();
  20.  
  21. // Save old aim punch for next tick.
  22. OldAimPunch = AimPunch;
  23.  
  24. return true;
  25. }
  26. else
  27. {
  28. // Reset when not firing.
  29. OldAimPunch.x = OldAimPunch.y = OldAimPunch.z = 0;
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement