Advertisement
Bagura32rus

T2 обновленный 21,07,2019

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