Advertisement
Chronos_Ouroboros

ACS Recoil Shit

Jul 12th, 2015
521
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. function fixed clampFixed (fixed number, fixed min, fixed max) {
  2. fixed realMin = min;
  3. fixed realMax = max;
  4.  
  5. if (min > max) {
  6. realMax = min;
  7. realMin = max;
  8. }
  9.  
  10. if (number > realMax)
  11. return realMax;
  12. else if (number < realMin)
  13. return realMin;
  14. else
  15. return number;
  16. }
  17.  
  18. script "S7_RecoilPitch" (fixed pitch) { // Called like this in code: AMGG BC 1 acs_namedExecuteAlways ("S7_RecoilPitch", 0, 0.5 * 65535)
  19. fixed oldPitch = getActorPitch (0);
  20. fixed newPitch = clampFixed (oldPitch - pitch, -25.0, 25.0);
  21.  
  22. setActorPitch (0, newPitch);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement