Guest User

[FS]Anti BunnyHop by:merK^

a guest
Aug 10th, 2012
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.58 KB | None | 0 0
  1. /* Anti bunny hop FS by merK^
  2. Please don't remove the credits!                                                                     */
  3.  
  4.  
  5. #include <a_samp>
  6.  
  7. #define FILTERSCRIPT
  8. #if defined FILTERSCRIPT
  9.  
  10. #define COLOR_GROVE 0x00FF00FF
  11. #define Holding(%0) \
  12.     ((newkeys & (%0)) == (%0))
  13. #define Pressed(%0) \
  14. (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  15. #define COLOR_GROVE 0x00FF00FF
  16. #define SCM SendClientMessage
  17.  
  18. #pragma tabsize 0
  19.  
  20. new PlayerPressedJump[MAX_PLAYERS];
  21.  
  22. public OnFilterScriptInit()
  23. {
  24.     print("\n--------------------------------------");
  25.     print("Anti bunny hop FS by:merK^");
  26.     print("--------------------------------------\n");
  27.     return 1;
  28. }
  29. public OnPlayerConnect(playerid)
  30. {
  31.     PlayerPressedJump[playerid] = 0; // Sets variable to 0 when they first connect
  32.     return 1;
  33. }
  34. forward PressJump(playerid);
  35. public PressJump(playerid)
  36. {
  37.     PlayerPressedJump[playerid] = 0; // Reset the variable
  38.     ClearAnimations(playerid);
  39.     return 1;
  40. }
  41. forward PressJumpReset(playerid);
  42. public PressJumpReset(playerid)
  43. {
  44.     PlayerPressedJump[playerid] = 0; // Reset the variable
  45.     return 1;
  46. }
  47. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  48. {
  49.        if (Holding (KEY_SPRINT))
  50.       {
  51.                if (Pressed (KEY_JUMP))
  52.                {
  53.                        ApplyAnimation(playerid, "PED", "IDLE_tired", 4.1, 0, 1, 1, 1, 0, 1);
  54.             SCM(playerid, COLOR_GROVE, "Pokusao si da skocis dok si trcao i uganuo si clanak.");
  55.             SetTimerEx("PressJump", 4000, false, "i", playerid); // Tajmer koliko je "clanak uganut"
  56.         }
  57.     }
  58.     return 1;
  59. }
  60. #endif
Advertisement
Add Comment
Please, Sign In to add comment