Advertisement
Guest User

Super Cannone [English]

a guest
Aug 11th, 2012
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.31 KB | None | 0 0
  1. /**********************************
  2. -----------------------------------
  3. Super Cannon LS Beach
  4. Map by Stunterx
  5. Script by Stunterx
  6. Translated By Sig Hansen
  7. -----------------------------------
  8.  
  9. **********************************/
  10.  
  11. #include <a_samp>
  12.  
  13. #define COLOR_GREEN 0x00FF00FF
  14. #define COLOR_RED 0xF60000AA
  15.  
  16. forward controlloCannon();
  17. forward CannonUnfreeze();
  18.  
  19. new
  20. bool:inCannon[MAX_PLAYERS],
  21. CannonObj,
  22. timerControlloCannon,
  23. maxPlayers;
  24.  
  25. public OnFilterScriptInit()
  26. {
  27. print("\n========================================");
  28. print("|- Super Cannon LS Beach -|");
  29. print("|- Map by Stunterx -|");
  30. print("|- Script by Stunterx -|");
  31. print("|- Loaded! -|");
  32. print("========================================\n");
  33. maxPlayers = GetMaxPlayers();
  34. CannonObj = CreateObject(3865, 839.52935791016, -2059.0070800781, 13.726110458374, 0, 358.5, 1);
  35. CreateObject(2909, 837.38903808594, -2062.2612304688, 11.973615646362, 270, 180.00152587891, 179.2568359375);
  36. CreateObject(2909, 841.45599365234, -2064.8791503906, 11.923616409302, 270, 179.99450683594, 180.99975585938);
  37. CreateObject(2909, 841.40991210938, -2062.2963867188, 11.923616409302, 270, 179.99450683594, 180.99975585938);
  38. CreateObject(2909, 837.35803222656, -2064.884765625, 11.973615646362, 270, 180, 179.2529296875);
  39. CreateObject(2909, 841.37908935547, -2059.6853027344, 11.923616409302, 270, 179.99450683594, 180.99975585938);
  40. CreateObject(2909, 841.37628173828, -2057.0959472656, 11.923616409302, 270, 179.99853515625, 181.00370788574);
  41. CreateObject(2909, 841.32800292969, -2054.5610351563, 11.923616409302, 270, 179.99450683594, 180.99975585938);
  42. CreateObject(2909, 837.42462158203, -2059.6506347656, 11.973615646362, 270, 180, 179.2529296875);
  43. CreateObject(2909, 837.46789550781, -2057.05078125, 11.973615646362, 270, 180, 179.2529296875);
  44. CreateObject(2909, 837.50793457031, -2054.5615234375, 11.973615646362, 270, 180, 179.2529296875);
  45. CreateObject(2909, 839.45349121094, -2054.5439453125, 16.198608398438, 0, 270, 270.00524902344);
  46. CreateObject(2909, 839.42291259766, -2057.130859375, 16.198608398438, 0, 270, 270);
  47. CreateObject(2909, 839.39526367188, -2059.7426757813, 16.198608398438, 0, 270, 270);
  48. CreateObject(2909, 839.40631103516, -2062.3911132813, 16.198608398438, 0, 270, 270);
  49. CreateObject(2909, 839.40454101563, -2064.9912109375, 16.198608398438, 0, 270, 270);
  50. CreateObject(9131, 843.236328125, -2053.4609375, 15.071090698242, 0, 0, 0);
  51. CreateObject(9131, 841.77862548828, -2053.4812011719, 15.071090698242, 0, 0, 0);
  52. CreateObject(9131, 842.51306152344, -2053.5234375, 12.821105957031, 0, 0, 0);
  53. CreateObject(9131, 841.77233886719, -2053.5302734375, 12.821109771729, 0, 0, 0);
  54. CreateObject(9131, 843.24682617188, -2053.509765625, 12.821105957031, 0, 0, 0);
  55. CreateObject(9131, 837.0009765625, -2053.4619140625, 15.021102905273, 0, 0, 358.24768066406);
  56. CreateObject(9131, 835.67163085938, -2053.4172363281, 12.796117782593, 0, 0, 359.24768066406);
  57. CreateObject(9131, 837.0009765625, -2053.4619140625, 12.796125411987, 0, 0, 358.24768066406);
  58. CreateObject(9131, 835.67346191406, -2053.4130859375, 15.046113967896, 0, 0, 359.24743652344);
  59. CreateObject(9131, 836.38482666016, -2053.4375, 12.796125411987, 0, 0, 358.24768066406);
  60. CreateObject(2909, 838.67102050781, -2054.2685546875, 11.998615264893, 270.69775390625, 44.994750976563, 315.74642944336);
  61. CreateObject(2909, 841.123046875, -2054.1782226563, 11.998615264893, 270.69763183594, 44.994506835938, 315.74157714844);
  62. return 1;
  63. }
  64.  
  65. public OnFilterScriptExit()
  66. {
  67. print("\n========================================");
  68. print("|- Super Cannon LS Beach -|");
  69. print("|- Map by Stunterx -|");
  70. print("|- Script by Stunterx -|");
  71. print("|- Unloaded! -|");
  72. print("========================================\n");
  73. return 1;
  74. }
  75.  
  76. public OnPlayerConnect(playerid)
  77. {
  78. inCannon[playerid] = false;
  79. return 1;
  80. }
  81.  
  82. public OnPlayerCommandText(playerid, cmdtext[])
  83. {
  84. new
  85. pName[24],
  86. string[128];
  87. GetPlayerName(playerid, pName, 24);
  88.  
  89. if(strcmp("/cannon", cmdtext, true) == 0)
  90. {
  91. if(inCannon[playerid] == true) return SendClientMessage(playerid, COLOR_RED, "|- You are already inside the cannon.");
  92. SetPlayerInterior(playerid, 0);
  93. SetPlayerPos(playerid, 839.1580, -2057.2214, 13.2710);
  94. TogglePlayerControllable(playerid, 0);
  95. inCannon[playerid] = true;
  96. format(string, 128, "* %s č went inside the Super Cannon! (/ cannon)", pName);
  97. SendClientMessageToAll(COLOR_GREEN, string);
  98. SendClientMessage(playerid, COLOR_GREEN, "|- You have entered the Super Cannon and you have been immobilized.");
  99. SendClientMessage(playerid, COLOR_GREEN, "|- Remember that you can use / startcannon to go.");
  100. SendClientMessage(playerid, COLOR_GREEN, "|- If you want to quit using / esccannon");
  101. return 1;
  102. }
  103.  
  104. if(strcmp("/esccannon", cmdtext, true) == 0)
  105. {
  106. if(inCannon[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "|- You are already out of the Cannon.");
  107. SpawnPlayer(playerid);
  108. inCannon[playerid] = false;
  109. TogglePlayerControllable(playerid, 1);
  110. format(string, 128, "* %s č went out of the Super Cannon!! (/esccannon)", pName);
  111. SendClientMessageToAll(COLOR_GREEN, string);
  112. SendClientMessage(playerid, COLOR_GREEN, "[INFO:] You have left the super-cannon, and six free again.");
  113. SendClientMessage(playerid, COLOR_GREEN, "[INFO:] Remember that you can use / entcannon to get back into the Cannon.");
  114. return 1;
  115. }
  116.  
  117. if(strcmp("/startcannon", cmdtext, true) == 0)
  118. {
  119. if(inCannon[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "|- You are not in the Cannon. Get in in using / entcannon.");
  120. CreateExplosion(835.5359, -2054.8293, 12.8672, 2, 5);
  121. CreateExplosion(843.1001, -2055.0627, 12.8672, 2, 5);
  122. CreateExplosion(839.4694, -2051.5188, 12.8672, 2, 5);
  123. MoveObject(CannonObj, 835.7650, -2594.9653, 13.1358, 50);
  124. SetTimer("cannonUnfreeze", 3000, false);
  125. timerControlloCannon = SetTimer("controlloCannon", 250, true);
  126. format(string, 128, "* %s has started the Super Cannon! (/ startcannon)", pName);
  127. SendClientMessageToAll(COLOR_GREEN, string);
  128. return 1;
  129. }
  130.  
  131. return 0;
  132. }
  133.  
  134. public controlloCannon()
  135. {
  136. new
  137. Float:rPos[3],
  138. Float:pPos[3];
  139. GetObjectPos(CannonObj, rPos[0], rPos[1], rPos[2]);
  140. if(rPos[0] == 835.7650 && rPos[1] == -2594.9653 && rPos[2] == 13.1358)
  141. {
  142. for(new i = 0; i != MAX_PLAYERS; i++)
  143. {
  144. if(IsPlayerConnected(i) && inCannon[i] == true)
  145. {
  146. inCannon[i] = false;
  147. GetPlayerPos(i, pPos[0], pPos[1], pPos[2]);
  148. SetPlayerPos(i, pPos[0] + 5, pPos[1] + 5, pPos[2] + 5);
  149. CreateExplosion(pPos[0] + 5, pPos[1] + 5, pPos[2] - 5, 11, 5);
  150. SendClientMessage(i, COLOR_GREEN, "|- ou have been kicked from Cannon. Use /cannon to return to Cannon.");
  151. }
  152. }
  153. KillTimer(timerControlloCannon);
  154. CreateExplosion(836.0727, -2602.4878, 14.0880, 2, 5);
  155. MoveObject(CannonObj, 839.52935791016, -2059.0070800781, 13.726110458374, 50);
  156. }
  157. }
  158.  
  159. public CannonUnfreeze()
  160. {
  161. for(new i = 0; i < maxPlayers; i++) if(IsPlayerConnected(i) && inCannon[i] == true) TogglePlayerControllable(i, 1);
  162. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement