JasperM

Kangaroo by ZombieNest

Aug 30th, 2014
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 8.26 KB | None | 0 0
  1. // Kangaroo script by Zombie Nest //
  2. // Enjoy jumping like a se** kangaroo //
  3.  
  4. /*
  5. ===================================================
  6. |                 Defines                         |
  7. ===================================================
  8. */
  9.  
  10. #define COLOR_YELLOW 0xFFFF00AA
  11.  
  12. #define PRESSED(%0) \
  13.     (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  14.    
  15. #define deactivatedskin 283
  16. #define kangarooskin 0
  17.    
  18. /*
  19. ===================================================
  20. |                 Includes                        |
  21. ===================================================
  22. */
  23. #include <a_samp>
  24. #include <zcmd>
  25. #include <sscanf2>
  26.  
  27. /*
  28. ===================================================
  29. |                 Variables                       |
  30. ===================================================
  31. */
  32.  
  33. new kangaroo[MAX_PLAYERS];
  34. new permitted[MAX_PLAYERS];
  35.  
  36. /*
  37. ===================================================
  38. |                 Forwards                        |
  39. ===================================================
  40. */
  41.  
  42. forward OnPlayerJoinWhenFSLoaded(playerid);
  43.  
  44. /*
  45. ===================================================
  46. |                Script Callbacks                 |
  47. ===================================================
  48. */
  49.  
  50.  
  51. public OnPlayerConnect(playerid)
  52. {
  53.     new Float:x, Float:y, Float:z;
  54.     SendClientMessage(playerid,-1,"This server is using Kangaroo system, /kangaroo to activate");
  55.     kangaroo[playerid] = 0;
  56.     SendClientMessage(playerid,COLOR_YELLOW,"Do not use any commands for 1 seconds please");
  57.     GetPlayerVelocity(playerid,Float:x,Float:y,Float:z);
  58.     SetPlayerVelocity(playerid,Float:x,Float:y*0.9,Float:z+1.5* 0.9);
  59.     TogglePlayerControllable(playerid, 0);
  60.     SetTimer("OnPlayerJoinWhenFSLoaded", 1000, false);
  61.     return 1;
  62. }
  63.  
  64. public OnPlayerSpawn(playerid)
  65. {
  66.     kangaroo[playerid] = 0;
  67.     SendClientMessage(playerid,COLOR_YELLOW,"Kangaroo mode is automatically disabled");
  68.     return 1;
  69. }
  70.  
  71. public OnPlayerJoinWhenFSLoaded(playerid)
  72. {
  73.     kangaroo[playerid] = 0;
  74.     SendClientMessage(playerid,COLOR_YELLOW," Loading the game..");
  75.     //SendClientMessage(playerid,COLOR_YELLOW," Permitting you to use /kangaroo..");
  76.     //permitted[playerid] = 1;
  77.     SendClientMessage(playerid,COLOR_YELLOW,"Thanks for playing, You can now start");
  78.     TogglePlayerControllable(playerid, 1);
  79.     return 1;
  80. }
  81.  
  82. public OnFilterScriptInit()
  83. {
  84.     print("=======================================");
  85.     print("|Kangaroo System by Zombie Nest       |");
  86.     print("|Be a kangaroo and high jump!/kangaroo|");
  87.     print("=======================================");
  88.     return 1;
  89. }
  90.  
  91. public OnFilterScriptExit()
  92. {
  93.     print("Kangaroo system unloaded");
  94.     return 1;
  95. }
  96.  
  97. /*
  98. ===================================================
  99. |                Script Commands                  |
  100. ===================================================
  101. */
  102.  
  103. CMD:kangaroo(playerid)
  104. {
  105.     if(permitted[playerid] == 1)
  106.     {
  107.         if(kangaroo[playerid] == 0)
  108.         {
  109.             kangaroo[playerid] = 1;
  110.             SendClientMessage(playerid,COLOR_YELLOW,"Kangaroo mode activated JUMP to high jump");
  111.             SetPlayerChatBubble(playerid, "Kangaroo - 250 HP - High Jump - Kill me!", 0xFF0000FF, 500.0, 9999999);
  112.             SetPlayerHealth(playerid,250);
  113.             ResetPlayerWeapons(playerid);
  114.             SetPlayerHealth(playerid,250);
  115.             SetPlayerSkin(playerid,kangarooskin);
  116.             SetPlayerAttachedObject(playerid, 0, 19314, 2, 0.1089, 0.0000, 0.0000, -5.4999, -8.3000, -2.8999, 1.0000, 1.0000, 1.0000, 0, COLOR_YELLOW);
  117.             SetPlayerAttachedObject(playerid, 7, 19515, 1, 0.0740, 0.0509, 0.0000, 0.0000, 0.0000, 0.0000, 1.0000, 1.0000, 1.0000, 0, COLOR_YELLOW);
  118.             SetPlayerAttachedObject(playerid, 2, 19514, 2, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 1.0000, 1.0000, 1.0000, 0, COLOR_YELLOW);
  119.             SetPlayerAttachedObject(playerid, 3, 2041, 6, 0.1790, 0.0000, 0.0819, 4.2999, -0.8999, 82.6000, 1.0000, 1.0000, 1.0000, 0, COLOR_YELLOW);
  120.             SetPlayerAttachedObject(playerid, 4, 2041, 5, 0.2440, 0.0179, -0.0419, 134.5999, 0.0000, 84.9000, 1.0000, 1.0000, 1.0000, 0, COLOR_YELLOW);
  121.             SetPlayerAttachedObject(playerid, 5, 2590, 1, -0.5350, -0.1229, -0.1779, 0.0000, -107.1999, 3.4999, 1.0000, 1.0000, 1.0000, 0, COLOR_YELLOW);
  122.             SetPlayerAttachedObject(playerid, 6, 2589, 1, -4.7890, -0.0979, 0.3429, 0.0000, -86.7000, 0.0000, 1.0000, 1.0000, 1.0000, 0, COLOR_YELLOW);
  123.             SetPlayerAttachedObject(playerid, 1, 18963, 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1, COLOR_YELLOW);
  124.             SetPlayerHealth(playerid, 250);
  125.             return 1;
  126.         }
  127.         else
  128.         {
  129.             kangaroo[playerid] = 0;
  130.             SetPlayerChatBubble(playerid, " ", 0xFF0000FF, 0.0, 1000);
  131.             SetPlayerHealth(playerid,100);
  132.             SetPlayerSkin(playerid,deactivatedskin);
  133.             SendClientMessage(playerid,-1,"Kangaroo mode deactivated");
  134.             RemovePlayerAttachedObject(playerid, 0);
  135.             RemovePlayerAttachedObject(playerid, 1);
  136.             RemovePlayerAttachedObject(playerid, 2);
  137.             RemovePlayerAttachedObject(playerid, 3);
  138.             RemovePlayerAttachedObject(playerid, 4);
  139.             RemovePlayerAttachedObject(playerid, 5);
  140.             RemovePlayerAttachedObject(playerid, 6);
  141.             RemovePlayerAttachedObject(playerid, 7);
  142.             return 1;
  143.         }
  144.     }
  145.         else
  146.         {
  147.             SendClientMessage(playerid,COLOR_YELLOW,"Sorry you are not permitted to use this cmd");
  148.             return 1;
  149.         }
  150. }
  151.  
  152. CMD:depermit(playerid, params[])
  153. {
  154.     /*if(isnull(params))
  155.     {
  156.         return SendClientMessage(playerid,COLOR_YELLOW,"USAGE: /depermit [playerid]");
  157.     }*/
  158.     if(IsPlayerAdmin(playerid))
  159.     {
  160.         new target, string[128];
  161.         if (sscanf(params, "d", target)) return SendClientMessage(playerid, 0xFF0000AA,"Usage: /depermit [playerid]");
  162.         format(string, sizeof(string), "{FFFFFF}>> {0033FF}[SYSTEM]{FFFFFF}: An Admin (ID:%d) took ID %d /kangaroo permissions", playerid, target);
  163.         SendClientMessageToAll(0xFFFFFFAA,string);
  164.         format(string, sizeof(string), "{FFFFFF}You de-permitted ID %d from using /kangaroo", target);
  165.         SendClientMessage(playerid,0xFFFFFFAA,string);
  166.         format(string, sizeof(string), "{FFFFFF}Your permission to use /kangaroo has been taken by Admin(ID:%d)", playerid);
  167.         SendClientMessage(target,0xFFFFFFAA,string);
  168.         permitted[playerid] = 0;
  169.         return 1;
  170.         }
  171.         else
  172.         {
  173.             SendClientMessage(playerid,COLOR_YELLOW,"Sorry you are not a RCON Admin.");
  174.             return 1;
  175.         }
  176. }
  177.  
  178. CMD:permit(playerid, params[])
  179. {
  180.     /*if(isnull(params))
  181.     {
  182.         return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /permit [playerid]");
  183.     }*/
  184.     if(IsPlayerAdmin(playerid))
  185.     {
  186.         new target, string[128];
  187.         if (sscanf(params, "d", target)) return SendClientMessage(playerid, 0xFF0000AA,"Usage: /permit [playerid]");
  188.         format(string, sizeof(string), "{FFFFFF}>> {0033FF}[SYSTEM]{FFFFFF}: An Admin (ID:%d) permitted ID %d to use /kangaroo", playerid, target);
  189.         SendClientMessageToAll(0xFFFFFFAA,string);
  190.         format(string, sizeof(string), "{FFFFFF}You permitted ID %d to use /kangaroo", target);
  191.         SendClientMessage(playerid,0xFFFFFFAA,string);
  192.         format(string, sizeof(string), "{FFFFFF}You have been permitted to use /kangaroo by Admin(ID:%d)", playerid);
  193.         SendClientMessage(target,0xFFFFFFAA,string);
  194.         permitted[playerid] = 1;
  195.         return 1;
  196.         }
  197.         else
  198.         {
  199.             SendClientMessage(playerid,COLOR_YELLOW,"Sorry you are not a RCON Admin.");
  200.             return 1;
  201.         }
  202. }
  203.  
  204. /*
  205. ===================================================
  206. |                Key Settings                     |
  207. ===================================================
  208. */
  209.  
  210. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  211. {
  212.     if (PRESSED(KEY_JUMP))
  213.     {
  214.         if(kangaroo[playerid] == 1)
  215.         {
  216.         new Float:x,Float:y,Float:z;
  217.         GetPlayerVelocity(playerid,Float:x,Float:y,Float:z);
  218.         SetPlayerVelocity(playerid,Float:x,Float:y*0.9,Float:z+0.9* 0.9);
  219.         return 1;
  220.         }
  221.     }
  222.     return 1;
  223. }
Add Comment
Please, Sign In to add comment