Guest User

FellDown System by : ChuckyBabe

a guest
Apr 7th, 2014
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. /* Fell Down System By chuckybabe 3/5/2014
  2. */
  3. /* This filterscript "Felldown system" is most use in a roleplay mode :) please don't remove the credits ! +rep if i help!
  4. */
  5.  
  6. #include <a_samp>
  7.  
  8. #define FILTERSCRIPT
  9. #if defined FILTERSCRIPT
  10.  
  11. #define COLOR_LIGHTBLUE 0x33CCFFAA
  12.  
  13. #define SCM SendClientMessage
  14.  
  15. new PlayerPressedJump[MAX_PLAYERS];
  16.  
  17. public OnFilterScriptInit()
  18. {
  19. print("\n--------------------------------------");
  20. print(" Fell Down System By ChuckyBabe");
  21. print("--------------------------------------\n");
  22. return 1;
  23. }
  24. public OnPlayerConnect(playerid)
  25. {
  26. PlayerPressedJump[playerid] = 0; // Sets variable to 0 when they first connect
  27. return 1;
  28. }
  29. forward PressJump(playerid);
  30. public PressJump(playerid)
  31. {
  32. PlayerPressedJump[playerid] = 0; // Reset the variable
  33. ClearAnimations(playerid);
  34. return 1;
  35. }
  36. forward PressJumpReset(playerid);
  37. public PressJumpReset(playerid)
  38. {
  39. PlayerPressedJump[playerid] = 0; // Reset the variable
  40. return 1;
  41. }
  42. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  43. {
  44. if((newkeys & KEY_JUMP) && !IsPlayerInAnyVehicle(playerid))
  45. {
  46. PlayerPressedJump[playerid] ++;
  47. SetTimerEx("PressJumpReset", 3000, false, "i", playerid); // Makes it where if they dont spam the jump key, they wont fall
  48.  
  49. if(PlayerPressedJump[playerid] == 3) // change 3 to how many jump you want before they fall
  50. {
  51. ApplyAnimation(playerid, "PED", "BIKE_fall_off", 4.1, 0, 1, 1, 1, 0, 1); // applies the fallover animation
  52. SCM(playerid, COLOR_LIGHTBLUE, "Don't bunny hop, bitch!"); //the message if fell
  53. SetTimerEx("PressJump", 9000, false, "i", playerid); // Timer for how long the animation lasts
  54. }
  55. }
  56. return 1;
  57. }
  58. #endif
Advertisement
Add Comment
Please, Sign In to add comment