Guest User

Superpower

a guest
May 15th, 2013
490
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.14 KB | None | 0 0
  1. //Superpower Filterscript By Guest123
  2. //
  3.  
  4.  
  5. #include <a_samp>//tnx to sa-mp
  6. #include <zcmd> //tnx to zeek
  7. #pragma tabsize 0 // zzz
  8.  
  9. //me creator :D
  10.  
  11. /*
  12.  
  13. (C)2013
  14.  
  15. GGGGGGGGGGGGGGGGGGGGGGGG                GG               GG             GGGGGGGGGGGGG         GGGGGGG     GGGGGGGGGGGGGGGGGGG
  16. GG                                      GG               GG             GG                   GG                    GG
  17. GG                                      GG               GG             GG                   GG                    GG
  18. GG                                      GG               GG             GG                  GG                     GG
  19. GG                                      GG               GG             GG                 GG                      GG
  20. GGGGGGGGGGGGGGGGGGGGGGGG                GG               GG             GGGGGGGGGGGGG        GG                    GG
  21. GG                    GG                GG               GG             GG                     GG                  GG
  22. GG                    GG                GG               GG             GG                      GG                 GG
  23. GG                    GG                GG               GG             GG                       GG                GG
  24. GGGGGGGGGGGGGGGGGG    GG                GG               GG             GG                      GG                 GG
  25. GGGGGGGGGGGGGGGGGG    GG                GGGGGGGGGGGGGGGGGGG             GGGGGGGGGGGGG     GGGGGGGG                  GG                 123
  26.  
  27. */
  28.  
  29.  
  30. /*
  31. ====================================================                          _________
  32. RRRR    RRRRRR   RRRRR       RR         RRR   RRRRRR         ++          ==   |        )
  33. R  R    R        R   R       R R        R R   R              ++          ==   |        )
  34. R   R   R        RRRRR       R  R      R  R   RRRRRR     ++++++++++           |        )
  35. RRRR    RRRRR    R           R   R    R   R   R              ++          ==   |        )
  36. R  R    R        R           R    R  R    R   R              ++          ==   |        )
  37. R   R   RRRRR    R           R     RR     R   RRRRRR                          ---------
  38.  
  39. ====================================================
  40.  
  41.  
  42. */
  43.  
  44.  
  45. new
  46. SuperPower[MAX_PLAYERS];
  47.  
  48. //tnx to wiki.sa-mp.com
  49.  
  50. #define PRESSED(%0) \
  51.     (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  52.  
  53.  
  54.  
  55. #define SetPlayerHoldingObject(%1,%2,%3,%4,%5,%6,%7,%8,%9) SetPlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1,%2,%3,%4,%5,%6,%7,%8,%9)
  56. #define StopPlayerHoldingObject(%1) RemovePlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1)
  57. #define IsPlayerHoldingObject(%1) IsPlayerAttachedObjectSlotUsed(%1,MAX_PLAYER_ATTACHED_OBJECTS-1)
  58.  
  59. public OnFilterScriptInit()
  60. {
  61.     print("\n--------------------------------------");
  62.     print(" Superpower filterscripts by Guest Loaded|version 0.2 (latest version)");
  63.     print("--------------------------------------\n");
  64.     return 1;
  65. }
  66. //auto off superpowers
  67. public OnPlayerConnect(playerid)
  68. {
  69. SuperPower[playerid] = 0;
  70. return 1;
  71. }
  72.  
  73. public OnPlayerDisconnect(playerid, reason)
  74. {
  75. SuperPower[playerid] = 0;
  76. return 1;
  77. }
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84. CMD:superon(playerid,params[])
  85. {
  86.     if(IsPlayerAdmin(playerid))
  87.     {
  88.         SuperPower[playerid] = 1;
  89.         SetPlayerHealth(playerid,999999.0);//can't die while using superpower lol
  90.         SetPlayerArmour(playerid,999999.0);//can't die while using superpower lol
  91.         SendClientMessage(playerid, -1, "Superpower has been {00ffff}enabled{ffffff}!");
  92.         SetPlayerAttachedObject( playerid, 0, 2976, 15, 0.000000, 0.100000, -0.500000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
  93.         SetPlayerAttachedObject( playerid, 1, 18688, 5, -0.300000, 0.200000, -1.500000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
  94.     }
  95.     else SendClientMessage(playerid,-1,"You Must be a RCON administrator to use this command");
  96.     return 1;
  97. }
  98.  
  99.  
  100.  
  101. CMD:superoff(playerid,params[])
  102. {
  103.     if(IsPlayerAdmin(playerid))
  104.     for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
  105.     {
  106.         SuperPower[playerid] = 0;
  107.         if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
  108.         SetPlayerHealth(playerid,100.0);
  109.         SetPlayerArmour(playerid,100.0);
  110.         SendClientMessage(playerid, -1, "Superpower has been {00ffff}enabled{ffffff}!");
  111.     }
  112.     else SendClientMessage(playerid,-1,"You Must be a RCON administrator to use this command");
  113.     return 1;
  114. }
  115.  
  116. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  117. {
  118.     if (PRESSED(KEY_JUMP))
  119.       {
  120.       if(SuperPower[playerid] == 1)
  121.         {
  122.           new
  123.         Float:x,
  124.         Float:y,
  125.         Float:z;
  126.         GetPlayerPos(playerid, x, y, z);
  127.         GetXYInFrontOfPlayer(playerid, x, y, 16);
  128.         SetPlayerPos(playerid, x, y, z+1.0);
  129.         CreateExplosion(x, y, z, 0, 10.0);
  130.        }
  131.     }
  132.     return 1;
  133. }
  134.  
  135.  
  136.  
  137. /*
  138.  
  139. Tnx To Aryzal
  140.  
  141. */
  142. stock GetXYInFrontOfPlayer(playerid, &Float:x2, &Float:y2, Float:distance)
  143. {
  144. new Float:a;
  145.  
  146. GetPlayerPos(playerid, x2, y2, a);
  147. GetPlayerFacingAngle(playerid, a);
  148.  
  149. if(GetPlayerVehicleID(playerid))
  150. {
  151.  
  152. GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
  153. }
  154.  
  155. x2 += (distance * floatsin(-a, degrees));
  156. y2 += (distance * floatcos(-a, degrees));
  157. }
Advertisement
Add Comment
Please, Sign In to add comment