Guest User

Untitled

a guest
Oct 8th, 2012
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 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_LIGHTBLUE 0xFFFF00
  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. new busy[MAX_PLAYERS];
  22. forward ReduceTimer(playerid);
  23.  
  24. public OnFilterScriptInit()
  25. {
  26. print("\n--------------------------------------");
  27. print("Anti bunny hop FS by:merK^");
  28. print("--------------------------------------\n");
  29. return 1;
  30. }
  31. public OnPlayerConnect(playerid)
  32. {
  33. PlayerPressedJump[playerid] = 0; // Sets variable to 0 when they first connect
  34. return 1;
  35. }
  36. forward PressJump(playerid);
  37. public PressJump(playerid)
  38. {
  39. PlayerPressedJump[playerid] = 0; // Reset the variable
  40. ClearAnimations(playerid);
  41. return 1;
  42. }
  43. forward PressJumpReset(playerid);
  44. public PressJumpReset(playerid)
  45. {
  46. PlayerPressedJump[playerid] = 0; // Reset the variable
  47. return 1;
  48. }
  49. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  50. {if((Pressed (KEY_JUMP) & Holding (KEY_SPRINT)) && !IsPlayerInAnyVehicle(playerid))
  51. {
  52. busy[playerid] = 1;
  53. {
  54. ClearAnimations(playerid);
  55. ApplyAnimation(playerid, "PED", "IDLE_tired", 4.1, 0, 1, 1, 1, 0, 1);
  56. SCM(playerid, COLOR_LIGHTBLUE, "Pokusao si da skocis dok si trcao i uganuo si clanak.");
  57. SetTimerEx("PressJump", 4000, false, "i", playerid); // Tajmer koliko je "clanak uganut"
  58. }
  59. }
  60. return 1;
  61. }
  62. #endif
Advertisement
Add Comment
Please, Sign In to add comment