Advertisement
Bagura32rus

T2 PUBG 3 профиля

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