Advertisement
spinsquad

no visual recoil

Mar 23rd, 2015
509
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. local hook = hook;
  2. local Angle = Angle;
  3. local math = math;
  4. local fa;
  5.  
  6. hook.Add("CalcView", "", function(p, o, a, f)
  7.     local view = {};
  8.     view.fov = f;
  9.     view.angles = fa;
  10.     view.origin = o;
  11.     return view;
  12. end);
  13.  
  14. hook.Add("CreateMove", "", function(ucmd)
  15.     if(!fa) then fa = ucmd:GetViewAngles(); end
  16.     fa = (fa + Angle(ucmd:GetMouseY() * .023, ucmd:GetMouseX() * -.023, 0));
  17.     fa.p, fa.y, fa.x = math.Clamp(fa.p, -89, 89), math.NormalizeAngle(fa.y), math.NormalizeAngle(fa.x);
  18.    
  19.     ucmd:SetViewAngles(fa);
  20. end);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement