Advertisement
Guest User

Untitled

a guest
Feb 19th, 2021
671
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. scn B42InertiaS
  2.  
  3. int iDone
  4. int iReset
  5. float X
  6. float Z
  7. float deltaX
  8. float deltaZ
  9. float deltaXapply
  10. float deltaZapply
  11. float fAppliedVertical
  12. float fAppliedHorizontal
  13.  
  14. Begin GameMode
  15.  
  16.  
  17. if IsPC1stPerson == 1 && Player.IsWeaponOut == 1 && player.GetAnimAction != 0
  18.  
  19. set iReset to 0
  20.  
  21. if iDone == 0
  22. SetNumericGameSetting fFirstPersonHandFollowMult 1
  23. SetNumericGameSetting fFirstPersonHandChaseSeconds 0
  24. set iDone to 1
  25. endif
  26.  
  27. set deltaX to player.GetAngle X - X
  28. set X to player.GetAngle X
  29. set deltaZ to player.GetAngle Z - Z
  30. set Z to player.GetAngle Z
  31.  
  32. if deltaX < 3.5 && deltaX > -3.5
  33. set deltaXapply to (deltaX * (2 - (GetPCUsingIronSights * 2))) / -1
  34. endif
  35. if deltaZ < 6 && deltaZ > -6
  36. set deltaZapply to (deltaZ * (2 - (GetPCUsingIronSights * 2)))
  37. endif
  38. if deltaXapply > 3.5
  39. set deltaXapply to 3.5
  40. elseif deltaXapply < -3.5
  41. set deltaXapply to -3.5
  42. endif
  43. if deltaZapply > 6
  44. set deltaZapply to 6
  45. elseif deltaZapply < -6
  46. set deltaZapply to -6
  47. endif
  48. set fAppliedVertical to fAppliedVertical + (((deltaXapply - fAppliedVertical) * 4) * GetSecondsPassed)
  49. set fAppliedHorizontal to fAppliedHorizontal + (((deltaZapply - fAppliedHorizontal) * 4) * GetSecondsPassed)
  50.  
  51. if GetPCUsingIronSights
  52. Player.SetNifBlockRotation "Spine0Controller" fAppliedHorizontal 0 fAppliedVertical
  53. Player.SetNifBlockRotation "NeckController" 0 0 0
  54. else
  55. Player.SetNifBlockRotation "NeckController" fAppliedHorizontal 0 fAppliedVertical
  56. Player.SetNifBlockRotation "Spine0Controller" 0 0 0
  57. endif
  58. else
  59. if iReset == 0
  60. Player.SetNifBlockRotation "Spine0Controller" 0 0 0
  61. Player.SetNifBlockRotation "NeckController" 0 0 0
  62. set iReset to 1
  63. set iDone to 0
  64. endif
  65. endif
  66.  
  67.  
  68. End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement