Advertisement
Guest User

Zayan`s_High Jump fS - V-0.3 [UPDATED] [BUGS FIXED] [ALL]

a guest
Feb 13th, 2013
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.42 KB | None | 0 0
  1. /*
  2. ===================================================
  3. =================High Jump fS======================
  4. ===================================================
  5. |                                                 |
  6. Created By: Zayan
  7.  
  8. Created On: 13/02/2013 [20:34:21]
  9.  
  10. Created By Using: Pawn compiler 3.2.3664 (PAWNO)
  11.  
  12. Thanks To: SA-MP for functions & more
  13.  
  14. If you find any bug, please report it with a photo.
  15.  
  16. */
  17. #include <a_samp>
  18.  
  19. #define INFINITY     \
  20.     (Float:0x7F800000)    // this define was added in V-0.3 | Comment added in (V-0.3)
  21.  
  22. new
  23.     IsMad[MAX_PLAYERS]; // Dont edit or remove it | Comment added in (V-0.2)
  24.  
  25. new
  26.     Float:ghp; // This line is for ythe
  27.  
  28. new
  29.     Float:health;
  30.  
  31. public OnFilterScriptInit()
  32. {
  33.     print("\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  34.     print(" High Jump Filter Script by Zayan \nIf you find any bug, please report on www.sa-mp.com");
  35.     print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
  36.     return 1;
  37. }
  38.  
  39. public OnFilterScriptExit()
  40. {
  41.     return 1;
  42. }
  43. public OnPlayerConnect(playerid)
  44. {
  45.      IsMad[playerid] = 0; // This was very important, added in V-0.3 | Comment was added in (V-0.3)
  46.      ShowInfo(playerid);
  47.      return 1;
  48. }
  49. public OnPlayerCommandText(playerid, cmdtext[])
  50. {
  51.     if(strcmp("/setjumppower", cmdtext, true, 10) == 0)
  52.     {
  53.         if(IsMad[playerid] == 0)
  54.         {
  55.            if(!IsPlayerAdmin(playerid)) return ReturnErrMsg(playerid);
  56.            SendClientMessage(playerid, 0xFFBBCC, "* Jump power: ON");
  57.            IsMad[playerid] = 1;
  58.            SetPlayerHealth(playerid, INFINITY); // This function was added in V-0.3 | Comment added in (V-0.3)
  59.            return 1;
  60.         }
  61.         else if(IsMad[playerid] == 1)
  62.         {
  63.            if(!IsPlayerAdmin(playerid)) return ReturnErrMsg(playerid);
  64.            SendClientMessage(playerid, 0xFFBBDD, "* Jump power: OFF");
  65.            IsMad[playerid] = 0;
  66.            SetPlayerHealth(playerid, 100); // This line was added in V-0.3 | Comment was added in (V-0.3)
  67.            return 1;
  68.         }
  69.         return 1;
  70.     }
  71.     return 0;
  72. }
  73. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  74. {
  75.     if(newkeys & KEY_JUMP) // you can change KEY_JUMP to any key name e.g: KEY_FIRE (left mouse button) | KEY_SPRINT (space key) & more | Comment added in (V-0.2)
  76.     {
  77.         if(IsMad[playerid] == 1)
  78.         {
  79.             new Float:X;
  80.             new Float:Y;
  81.             new Float:Z;
  82.             GetPlayerPos(playerid, X,Y,Z);
  83.             GetPlayerHealth(playerid, ghp);
  84.             CreateExplosion(X,Y,Z-2,7,6);
  85.             SetPlayerHealth(playerid, ghp);
  86.             SetPlayerHealth(playerid, INFINITY);
  87.         }
  88.     }
  89.     return 1;
  90. }
  91. public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
  92. {
  93.     if(playerid != INVALID_PLAYER_ID)
  94.     {
  95.         if(IsMad[playerid] == 1)
  96.         {
  97.             SetPlayerHealth(playerid, INFINITY);
  98.             GetPlayerHealth(playerid,health);
  99.             if ( health  <  19.9 ) // This line was added in V-0.3 | This was added for a health bug fix | Comment was added in (V-0.3)
  100.             {
  101.                 SetPlayerHealth(playerid, INFINITY);
  102.             }
  103.         }
  104.     }
  105.     return 1;
  106. }
  107. stock ShowInfo(playerid) // dont remove it ;C | Comment added in (V-0.2)
  108. {
  109.      GameTextForPlayer(playerid, "This server is running~n~High jump fs by zayan", 7000, 4);
  110. }
  111. stock ReturnErrMsg(playerid) // new function added in (V-0.2) * it returns a error message of "You are not a RCON admin!" | e.g: if(!IsPlayerAdmin(playerid)) return ReturnErrMsg(playerid) | Comment added in (V-0.2)
  112. {
  113.     return SendClientMessage(playerid, 0xFFBBAA, "You are not a RCON admin!");
  114. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement