Advertisement
Bagura32rus

T2 два профиля переключения

Jul 19th, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.39 KB | None | 0 0
  1. #pragma METAINFO("AwesomeAntiRecoil", 1, 0, "bonefisher")
  2.  
  3. /* Special credits goes out to AryanX for a awesome anti-recoil script!*/
  4. #define float fix32
  5.  
  6. float recoil_1 = 42.0;
  7. float recoil_2 = 25.0;
  8.  
  9. //Anti Recoil
  10. bool bUseAntiRecoil = TRUE;
  11. float ARecoil_H_Standing = 0.0;// Change horizontal force add negative if needed.
  12. float ARecoil_V_Standing = 25.0;//Change vertical pull force
  13. uint16 ARecoilDelay = 75;//Change delay after trigger is pulled to engage anti-recoil.
  14.  
  15. //Percent of anti ARecoil to always apply regardless of aim movement
  16. float MinARecoilPercent = 30.0;
  17.  
  18. float StickNoise = 6.32;
  19.  
  20. main {
  21. // ADS+Dpad Up
  22. if (is_active(BUTTON_8) && event_active(BUTTON_10)) {
  23. if (ARecoil_V_Standing == recoil_1) {
  24. ARecoil_V_Standing = recoil_2;
  25. ARecoil_H_Standing = 0.0;
  26. ARecoilDelay = 75;
  27. MinARecoilPercent = 30.0;
  28. } else {
  29. ARecoil_V_Standing = recoil_1;
  30. ARecoil_H_Standing = 9.0;
  31. ARecoilDelay = 115;
  32. MinARecoilPercent = 45.0;
  33. }
  34. }
  35.  
  36. //////////////////////////////////////////////////////////////////////////
  37. //Anti Recoil
  38. //////////////////////////////////////////////////////////////////////////
  39. if (bUseAntiRecoil)
  40. {
  41.  
  42. if (get_actual(BUTTON_8) &&get_actual(BUTTON_5) && time_active(BUTTON_5) >= ARecoilDelay)
  43. {
  44.  
  45. if (abs(get_actual(STICK_1_X)) < StickNoise) set_val(STICK_1_X, 0.0);
  46. if (abs(get_actual(STICK_1_Y)) < StickNoise) set_val(STICK_1_Y, 0.0);
  47. if (abs(get_actual(STICK_2_X)) < StickNoise) set_val(STICK_2_X, 0.0);
  48. if (abs(get_actual(STICK_2_Y)) < StickNoise) set_val(STICK_2_Y, 0.0);
  49.  
  50. if (get_actual(BUTTON_8) && get_val(BUTTON_5))
  51. {
  52. AntiRecoil(STICK_1_X, ARecoil_H_Standing);
  53. AntiRecoil(STICK_1_Y, ARecoil_V_Standing);
  54. }
  55. }
  56. }
  57. }
  58.  
  59. void AntiRecoil(uint8 AxisToApply, float ARecoilToApply)
  60. {
  61. float CurrentX = get_val(STICK_1_X);
  62. float CurrentY = get_val(STICK_1_Y);
  63. float MinARecoilFactor = MinARecoilPercent / 100.0;
  64. float MinARecoilToApply = MinARecoilFactor * ARecoilToApply;
  65. //This sets the ARecoil to be dependent on both X and Y axis movement. With more emphasis on Y
  66. float MovementARecoilToApply = (1.0 - MinARecoilFactor) * ((ARecoilToApply * (100.0 - sqrt(CurrentX*CurrentX + CurrentY*CurrentY))) / (100.0 + abs(CurrentX) + (CurrentY*CurrentY*0.5)));
  67. set_val(AxisToApply, MinARecoilToApply + MovementARecoilToApply + get_val(AxisToApply));
  68. }
  69.  
  70. bool run_flag;
  71.  
  72. main
  73. {
  74. if(!get_actual(BUTTON_5) && !get_actual(BUTTON_8) && !run_flag &&
  75. get_val(STICK_2_Y) < -99.0 && time_active(STICK_2_Y) > 300) {
  76. run_flag = 1;
  77. combo_run(run);
  78. }else if(get_val(STICK_2_Y) > -99.0 && event_release(STICK_2_Y)) {
  79. run_flag = 0;
  80. }
  81. }
  82.  
  83. combo run
  84. {
  85. set_val(BUTTON_9, 0.0);
  86. wait(200);
  87. set_val(BUTTON_9, 100.0);
  88. wait(400);
  89. set_val(BUTTON_9, 0.0);
  90. }
  91. bool toggle;
  92.  
  93. main {
  94. // VIEW + RT to toggle rapidfire
  95. if(get_val(BUTTON_2) && event_active(BUTTON_5)) {
  96. toggle = !toggle;
  97. }
  98.  
  99. if(toggle) {
  100. if(get_val(BUTTON_5)) {
  101. combo_run(Rapidfire);
  102. }
  103. }
  104.  
  105.  
  106. }
  107.  
  108. combo Rapidfire {
  109. set_val(BUTTON_5, 100.0);
  110. wait(28);
  111. set_val(BUTTON_5, 0.0);
  112. wait(16);
  113. set_val(BUTTON_5, 0.0);
  114. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement