Advertisement
MicroKyrr

Super Jump v2.0 by MicroKyrr

Jan 25th, 2016
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.65 KB | None | 0 0
  1. /* # # ###### ###### ##### ###### # # # # ##### #####
  2. # # # # # # # # # # # # # # # # # #
  3. # # # # # # # # # # # # ###### # # # #
  4. # # # # # # ## # # # # # ## ##
  5. # # # # # # # # # # # # # # # # # #
  6. # # # ###### ###### # # ###### # # ###### # # # #
  7. ________________________________________________________________
  8. | Super Jump v2.0 by MicroKyrr |
  9. | Credits to: |
  10. | MicroKyrr for creating this script |
  11. | SecretBoss for optimizing this script |
  12. | SAMP for the include a_samp/Keys and GetPlayername |
  13. | Zeex for his ZCMD |
  14. | |
  15. |________________________________________________________________| */
  16.  
  17. /*|__________[Includes]__________|*/
  18. #include <a_samp>
  19. #include <zcmd>
  20. /*|__________[Defines]___________|*/
  21. #define FILTERSCRIPT
  22. #define RED 0xff0000FF
  23. #define GREEN 0x00ff33FF
  24. #define ORANGE 0xFF9900AA
  25. #define CORAL 0xEFC286FF
  26. #define GOLD 0xB8860BAA
  27. #define BLUE 0x4400ffFF
  28.  
  29. /*|__________[forwards]__________|*/
  30. forward JumpTimer(playerid);
  31. /*|__________[Function new]__________|*/
  32. new Text:Shifton;
  33. new Text:Shiftoff;
  34. new Jumping[MAX_PLAYERS];
  35. new sjEnabled[MAX_PLAYERS];
  36.  
  37. public OnFilterScriptInit()
  38. {
  39. print("\n ______________________________________");
  40. print("| Super Jump v1.0 by MicroKyrr |");
  41. print("| Successfully loaded |");
  42. print("|______________________________________|\n");
  43.  
  44. Shifton = TextDrawCreate(480.000000, 431.000000, "Super Jump is currently enabled");
  45. TextDrawFont(Shifton , 1);
  46. TextDrawLetterSize(Shifton , 0.300000, 1.300000);
  47. TextDrawColor(Shifton, GREEN);
  48. TextDrawSetOutline(Shifton , false);
  49. TextDrawSetProportional(Shifton , true);
  50. TextDrawSetShadow(Shifton , 1);
  51.  
  52. Shiftoff = TextDrawCreate(480.000000, 431.000000, "Super Jump is currently disabled");
  53. TextDrawFont(Shiftoff , 1);
  54. TextDrawLetterSize(Shiftoff , 0.300000, 1.300000);
  55. TextDrawColor(Shiftoff, RED);
  56. TextDrawSetOutline(Shiftoff , false);
  57. TextDrawSetProportional(Shiftoff , true);
  58. TextDrawSetShadow(Shiftoff , 1);
  59. return 1;
  60. }
  61.  
  62. public OnFilterScriptExit()
  63. {
  64. print("\n ______________________________________");
  65. print("| Super Jump v1.0 by MicroKyrr |");
  66. print("| Successfully unloaded |");
  67. print("|______________________________________|\n");
  68. return 1;
  69. }
  70.  
  71. public OnPlayerConnect(playerid)
  72. {
  73. sjEnabled[playerid] = 0;
  74.  
  75. if(sjEnabled[playerid] == 0)
  76. {
  77. TextDrawHideForAll(Shifton);
  78. TextDrawShowForAll(Shiftoff);
  79.  
  80.  
  81. }
  82. else if(sjEnabled[playerid] == 1)
  83. {
  84. TextDrawHideForAll(Shiftoff);
  85. TextDrawShowForAll(Shifton);
  86. }
  87. return 1;
  88. }
  89.  
  90. public OnPlayerDisconnect(playerid, reason)
  91. {
  92. return 1;
  93. }
  94.  
  95. public OnPlayerSpawn(playerid)
  96. {
  97. Jumping[playerid] = 0;
  98. return 1;
  99. }
  100.  
  101. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  102. {
  103. if(sjEnabled[playerid] == 1)
  104. {
  105. if(newkeys == KEY_JUMP && Jumping[playerid] == 0)
  106. {
  107. Jumping[playerid] = 1;
  108. new Float:superJump[3];
  109. GetPlayerVelocity(playerid, superJump[0], superJump[1], superJump[2]);
  110. SetPlayerVelocity(playerid, superJump[0], superJump[1], superJump[2]+5);
  111. SetTimerEx("JumpTimer", 15000, 0, "i", playerid);
  112. SendClientMessage(playerid, BLUE, "You have used your Super Jump! Wait 15 seconds to use Super Jump again to prevent abuse.");
  113. PlayerPlaySound(playerid, 1190, 0.0, 0.0, 0.0);
  114. }
  115. }
  116. return 1;
  117. }
  118.  
  119. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  120. {
  121. if(dialogid == 2)
  122. {
  123. if(response)
  124. {
  125. if(listitem == 0 && (sjEnabled[playerid] == 0))
  126. {
  127.  
  128. sjEnabled[playerid] = 1;
  129. new message[280], Name[MAX_PLAYER_NAME];
  130. GetPlayerName(playerid, Name, sizeof(Name));
  131. TextDrawShowForAll(Shifton);
  132. TextDrawHideForAll(Shiftoff);
  133. format(message, sizeof(message), "Super Jump has been enabled by Administrator {DBED15}%s{37DB45} , you can jump higher than normal!", Name);
  134. SendClientMessage(playerid, GREEN, message);
  135. }
  136. if(listitem == 1 && (sjEnabled[playerid] == 1))
  137. {
  138. sjEnabled[playerid] = 0;
  139. new message[280], Name[MAX_PLAYER_NAME];
  140. GetPlayerName(playerid, Name, sizeof(Name));
  141. TextDrawHideForAll(Shifton);
  142. TextDrawShowForAll(Shiftoff);
  143. format(message, sizeof(message), "Super Jump has been disabled by Administrator {DBED15}%s{FF0000} , Super Jump has been reset!", Name);
  144. SendClientMessageToAll(RED, message);
  145. return 1;
  146. }
  147. }
  148. }
  149. return 1;
  150. }
  151.  
  152. public JumpTimer(playerid)
  153. {
  154. Jumping[playerid] = 0;
  155. SendClientMessage(playerid, ORANGE, "15 Seconds has been passed! You can use Super Jump again");
  156. return 1;
  157. }
  158.  
  159.  
  160. CMD:superjump(playerid, params[])
  161. {
  162. if(!IsPlayerAdmin(playerid)) /*Change this to your admin variable*/ return SendClientMessage(playerid, RED, "You don't have the authority to use this command!");
  163.  
  164. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Super Jump Panel by MicroKyrr", "Enable Super Jump\nDisable Super Jump", "Ok", "Cancel");
  165. return 1;
  166. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement