Advertisement
Guest User

Zallomallo

a guest
Feb 7th, 2009
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.46 KB | None | 0 0
  1. #include <a_samp>
  2. #include <MWSGM>
  3.  
  4. #define TEAM_ARMY 0
  5. #define TEAM_INSURG 1
  6.  
  7. #define CP_AA 0
  8. #define CP_LV 1
  9. #define CP_NONE 2
  10.  
  11. new obj1, obj2;
  12. new gTeam[MAX_PLAYERS];
  13. new CPStatus[MAX_PLAYERS];
  14.  
  15. main()
  16. {
  17. print("\n----------------------------------");
  18. print(" Air Mayhem by Zallomallo");
  19. print("----------------------------------\n");
  20. }
  21.  
  22. new Float:RanSpawnA[6][4] =
  23. {
  24. {444.6608,2475.0254,19.4859,52.4392},
  25. {443.1833,2526.4458,17.7539,102.2597},
  26. {415.3969,2534.6248,19.1484,342.5652},
  27. {389.2361,2531.3953,16.5391,171.8203},
  28. {337.3109,2534.1492,16.8018,179.0270},
  29. {321.1554,2463.1477,16.4766,5.1488}
  30. };
  31.  
  32. new Float:RanSpawnB[3][4] =
  33. {
  34. {1585.9900,1644.6625,10.8203,84.0649},
  35. {1352.0114,1650.2816,10.8203,282.7697},
  36. {1302.1096,1495.5107,10.8203,262.6119}
  37. };
  38.  
  39.  
  40. public OnGameModeInit()
  41. {
  42. // Don't use these lines if it's a filterscript
  43. SetGameModeText("Air Mayhem");
  44. AddPlayerClass(287, 1958.3783, 1343.1572, 15.3746, 269.1425, 31, 500, 0, 0, 0, 0);
  45. AddPlayerClass(165, 0.0, 0.0, 0.0, 0.0, 31, 500, 0, 0, 0, 0);
  46.  
  47. AddStaticVehicle(520,1297.7546,1343.3573,11.7534,270.9451,0,7); // hyd
  48. AddStaticVehicle(476,1283.3756,1361.9178,11.5322,273.5233,0,7); // rustle3
  49. AddStaticVehicle(476,1281.6790,1324.0360,11.5245,270.6413,0,7); // rustle4
  50. AddStaticVehicle(476,325.4901,2536.2371,17.5130,179.7633,0,7); // rustle1
  51. AddStaticVehicle(476,290.3291,2539.7146,17.5262,181.6323,0,7); // rustle2
  52. AddStaticVehicle(469,365.6693,2538.1079,16.6645,179.9074,0,7); // heli1
  53. AddStaticVehicle(469,349.2796,2538.8364,16.7307,179.9620,0,7); // heli2
  54. AddStaticVehicle(603,308.3726,2534.1245,16.6539,180.8548,0,7); // car1
  55. AddStaticVehicle(555,277.3849,2536.2456,16.4471,181.2458,0,7); // car2
  56. AddStaticVehicle(415,1558.7574,1661.6639,10.5919,89.9900,0,7); // car1
  57. AddStaticVehicle(480,1339.2327,1541.5981,10.5943,266.9527,0,7); // car2
  58.  
  59. obj1 = AddStaticVehicle(592,1309.2770,1399.1201,12.0151,272.2825,0,7); // objective1
  60. obj2 = AddStaticVehicle(609,403.7561,2446.3301,16.5674,1.2754,0,0); // objective2
  61. return 1;
  62. }
  63.  
  64. public OnGameModeExit()
  65. {
  66. return 1;
  67. }
  68.  
  69. public OnPlayerRequestClass(playerid, classid)
  70. {
  71. switch(classid) {
  72. case 0: {
  73. gTeam[playerid] = TEAM_ARMY;
  74. GameTextForPlayer(playerid, "Army", 2000, 4);
  75. }
  76. case 1: {
  77. gTeam[playerid] = TEAM_INSURG;
  78. GameTextForPlayer(playerid, "Rebels", 2000, 4);
  79. }
  80. }
  81. SetPlayerPos(playerid, 1627.3291,-2286.6221,94.1328);
  82. SetPlayerFacingAngle(playerid, 179.6531);
  83. SetPlayerCameraPos(playerid, 1628.4277,-2299.7849,94.9248);
  84. SetPlayerCameraLookAt(playerid, 1627.3291,-2286.6221,94.1328);
  85. return 1;
  86. }
  87.  
  88.  
  89.  
  90. public OnPlayerConnect(playerid)
  91. {
  92. new pname[24], string[256];
  93. GetPlayerName(playerid, pname, sizeof(pname));
  94. SendClientMessage(playerid, Blue1, "Welcome to Air Mayhem!");
  95. format(string, sizeof(string), "%s has joined the server!", pname);
  96. SendClientMessageToAll(Green1, string);
  97. return 1;
  98. }
  99.  
  100. public OnPlayerDisconnect(playerid, reason)
  101. {
  102. new pname[24], string[256];
  103. GetPlayerName(playerid, pname, sizeof(pname));
  104. format(string, sizeof(string), "%s has left the server!", pname);
  105. SendClientMessageToAll(Green1, string);
  106. return 1;
  107. }
  108.  
  109. public OnPlayerSpawn(playerid)
  110. {
  111. if(gTeam[playerid] == TEAM_ARMY) {
  112. new ranspawn = random(sizeof(RanSpawnB));
  113. SetPlayerPos(playerid, RanSpawnB[ranspawn][0], RanSpawnB[ranspawn][1], RanSpawnB[ranspawn][2]);
  114. SetPlayerFacingAngle(playerid, RanSpawnB[ranspawn][3]);
  115. SetCameraBehindPlayer(playerid);
  116. SetVehicleParamsForPlayer(obj1, playerid, 0, 1);
  117. SetVehicleParamsForPlayer(obj2, playerid, 1, 0);
  118. }
  119.  
  120. if(gTeam[playerid] == TEAM_INSURG) {
  121. new ranspawn = random(sizeof(RanSpawnA));
  122. SetPlayerPos(playerid, RanSpawnA[ranspawn][0], RanSpawnA[ranspawn][1], RanSpawnA[ranspawn][2]);
  123. SetPlayerFacingAngle(playerid, RanSpawnA[ranspawn][3]);
  124. SetCameraBehindPlayer(playerid);
  125. SetVehicleParamsForPlayer(obj2, playerid, 0, 1);
  126. SetVehicleParamsForPlayer(obj1, playerid, 1, 0);
  127. }
  128. return 1;
  129. }
  130.  
  131.  
  132. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  133. {
  134. if(vehicleid == obj1 && !ispassenger) {
  135. SendClientMessage(playerid, Blue1, "Good, now fly back to your base!");
  136. SetPlayerCheckpoint(playerid, 417.1299,2450.4150,16.5000, 3.0);
  137. CPStatus[playerid] = CP_AA;
  138. }
  139.  
  140. if(vehicleid == obj2 && !ispassenger) {
  141. SendClientMessage(playerid, Blue1, "Good, now drive back to your base!");
  142. SetPlayerCheckpoint(playerid, 1586.7177,1170.6078,10.8125, 3.0);
  143. CPStatus[playerid] = CP_LV;
  144. }
  145.  
  146. return 1;
  147. }
  148.  
  149. public OnPlayerExitVehicle(playerid, vehicleid)
  150. {
  151. if(vehicleid == obj2 || vehicleid == obj1) {
  152. DisablePlayerCheckpoint(playerid);
  153. CPStatus[playerid] = CP_NONE;
  154. }
  155. return 1;
  156. }
  157.  
  158.  
  159. public OnPlayerEnterCheckpoint(playerid)
  160. {
  161. if(CPStatus[playerid] == CP_AA) {
  162. new pname[24], string[256];
  163. SendClientMessage(playerid, Blue1, "You have won the round!");
  164. GetPlayerName(playerid, pname, sizeof(pname));
  165. format(string, sizeof(string), "%s has won the game for the Rebels!");
  166. DisablePlayerCheckpoint(playerid);
  167. CPStatus[playerid] = CP_NONE;
  168. SetTimer("EndGame", 2500, 0);
  169. }
  170.  
  171. if(CPStatus[playerid] == CP_LV) {
  172. new pname[24], string[256];
  173. SendClientMessage(playerid, Blue1, "You have won the round!");
  174. GetPlayerName(playerid, pname, sizeof(pname));
  175. format(string, sizeof(string), "%s has won the game for the Army!");
  176. DisablePlayerCheckpoint(playerid);
  177. CPStatus[playerid] = CP_NONE;
  178. SetTimer("EndGame", 2500, 0);
  179. }
  180.  
  181. return 1;
  182. }
  183.  
  184.  
  185. forward EndGame();
  186. public EndGame()
  187. {
  188. OnGameModeExit();
  189. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement