Bulletje

Untitled

Feb 20th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 40.51 KB | None | 0 0
  1. /*
  2. Script by: Sasuke_Uchiha
  3. Map by: Bullet
  4. Mission Base: Bombing
  5. Mission Type: Checkpoint bombing
  6. Mission Type ID: 1
  7. */
  8. //==============================================================================
  9. // Includes
  10. //==============================================================================
  11. #include <a_samp>
  12. #include <crashdetect>
  13. #include <float>
  14.  
  15. #include "..\filterscripts\MM\stuff\defines"
  16. #include "..\filterscripts\MM\stuff\serverkeymsg"
  17.  
  18. //==============================================================================
  19. // Defines
  20. //==============================================================================
  21.  
  22. #define MISSION_NAME "James Blond: Ocean Docks"
  23. #define Health 99.0
  24. #define OBJ_NAME "Meth Storage"
  25. #define CP_POS 3788.5979,-2610.5916,20.9550
  26. #define CP_SIZE 3.0
  27. #define VEHICLE_HEALTH 999.0
  28. #define CLASS_POSTION 3734.8755,-2448.6968,17.5937
  29. #define CLASS_CAMERA 3734.9092,-2446.4177,16.7819
  30. #define CLASS_FACING_AGNLE 358.6529
  31. #define TEAM_DEFEND_NAME "Army"
  32. #define TEAM_ATTACK_NAME "Secret Agent"
  33. #define MAX_MAP_OBJECTS 174
  34. #define PLACING_TIME 7
  35. #define SPAWN_PROTECTION true
  36.  
  37. //==============================================================================
  38. // Per mission functions
  39. //==============================================================================
  40.  
  41. enum skindata
  42. {
  43. TeamID,
  44. SkinID,
  45. Float:SpawnX,
  46. Float:SpawnY,
  47. Float:SpawnZ,
  48. Float:SpawnAngle,
  49. SpawnInterior,
  50. VirtualWorld,
  51. Weapon1,
  52. Ammo1,
  53. Weapon2,
  54. Ammo2,
  55. Weapon3,
  56. Ammo3,
  57. };
  58.  
  59. new const SkinData[][skindata] = {
  60. {TEAM_ATTACK,164,3378.2107,-2676.3521,13.6533, 0.0,0,0,WEAPON_DEAGLE,100,WEAPON_SHOTGUN,100,WEAPON_M4,120},
  61. {TEAM_DEFEND,287, 3897.6279,-2562.2869,13.4748, 276.4963,0,0,WEAPON_COLT45,280,WEAPON_SHOTGSPA,160,WEAPON_AK47,120}
  62. };
  63.  
  64. new const Float:ExplosionsInfo[][3] = {
  65. {3788.8623,-2614.1748,20.9550},
  66. {3788.9985,-2608.7905,20.9550},
  67. {3789.4688,-2602.5107,20.9475},
  68. {3776.3284,-2602.2566,19.5277},
  69. {3771.4536,-2613.5720,13.7770},
  70. {3769.8782,-2594.3303,13.5878},
  71. {3755.8762,-2595.3726,13.5853},
  72. {3753.8472,-2616.3367,14.8469},
  73. {3744.9270,-2608.6541,13.5791},
  74. {3745.5149,-2596.9458,12.6798},
  75. {3739.5044,-2602.4951,13.5727}
  76. };
  77.  
  78. #if MAX_MAP_OBJECTS != 0
  79. new Object[MAX_MAP_OBJECTS];
  80.  
  81. CreateMap()
  82. {
  83. Object[0] = CreateObject(5145,3716.7902800,-2447.8562000,2.1381000,0.0000000,0.0000000,0.0000000); //
  84. Object[1] = CreateObject(3624,3788.1562500,-2493.9843800,16.7266000,0.0000000,0.0000000,0.0000000); //
  85. Object[2] = CreateObject(3624,3788.1562500,-2455.8828100,16.7266000,0.0000000,0.0000000,0.0000000); //
  86. Object[3] = CreateObject(3624,3788.1562500,-2417.7890600,16.7266000,0.0000000,0.0000000,0.0000000); //
  87. Object[4] = CreateObject(3620,3793.1955600,-2364.7067900,25.5156000,3.1416000,0.0000000,1.5708000); //
  88. Object[5] = CreateObject(3707,3716.2343800,-2452.5937500,20.2031000,0.0000000,0.0000000,0.0000000); //
  89. Object[6] = CreateObject(3707,3720.3203100,-2530.9140600,19.9766000,0.0000000,0.0000000,0.0000000); //
  90. Object[7] = CreateObject(3574,3771.0703100,-2520.5468800,15.2188000,0.0000000,0.0000000,0.0000000); //
  91. Object[8] = CreateObject(3574,3774.7968800,-2534.9531300,15.2188000,0.0000000,0.0000000,0.0000000); //
  92. Object[9] = CreateObject(3753,3748.0185500,-2571.6135300,3.0391000,3.1416000,0.0000000,0.0000000); //
  93. Object[10] = CreateObject(3626,3746.4062500,-2453.4843800,14.0781000,3.1416000,0.0000000,0.0000000); //
  94. Object[11] = CreateObject(3577,3744.5703100,-2427.3203100,13.3516000,356.8584000,0.0000000,-1.5708000); //
  95. Object[12] = CreateObject(3577,2744.5703100,-2436.1875000,13.3437500,356.8584000,0.0000000,-1.5708000); //
  96. Object[13] = CreateObject(1306,3742.2915000,-2481.5522500,19.8438000,360.0000000,0.0000000,0.0000000); //
  97. Object[14] = CreateObject(3578,3747.0078100,-2480.2421900,13.1719000,356.8584000,0.0000000,-1.5708000); //
  98. Object[15] = CreateObject(3689,3685.3828100,-2366.0546900,19.9531000,0.0000000,0.0000000,0.0000000); //
  99. Object[16] = CreateObject(3623,2660.4765600,-2429.2968800,17.0703100,356.8584000,0.0000000,3.1415900); //
  100. Object[17] = CreateObject(3623,3639.5468800,-2429.2968800,17.0703000,0.0000000,0.0000000,0.0000000); //
  101. Object[18] = CreateObject(3623,3618.8593800,-2429.2968800,17.0703000,0.0000000,0.0000000,0.0000000); //
  102. Object[19] = CreateObject(3753,32615.1093800,-2464.6171900,3.0391000,3.1416000,0.0000000,0.0000000); //
  103. Object[20] = CreateObject(5176,3521.5127000,-2606.9633800,17.6484000,0.0000000,0.0000000,0.0000000); //
  104. Object[21] = CreateObject(3620,3531.3085900,-2570.2050800,25.7446900,0.0000000,0.0000000,2.6400000); //
  105. Object[22] = CreateObject(3620,3559.0546900,-2563.4646000,25.5156000,0.0000000,0.0000000,0.0000000); //
  106. Object[23] = CreateObject(3623,3544.2500000,-2548.8125000,16.7031000,0.0000000,0.0000000,0.0000000); //
  107. Object[24] = CreateObject(3623,3544.2500000,-2524.0937500,16.4453000,0.0000000,0.0000000,0.0000000); //
  108. Object[25] = CreateObject(3627,3464.3046900,-2617.0156300,16.0469000,356.8584000,0.0000000,3.1416000); //
  109. Object[26] = CreateObject(3625,3464.1059600,-2571.6391600,15.1641000,3.1416000,0.0000000,1.5708000); //
  110. Object[27] = CreateObject(1306,3469.6269500,-2645.3330100,19.8438000,356.8584000,0.0000000,-3.1416000); //
  111. Object[28] = CreateObject(3578,3470.1406300,-2530.5546900,13.1719000,356.8584000,0.0000000,-1.5708000); //
  112. Object[29] = CreateObject(3689,3410.0791000,-2582.0239300,20.5234000,0.0000000,0.0000000,0.0000000); //
  113. Object[30] = CreateObject(3753,3347.2592800,-2527.3962400,36.1419800,0.0000000,0.0000000,0.0000000); //
  114. Object[31] = CreateObject(3624,3415.4609400,-2468.5781300,16.7266000,0.0000000,0.0000000,0.0000000); //
  115. Object[32] = CreateObject(3744,3437.2109400,-2490.0937500,15.2188000,0.0000000,0.0000000,0.0000000); //
  116. Object[33] = CreateObject(5146,3498.1953100,-2408.0078100,1.8047000,0.0000000,0.0000000,0.0000000); //
  117. Object[34] = CreateObject(3707,3539.1796900,-2424.3593800,20.4922000,0.0000000,0.0000000,0.0000000); //
  118. Object[35] = CreateObject(3707,3480.8593800,-2460.0546900,20.4922000,0.0000000,0.0000000,0.0000000); //
  119. Object[36] = CreateObject(1378,3425.7443800,-2431.7775900,36.8808300,0.0000000,0.0000000,-44.4000100); //
  120. Object[37] = CreateObject(8661,3426.4060100,-2441.6472200,12.4578000,0.0000000,0.0000000,-45.0000000); //
  121. Object[38] = CreateObject(3673,3564.4306600,-2354.4023400,36.4519000,0.0000000,0.0000000,-44.0000000); //
  122. Object[39] = CreateObject(3673,3557.0825200,-2360.5993700,36.4519000,0.0000000,0.0000000,-44.0000000); //
  123. Object[40] = CreateObject(3637,3585.3928200,-2381.0896000,20.2661500,0.0000000,0.0000000,-45.6599900); //
  124. Object[41] = CreateObject(8661,3576.1970200,-2372.4812000,12.5078200,0.0000000,0.0000000,-47.8200000); //
  125. Object[42] = CreateObject(8661,3589.0402800,-2358.5805700,12.3035400,0.0000000,0.0000000,-47.8200000); //
  126. Object[43] = CreateObject(5326,3661.5156300,-2465.1406300,19.8130000,360.0000000,0.0000000,0.0000000); //
  127. Object[44] = CreateObject(1306,3669.9062500,-2518.6640600,19.8438000,356.8584000,0.0000000,-3.1416000); //
  128. Object[45] = CreateObject(1306,3669.3635300,-2394.9641100,19.1305500,356.8584000,0.0000000,-3.1416000); //
  129. Object[46] = CreateObject(1278,3674.5234400,-2557.4921900,26.7031000,3.1416000,0.0000000,0.8727000); //
  130. Object[47] = CreateObject(5131,3768.9155300,-2593.3337400,18.9394000,0.0000000,0.0000000,90.0000000); //
  131. Object[48] = CreateObject(8661,3769.1257300,-2575.1491700,12.6436200,0.0000000,0.0000000,2.0000000); //
  132. Object[49] = CreateObject(8661,3755.1643100,-2589.7819800,12.5651000,0.0000000,0.0000000,2.0000000); //
  133. Object[50] = CreateObject(8661,3729.2985800,-2575.8999000,12.6523000,0.0000000,0.0000000,0.0000000); //
  134. Object[51] = CreateObject(5262,3745.1066900,-2593.5227100,15.2510500,0.0000000,0.0000000,0.0000000); //
  135. Object[52] = CreateObject(5260,3737.1293900,-2603.3283700,14.0878000,0.0000000,0.0000000,-90.0000000); //
  136. Object[53] = CreateObject(5259,3737.1218300,-2611.3601100,14.2753400,0.0000000,0.0000000,0.0000000); //
  137. Object[54] = CreateObject(5261,3765.8898900,-2614.5122100,12.5628600,0.0000000,0.0000000,-88.2600300); //
  138. Object[55] = CreateObject(1575,3790.4668000,-2612.9819300,19.9551400,0.0000000,0.0000000,0.0000000); //
  139. Object[56] = CreateObject(1575,3786.8999000,-2617.3828100,19.9551400,0.0000000,0.0000000,0.0000000); //
  140. Object[57] = CreateObject(1575,3786.9597200,-2604.5063500,19.9551400,0.0000000,0.0000000,0.0000000); //
  141. Object[58] = CreateObject(1575,3787.8808600,-2617.3591300,19.9551400,0.0000000,0.0000000,0.0000000); //
  142. Object[59] = CreateObject(1576,3790.7067900,-2603.2700200,19.9573700,0.0000000,0.0000000,0.0000000); //
  143. Object[60] = CreateObject(1576,3785.6127900,-2608.9895000,19.9573700,0.0000000,0.0000000,0.0000000); //
  144. Object[61] = CreateObject(1576,3787.2793000,-2607.3530300,19.9573700,0.0000000,0.0000000,0.0000000); //
  145. Object[62] = CreateObject(1576,3787.9697300,-2617.0517600,19.9573700,0.0000000,0.0000000,0.0000000); //
  146. Object[63] = CreateObject(1577,3791.3696300,-2605.5444300,19.9554800,0.0000000,0.0000000,0.0000000); //
  147. Object[64] = CreateObject(1577,3789.9687500,-2606.0354000,19.9554800,0.0000000,0.0000000,0.0000000); //
  148. Object[65] = CreateObject(1577,3789.4567900,-2607.5573700,19.9554800,0.0000000,0.0000000,0.0000000); //
  149. Object[66] = CreateObject(1577,3790.8283700,-2615.8720700,19.9554800,0.0000000,0.0000000,0.0000000); //
  150. Object[67] = CreateObject(1578,3788.3689000,-2602.5000000,19.9570200,0.0000000,0.0000000,0.0000000); //
  151. Object[68] = CreateObject(1578,3787.1240200,-2600.4672900,19.9570200,0.0000000,0.0000000,0.0000000); //
  152. Object[69] = CreateObject(1578,3791.3076200,-2608.3828100,19.9570200,0.0000000,0.0000000,0.0000000); //
  153. Object[70] = CreateObject(1578,3790.1787100,-2604.6196300,19.9570200,0.0000000,0.0000000,0.0000000); //
  154. Object[71] = CreateObject(1579,3786.9023400,-2611.5993700,19.9571100,0.0000000,0.0000000,0.0000000); //
  155. Object[72] = CreateObject(1579,3790.8720700,-2600.7329100,19.9571100,0.0000000,0.0000000,0.0000000); //
  156. Object[73] = CreateObject(1579,3787.2978500,-2610.3147000,19.9571100,0.0000000,0.0000000,0.0000000); //
  157. Object[74] = CreateObject(1579,3788.6591800,-2609.3405800,19.9571100,0.0000000,0.0000000,0.0000000); //
  158. Object[75] = CreateObject(1580,3786.3981900,-2615.7785600,19.9572100,0.0000000,0.0000000,0.0000000); //
  159. Object[76] = CreateObject(1580,3788.6989700,-2605.3122600,19.9572100,0.0000000,0.0000000,0.0000000); //
  160. Object[77] = CreateObject(1580,3789.2023900,-2611.6054700,19.9572100,0.0000000,0.0000000,0.0000000); //
  161. Object[78] = CreateObject(1580,3788.1096200,-2613.1228000,19.9572100,0.0000000,0.0000000,0.0000000); //
  162. Object[79] = CreateObject(355,3787.7292500,-2607.8049300,20.0294100,-109.1999600,-14.5200000,0.0000000); //
  163. Object[80] = CreateObject(3056,3790.5517600,-2610.1464800,19.9711800,-2.7600000,93.7800100,0.0000000); //
  164. Object[81] = CreateObject(351,3791.5698200,-2603.6401400,20.0374500,-97.5000800,-77.5199900,0.0000000); //
  165. Object[82] = CreateObject(348,3788.0830100,-2604.2216800,19.9643500,90.0000000,0.4200000,0.0000000); //
  166. Object[83] = CreateObject(5145,3841.5896000,-2501.5080600,1.9157000,0.0000000,0.0000000,0.0000000); //
  167. Object[84] = CreateObject(5262,3760.1540500,-2614.6755400,15.2510500,0.0000000,0.0000000,0.0000000); //
  168. Object[85] = CreateObject(5260,3749.0334500,-2612.9206500,14.0878000,0.0000000,0.0000000,-90.0000000); //
  169. Object[86] = CreateObject(5261,3764.5351600,-2589.3588900,12.5628600,0.0000000,0.0000000,3.3599700); //
  170. Object[87] = CreateObject(3816,3346.3647500,-2662.0190400,21.0290100,0.0000000,0.0000000,90.0600100); //
  171. Object[88] = CreateObject(3621,3438.7443800,-2696.6091300,17.7476900,356.8584000,0.0000000,3.1416000); //
  172. Object[89] = CreateObject(3621,3522.3774400,-2687.0668900,17.7477000,357.0000000,0.0000000,90.0000000); //
  173. Object[90] = CreateObject(3621,3457.2956500,-2695.5927700,17.7476900,356.8584000,0.0000000,3.1416000); //
  174. Object[91] = CreateObject(3621,3438.6762700,-2696.1345200,25.8441800,356.8584000,0.0000000,3.1416000); //
  175. Object[92] = CreateObject(3621,3521.9233400,-2687.2907700,25.8442000,356.8584000,0.0000000,90.0000000); //
  176. Object[93] = CreateObject(3707,3357.6616200,-2592.7539100,20.4922000,0.0000000,0.0000000,0.0000000); //
  177. Object[94] = CreateObject(3707,3358.6272000,-2565.9511700,20.4922000,0.0000000,0.0000000,2.0000000); //
  178. Object[95] = CreateObject(3707,3357.3938000,-2488.9873000,4.8878000,-180.0000000,0.0000000,0.0000000); //
  179. Object[96] = CreateObject(3707,3357.8801300,-2574.7795400,4.8878400,-180.0000000,0.0000000,0.0000000); //
  180. Object[97] = CreateObject(3707,3357.3754900,-2488.9792500,20.4922000,0.0000000,0.0000000,0.0000000); //
  181. Object[98] = CreateObject(3707,3387.6225600,-2428.7785600,20.4922000,0.0000000,0.0000000,-45.7200000); //
  182. Object[99] = CreateObject(3707,3437.1232900,-2380.5583500,20.4922000,0.0000000,0.0000000,-45.7200000); //
  183. Object[100] = CreateObject(3707,3477.5385700,-2341.1604000,20.4922000,0.0000000,0.0000000,-45.7200000); //
  184. Object[101] = CreateObject(3707,3544.9582500,-2314.7011700,20.4922000,0.0000000,0.0000000,-91.6200500); //
  185. Object[102] = CreateObject(3707,3614.2402300,-2316.5534700,20.4922000,0.0000000,0.0000000,-91.6200500); //
  186. Object[103] = CreateObject(3707,3683.7858900,-2318.8642600,20.4922000,0.0000000,0.0000000,-91.6200500); //
  187. Object[104] = CreateObject(3707,3753.0573700,-2320.8356900,20.4922000,0.0000000,0.0000000,-91.6200500); //
  188. Object[105] = CreateObject(3707,3822.3562000,-2322.9558100,20.4922000,0.0000000,0.0000000,-91.6200500); //
  189. Object[106] = CreateObject(3707,3829.8330100,-2349.4533700,20.4922000,0.0000000,0.0000000,0.0000000); //
  190. Object[107] = CreateObject(3707,3876.4514200,-2367.3608400,20.2438100,0.0000000,0.0000000,-90.0000000); //
  191. Object[108] = CreateObject(3707,3925.3911100,-2413.4064900,20.1695600,0.0000000,0.0000000,0.0000000); //
  192. Object[109] = CreateObject(3707,3925.3820800,-2482.6826200,20.1628200,0.0000000,0.0000000,0.0000000); //
  193. Object[110] = CreateObject(3707,3925.2959000,-2551.8068800,20.0767300,0.0000000,0.0000000,0.0000000); //
  194. Object[111] = CreateObject(3707,3877.1342800,-2601.4204100,20.4922000,0.0000000,0.0000000,-90.0000000); //
  195. Object[112] = CreateObject(3707,3826.8002900,-2636.5708000,20.4922000,0.0000000,0.0000000,-90.0000000); //
  196. Object[113] = CreateObject(3621,3453.9365200,-2695.1738300,25.8441800,356.8584000,0.0000000,3.1416000); //
  197. Object[114] = CreateObject(3623,3529.6022900,-2546.2253400,17.0703000,0.0000000,0.0000000,-90.3984000); //
  198. Object[115] = CreateObject(3623,3554.1171900,-2517.9404300,16.4453000,0.0000000,0.0000000,-90.0000000); //
  199. Object[116] = CreateObject(3707,3684.4741200,-2586.6044900,19.9766000,0.0000000,0.0000000,0.0000000); //
  200. Object[117] = CreateObject(3707,3684.4741200,-2586.6044900,4.7547900,180.0000000,0.0000000,0.0000000); //
  201. Object[118] = CreateObject(3865,3374.3928200,-2654.2736800,15.5797700,90.3600100,-533.9401900,0.0000000); //
  202. Object[119] = CreateObject(3865,3372.8686500,-2672.1044900,15.5797700,90.3600100,-533.9401900,0.0000000); //
  203. Object[120] = CreateObject(3865,3372.8686500,-2672.1044900,24.3796000,90.3600000,90.0000000,0.0000000); //
  204. Object[121] = CreateObject(3865,3374.3906300,-2654.0886200,24.3796000,90.3600000,90.0000000,0.0000000); //
  205. Object[122] = CreateObject(3865,3374.4804700,-2651.3752400,15.5797700,90.3600100,-533.9401900,0.0000000); //
  206. Object[123] = CreateObject(3865,3374.3403300,-2651.5703100,24.3796000,90.3600000,90.0000000,0.0000000); //
  207. Object[124] = CreateObject(3865,3372.9140600,-2669.9856000,15.5797700,90.3600100,-533.9401900,0.0000000); //
  208. Object[125] = CreateObject(3865,3373.1167000,-2669.9975600,24.3796000,90.3600000,90.0000000,0.0000000); //
  209. Object[126] = CreateObject(3707,3829.4118700,-2404.3139600,20.4922000,0.0000000,0.0000000,0.0000000); //
  210. Object[127] = CreateObject(3707,3828.8420400,-2508.4384800,20.4922000,0.0000000,0.0000000,0.0000000); //
  211. Object[128] = CreateObject(3707,3877.0756800,-2591.9287100,20.1335700,0.0000000,0.0000000,-90.0000000); //
  212. Object[129] = CreateObject(8661,3689.3894000,-2575.1833500,12.6523000,0.0000000,0.0000000,0.0000000); //
  213. Object[130] = CreateObject(3621,3761.0915500,-2622.0210000,14.8537400,0.0000000,0.0000000,-6.3000100); //
  214. Object[131] = CreateObject(3621,3761.0915500,-2622.0210000,22.0635400,0.0000000,0.0000000,-6.3000100); //
  215. Object[132] = CreateObject(8661,3729.1904300,-2595.6767600,12.6523000,0.0000000,0.0000000,0.0000000); //
  216. Object[133] = CreateObject(8661,3689.3623000,-2595.0466300,12.6523000,0.0000000,0.0000000,0.0000000); //
  217. Object[134] = CreateObject(8661,3689.3354500,-2614.9270000,12.6523000,0.0000000,0.0000000,0.0000000); //
  218. Object[135] = CreateObject(8661,3729.2087400,-2615.0554200,12.6523000,0.0000000,0.0000000,0.0000000); //
  219. Object[136] = CreateObject(3630,3727.3166500,-2612.1577100,14.0611000,0.0000000,0.0000000,-2.8200000); //
  220. Object[137] = CreateObject(3796,3703.3913600,-2602.4458000,12.6405700,0.0000000,0.0000000,-180.4197100); //
  221. Object[138] = CreateObject(5262,3763.9653300,-2595.8974600,15.2510500,0.0000000,0.0000000,0.0000000); //
  222. Object[139] = CreateObject(5259,3749.1171900,-2605.0444300,14.2753400,0.0000000,0.0000000,0.0000000); //
  223. Object[140] = CreateObject(5261,3764.7360800,-2603.9108900,12.5629000,0.0000000,0.0000000,-180.0000000); //
  224. Object[141] = CreateObject(11461,3713.7309600,-2588.7233900,9.8622800,0.0000000,0.0000000,0.0000000); //
  225. Object[142] = CreateObject(3006,3726.0210000,-2594.3715800,12.3416400,0.0000000,0.0000000,0.0000000); //
  226. Object[143] = CreateObject(3006,3727.5642100,-2594.4292000,12.3576900,0.0000000,0.0000000,0.0000000); //
  227. Object[144] = CreateObject(3006,3727.4433600,-2595.4802200,12.3576900,0.0000000,0.0000000,0.0000000); //
  228. Object[145] = CreateObject(3006,3726.0971700,-2595.6467300,12.3576900,0.0000000,0.0000000,0.0000000); //
  229. Object[146] = CreateObject(3257,3713.6247600,-2611.8178700,12.6394000,0.0000000,0.0000000,87.3597900); //
  230. Object[147] = CreateObject(2991,3721.8820800,-2601.1171900,13.2067800,0.0000000,0.0000000,0.0000000); //
  231. Object[148] = CreateObject(2991,3721.8820800,-2601.1171900,14.4329200,0.0000000,0.0000000,0.0000000); //
  232. Object[149] = CreateObject(2991,3721.8820800,-2601.1171900,15.6723500,0.0000000,0.0000000,0.0000000); //
  233. Object[150] = CreateObject(2991,3721.8820800,-2601.1171900,16.8695400,0.0000000,0.0000000,0.0000000); //
  234. Object[151] = CreateObject(5261,3786.9660600,-2617.7946800,14.2583700,0.0000000,0.0000000,-184.6200100); //
  235. Object[152] = CreateObject(5261,3787.1779800,-2615.1821300,14.6689100,0.0000000,0.0000000,-184.6200100); //
  236. Object[153] = CreateObject(5261,3792.1010700,-2609.3178700,14.7218000,0.0000000,0.0000000,-91.9800200); //
  237. Object[154] = CreateObject(5261,3780.1308600,-2589.9606900,16.1400000,0.0000000,0.0000000,2.9999800); //
  238. Object[155] = CreateObject(8558,3783.3313000,-2607.3664600,18.4411900,0.0000000,0.0000000,90.0000000); //
  239. Object[156] = CreateObject(14410,3778.9106400,-2603.5273400,16.7686300,0.0000000,0.0000000,-90.0000400); //
  240. Object[157] = CreateObject(1636,3789.1550300,-2610.8840300,20.4355000,-98.8800000,15.6000000,0.0000000); //
  241. Object[158] = CreateObject(5261,3768.8933100,-2614.3933100,12.5628600,0.0000000,0.0000000,-267.1199300); //
  242. Object[159] = CreateObject(14410,3770.3305700,-2603.5219700,10.8517100,0.0000000,0.0000000,-90.0000400); //
  243. Object[160] = CreateObject(3621,3522.4021000,-2626.2104500,17.9774600,356.8584000,0.0000000,90.0000000); //
  244. Object[161] = CreateObject(3621,3521.9650900,-2626.2299800,25.6183800,356.8584000,0.0000000,90.0000000); //
  245. Object[162] = CreateObject(967,3747.8383800,-2581.8996600,12.4858700,0.0000000,0.0000000,-178.3799900); //
  246. Object[163] = CreateObject(3798,3762.7580600,-2570.7263200,12.6645400,0.0000000,0.0000000,0.0000000); //
  247. Object[164] = CreateObject(3798,3760.7268100,-2570.6901900,12.6645400,0.0000000,0.0000000,0.0000000); //
  248. Object[165] = CreateObject(3798,3762.0144000,-2571.8366700,14.6420500,0.0000000,0.0000000,0.0000000); //
  249. Object[166] = CreateObject(3798,3760.7368200,-2572.6779800,12.6645400,0.0000000,0.0000000,0.0000000); //
  250. Object[167] = CreateObject(3798,3762.7592800,-2572.8149400,12.6645400,0.0000000,0.0000000,0.0000000); //
  251. Object[168] = CreateObject(5145,3751.0368700,-2656.4704600,2.1949000,0.0000000,0.0000000,-268.7996500); //
  252. Object[169] = CreateObject(7040,3835.5041500,-2577.8193400,15.9503000,0.0000000,0.0000000,0.0000000); //
  253. Object[170] = CreateObject(3574,3789.2011700,-2520.5175800,15.2188000,0.0000000,0.0000000,0.0000000); //
  254. Object[171] = CreateObject(3574,3879.4736300,-2411.9350600,15.2188000,0.0000000,0.0000000,0.0000000); //
  255. Object[172] = CreateObject(3577,3878.7360800,-2428.6296400,13.1169200,0.0000000,0.0000000,0.0000000); //
  256. Object[173] = CreateObject(3575,3861.9069800,-2428.7522000,15.2188000,0.0000000,0.0000000,0.0000000); //
  257.  
  258. AddStaticVehicle(521,3384.4421000,-2667.1631000,12.9390000,-88.8600000,-1,-1); //FCR-900
  259. AddStaticVehicle(521,3380.8887000,-2667.1934000,12.9390000,-88.8600000,-1,-1); //FCR-900
  260. AddStaticVehicle(521,3377.0190000,-2667.1653000,12.9390000,-88.8600000,-1,-1); //FCR-900
  261. AddStaticVehicle(521,3388.0735000,-2667.1216000,12.9390000,-88.8600000,-1,-1); //FCR-900
  262. AddStaticVehicle(521,3387.9580000,-2665.9985000,12.9390000,-88.8600000,-1,-1); //FCR-900
  263. AddStaticVehicle(521,3387.9636000,-2664.8870000,12.9390000,-88.8600000,-1,-1); //FCR-900
  264. AddStaticVehicle(521,3387.8591000,-2663.7292000,12.9390000,-88.8600000,-1,-1); //FCR-900
  265. AddStaticVehicle(521,3387.6470000,-2662.6677000,12.9390000,-88.8600000,-1,-1); //FCR-900
  266. AddStaticVehicle(521,3387.5952000,-2661.6235000,12.9390000,-88.8600000,-1,-1); //FCR-900
  267. AddStaticVehicle(521,3387.4578000,-2660.6016000,12.9390000,-88.8600000,-1,-1); //FCR-900
  268. AddStaticVehicle(521,3387.1477000,-2659.3499000,12.9390000,-88.8600000,-1,-1); //FCR-900
  269. AddStaticVehicle(521,3384.3320000,-2666.0806000,12.9390000,-88.8600000,-1,-1); //FCR-900
  270. AddStaticVehicle(521,3384.4746000,-2665.0103000,12.9390000,-88.8600000,-1,-1); //FCR-900
  271. AddStaticVehicle(521,3384.1409000,-2663.7778000,12.9390000,-88.8600000,-1,-1); //FCR-900
  272. AddStaticVehicle(521,3383.9541000,-2662.6118000,12.9390000,-88.8600000,-1,-1); //FCR-900
  273. AddStaticVehicle(521,3383.5896000,-2661.4126000,12.9390000,-88.8600000,-1,-1); //FCR-900
  274. AddStaticVehicle(521,3383.3999000,-2660.3921000,12.9390000,-88.8600000,-1,-1); //FCR-900
  275. AddStaticVehicle(521,3383.2559000,-2659.1563000,12.9390000,-88.8600000,-1,-1); //FCR-900
  276. AddStaticVehicle(521,3380.8193000,-2666.2534000,12.9390000,-88.8600000,-1,-1); //FCR-900
  277. AddStaticVehicle(521,3380.7866000,-2665.1565000,12.9390000,-88.8600000,-1,-1); //FCR-900
  278. AddStaticVehicle(521,3380.4890000,-2663.9587000,12.9390000,-88.8600000,-1,-1); //FCR-900
  279. AddStaticVehicle(521,3380.5178000,-2662.5906000,12.9390000,-88.8600000,-1,-1); //FCR-900
  280. AddStaticVehicle(521,3380.2295000,-2661.4363000,12.9390000,-88.8600000,-1,-1); //FCR-900
  281. AddStaticVehicle(521,3379.8689000,-2660.2446000,12.9390000,-88.8600000,-1,-1); //FCR-900
  282. AddStaticVehicle(521,3379.5884000,-2658.9697000,12.9390000,-88.8600000,-1,-1); //FCR-900
  283. AddStaticVehicle(521,3375.9045000,-2658.9192000,12.9390000,-88.8600000,-1,-1); //FCR-900
  284. AddStaticVehicle(521,3375.6599000,-2660.2383000,12.9390000,-88.8600000,-1,-1); //FCR-900
  285. AddStaticVehicle(521,3375.8569000,-2661.5154000,12.9390000,-88.8600000,-1,-1); //FCR-900
  286. AddStaticVehicle(521,3375.9841000,-2662.6531000,12.9390000,-88.8600000,-1,-1); //FCR-900
  287. AddStaticVehicle(521,3375.8110000,-2664.1116000,12.9390000,-88.8600000,-1,-1); //FCR-900
  288. AddStaticVehicle(521,3375.8628000,-2665.3958000,12.9390000,-88.8600000,-1,-1); //FCR-900
  289. AddStaticVehicle(521,3376.6118000,-2666.3276000,12.9390000,-88.8600000,-1,-1); //FCR-900
  290. AddStaticVehicle(476,3355.7896000,-2663.7864000,14.1494000,-88.5600000,-1,-1); //Rustler
  291. AddStaticVehicle(470,3865.6577000,-2539.2683000,13.1038000,89.4000000,-1,-1); //Patriot
  292. AddStaticVehicle(470,3865.7749000,-2534.1084000,13.1038000,91.3800000,-1,-1); //Patriot
  293. AddStaticVehicle(470,3865.7607000,-2529.2161000,13.1038000,91.3800000,-1,-1); //Patriot
  294. AddStaticVehicle(470,3866.0300000,-2523.8647000,13.1038000,91.3800000,-1,-1); //Patriot
  295. AddStaticVehicle(470,3866.1494000,-2518.7874000,13.1038000,91.3800000,-1,-1); //Patriot
  296. AddStaticVehicle(470,3866.3347000,-2513.2944000,13.1038000,91.3800000,-1,-1); //Patriot
  297. AddStaticVehicle(470,3866.5093000,-2508.2632000,13.1038000,91.3800000,-1,-1); //Patriot
  298. AddStaticVehicle(470,3867.0020000,-2502.3264000,13.1038000,91.3800000,-1,-1); //Patriot
  299. AddStaticVehicle(470,3867.0796000,-2496.3232000,13.1038000,91.3800000,-1,-1); //Patriot
  300. AddStaticVehicle(470,3867.8086000,-2489.9839000,13.1038000,91.3800000,-1,-1); //Patriot
  301. AddStaticVehicle(470,3868.0986000,-2483.7104000,13.1038000,91.3800000,-1,-1); //Patriot
  302. AddStaticVehicle(470,3868.9934000,-2476.6555000,13.1038000,91.3800000,-1,-1); //Patriot
  303. }
  304. #endif
  305.  
  306.  
  307. //==============================================================================
  308. // Basic vars
  309. //==============================================================================
  310.  
  311. new bool:MissionStarted;
  312. new bool:ObjectiveStarted;
  313. new bool:MissionCancelled;
  314.  
  315. new bool:ObjectivePlaced;
  316.  
  317. native IsValidVehicle(vehicleid);
  318.  
  319. enum obj
  320. {
  321. ObjectiveName[30],
  322. BeingPlaced,
  323. ObjectiveTimer,
  324. ProgressTimer,
  325. ProgressCount,
  326. Count
  327. };
  328.  
  329. enum teamdata
  330. {
  331. Name[32],
  332. Members,
  333. Kills
  334. };
  335.  
  336. enum playerdata
  337. {
  338. UserName[MAX_PLAYER_NAME],
  339. bool:TeamChosen,
  340. TeamSelection,
  341. PlayerClassID
  342. };
  343.  
  344. new Team[2][teamdata];
  345. new PlayerMissionInfo[MAX_PLAYERS][playerdata];
  346. new ObjectiveInfo[obj];
  347.  
  348. new MaxExplosions;
  349. new FlashTimer;
  350.  
  351. //==============================================================================
  352. // Basic script
  353. //==============================================================================
  354.  
  355. main()
  356. {
  357. print("----------------------------------");
  358. print(" Mission: "MISSION_NAME" started.");
  359. print("----------------------------------\n");
  360. }
  361.  
  362. public OnGameModeInit()
  363. {
  364. MissionStarted= true;
  365. format(Team[TEAM_DEFEND][Name],32,"%s",TEAM_DEFEND_NAME);
  366. format(Team[TEAM_ATTACK][Name],32,"%s",TEAM_ATTACK_NAME);
  367.  
  368. format(ObjectiveInfo[ObjectiveName],sizeof(ObjectiveInfo[ObjectiveName]),"%s",OBJ_NAME);
  369.  
  370. CallRemoteFunction("CreateBombingTD","d",PLACING_TIME*10);
  371.  
  372. MaxExplosions= sizeof(ExplosionsInfo);
  373. ObjectivePlaced= false;
  374. ObjectiveInfo[BeingPlaced]=-1;
  375.  
  376. #if MAX_MAP_OBJECTS != 0
  377. CreateMap();
  378. #endif
  379.  
  380. for(new i=0; i<sizeof(SkinData); i++)
  381. {
  382. AddPlayerClassEx(SkinData[i][TeamID],SkinData[i][SkinID],SkinData[i][SpawnX],SkinData[i][SpawnY],SkinData[i][SpawnZ],SkinData[i][SpawnAngle],0,0,0,0,0,0);
  383. }
  384.  
  385. for(new i=0; i<MAX_PLAYERS; i++) PlayerMissionInfo[i][TeamSelection]= NO_TEAM;
  386.  
  387. for(new i=0; i<MAX_VEHICLES; i++) if(IsValidVehicle(i)) SetVehicleHealth(i,VEHICLE_HEALTH);
  388.  
  389. if(CallRemoteFunction("GetCurrentMissionCJWalk","")) UsePlayerPedAnims();
  390. SetTimer("StartMissionFunc",3000,false);
  391. return 1;
  392. }
  393.  
  394. FUNCTION StartMissionFunc()
  395. {
  396. CallRemoteFunction("StartMission","");
  397. ObjectiveStarted= true;
  398. return 1;
  399. }
  400.  
  401. public OnGameModeExit()
  402. {
  403. #if MAX_MAP_OBJECTS != 0
  404. for(new i=0;i<MAX_MAP_OBJECTS;i++) DestroyObject(Object[i]);
  405. #endif
  406. for(new i=0; i<MAX_VEHICLES; i++)
  407. {
  408. DestroyVehicle(i);
  409. }
  410. return 1;
  411. }
  412.  
  413. public OnPlayerDisconnect(playerid)
  414. {
  415. if(PlayerMissionInfo[playerid][TeamChosen])
  416. {
  417. Team[PlayerMissionInfo[playerid][TeamSelection]][Members] --;
  418. PlayerMissionInfo[playerid][TeamChosen]=false;
  419. }
  420. return 1;
  421. }
  422.  
  423. public OnPlayerRequestClass(playerid,classid)
  424. {
  425. SetPlayerPos(playerid,CLASS_POSTION);
  426. SetPlayerCameraPos(playerid,CLASS_CAMERA);
  427. SetPlayerCameraLookAt(playerid,CLASS_POSTION);
  428. SetPlayerFacingAngle(playerid,CLASS_FACING_AGNLE);
  429.  
  430. CallRemoteFunction("ShowClassSelection","iisiii",playerid, SkinData[classid][TeamID],Team[SkinData[classid][TeamID]][Name], SkinData[classid][Weapon1], SkinData[classid][Weapon2], SkinData[classid][Weapon3]);
  431.  
  432. if(PlayerMissionInfo[playerid][TeamChosen])
  433. {
  434. PlayerMissionInfo[playerid][TeamChosen] = false;
  435. Team[PlayerMissionInfo[playerid][TeamSelection]][Members]--;
  436. }
  437.  
  438. PlayerMissionInfo[playerid][TeamSelection] = SkinData[classid][TeamID];
  439. PlayerMissionInfo[playerid][PlayerClassID]=classid;
  440. return 1;
  441. }
  442.  
  443. public OnPlayerRequestSpawn(playerid)
  444. {
  445. new opp_team = (PlayerMissionInfo[playerid][TeamSelection] == 1)? 0:1;
  446. if(Team[PlayerMissionInfo[playerid][TeamSelection]][Members] > Team[opp_team][Members])
  447. {
  448. CallRemoteFunction("ShowInfoBox", "iisi", playerid, -1, "This Team is full, choose another!",0);
  449. return 0;
  450. }
  451. return 1;
  452. }
  453.  
  454.  
  455. public OnPlayerSpawn(playerid)
  456. {
  457. new string[124];
  458. CallRemoteFunction("UpdateAliveState","ii",playerid,1);
  459. if(CallRemoteFunction("GetSpectateStatus","d",playerid)) return CallRemoteFunction("SpecOffAdmin","d",playerid);
  460. if(CallRemoteFunction("GetJailedStatus","d",playerid)) CallRemoteFunction("SetJailed","d",playerid);
  461. else
  462. {
  463. SetPlayerPos(playerid,SkinData[PlayerMissionInfo[playerid][PlayerClassID]][SpawnX],SkinData[PlayerMissionInfo[playerid][PlayerClassID]][SpawnY],SkinData[PlayerMissionInfo[playerid][PlayerClassID]][SpawnZ]);
  464. SetPlayerInterior(playerid,SkinData[PlayerMissionInfo[playerid][PlayerClassID]][SpawnInterior]);
  465. SetPlayerFacingAngle(playerid,SkinData[PlayerMissionInfo[playerid][PlayerClassID]][SpawnAngle]);
  466. SetPlayerVirtualWorld(playerid,SkinData[PlayerMissionInfo[playerid][PlayerClassID]][VirtualWorld]);
  467. if(!PlayerMissionInfo[playerid][TeamChosen])
  468. {
  469. Team[PlayerMissionInfo[playerid][TeamSelection]][Members]++;
  470. PlayerMissionInfo[playerid][TeamChosen] = true;
  471. if(PlayerMissionInfo[playerid][TeamSelection] == TEAM_ATTACK)
  472. {
  473. format(string,sizeof(string),"You are a %s, your mission is to destroy the %s.",Team[TEAM_ATTACK][Name],ObjectiveInfo[ObjectiveName]);
  474. CallRemoteFunction("ShowInfoBox", "iisi", playerid, -1,string,2000);
  475. format(string,sizeof(string),"%s will try to stop you, eliminate them!.",Team[TEAM_DEFEND][Name]);
  476. CallRemoteFunction("ShowInfoBox", "iisi", playerid, -1, string,4000);
  477. format(string,sizeof(string),"Destroy the ~y~%s~w~!",ObjectiveInfo[ObjectiveName]);
  478. CallRemoteFunction("ShowInfoText", "iisi", playerid, -1, string,1000);
  479. }
  480. else
  481. {
  482. format(string,sizeof(string),"You are a %s, your mission is to protect the %s from %s.",Team[TEAM_DEFEND][Name],ObjectiveInfo[ObjectiveName],Team[TEAM_ATTACK][Name]);
  483. CallRemoteFunction("ShowInfoBox", "iisi", playerid, -1,string,2000);
  484. format(string,sizeof(string),"Protect the ~y~%s~w~!.",ObjectiveInfo[ObjectiveName]);
  485. CallRemoteFunction("ShowInfoText", "iisi", playerid, -1, string,1000);
  486. }
  487. }
  488. CallRemoteFunction("GivePlayerWeaponEx","ddd",playerid,SkinData[PlayerMissionInfo[playerid][PlayerClassID]][Weapon1],SkinData[PlayerMissionInfo[playerid][PlayerClassID]][Ammo1]);
  489. CallRemoteFunction("GivePlayerWeaponEx","ddd",playerid,SkinData[PlayerMissionInfo[playerid][PlayerClassID]][Weapon2],SkinData[PlayerMissionInfo[playerid][PlayerClassID]][Ammo2]);
  490. CallRemoteFunction("GivePlayerWeaponEx","ddd",playerid,SkinData[PlayerMissionInfo[playerid][PlayerClassID]][Weapon3],SkinData[PlayerMissionInfo[playerid][PlayerClassID]][Ammo3]);
  491. }
  492. SetPlayerTeam(playerid,PlayerMissionInfo[playerid][TeamSelection]);
  493. if(PlayerMissionInfo[playerid][TeamSelection] == TEAM_ATTACK) SetPlayerColor(playerid,COLOR_TEAM_ATTACK);
  494. else SetPlayerColor(playerid,COLOR_TEAM_DEFEND);
  495.  
  496. SetPlayerHealth(playerid,Health);
  497. #if SPAWN_PROTECTION == true
  498. CallRemoteFunction("SetSpawnProtection","df",playerid,Health);
  499. #endif
  500.  
  501. CallRemoteFunction("OnPlayerBombingData", "ii", playerid, 1);
  502.  
  503. SetPlayerCheckpoint(playerid,CP_POS,CP_SIZE);
  504. return 1;
  505. }
  506.  
  507. public OnPlayerDeath(playerid, killerid, reason)
  508. {
  509. new string[128];
  510. if(killerid != INVALID_PLAYER_ID)
  511. {
  512. SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
  513. Team[PlayerMissionInfo[killerid][TeamSelection]][Kills]++;
  514. }
  515. if(PlayerMissionInfo[playerid][TeamSelection] == TEAM_ATTACK)
  516. {
  517. if(!ObjectivePlaced && ObjectiveInfo[BeingPlaced] == playerid)
  518. {
  519. ObjectiveInfo[BeingPlaced]=-1;
  520. format(string,sizeof(string),"~y~%s ~w~has died while ~r~~h~planting~w~ the bomb.",PlayerMissionInfo[playerid][UserName]);
  521. CallRemoteFunction("ShowInfoText", "iisi", -1, playerid, string, 0);
  522. ObjectiveInfo[Count]=0;
  523. KillTimer(ObjectiveInfo[ObjectiveTimer]);
  524. ObjectiveInfo[ProgressCount]=0;
  525. KillTimer(ObjectiveInfo[ProgressTimer]);
  526. CallRemoteFunction("UpdateBombProgressBar", "d", 0);
  527. }
  528. }
  529. CallRemoteFunction("UpdateAliveState","ii",playerid,0);
  530. return 1;
  531. }
  532.  
  533. public OnPlayerEnterCheckpoint(playerid)
  534. {
  535. if(!MissionStarted || ObjectivePlaced) return 1;
  536. new string[128];
  537. if(PlayerMissionInfo[playerid][TeamSelection] == TEAM_ATTACK && !ObjectivePlaced)
  538. {
  539. if(ObjectiveInfo[BeingPlaced] != -1)
  540. {
  541. format(string,sizeof(string),"%s is already trying to place the bomb. Please wait!",PlayerMissionInfo[ObjectiveInfo[BeingPlaced]][UserName]);
  542. CallRemoteFunction("ShowInfoBox", "iisi", playerid, -1, string, 0);
  543. }
  544. else
  545. {
  546. ObjectiveInfo[BeingPlaced]=playerid;
  547. format(string,sizeof(string),"~y~%s~w~ is placing the bomb..!!",PlayerMissionInfo[playerid][UserName],playerid);
  548. CallRemoteFunction("ShowInfoText", "iisi", -1, playerid, string, 0);
  549. format(string,sizeof(string),"Wait in the checkpoint for %d seconds to place the bomb.",PLACING_TIME);
  550. CallRemoteFunction("ShowInfoBox", "iisi", playerid, -1, string, 0);
  551. ObjectiveInfo[Count]=0;
  552. ObjectiveInfo[ProgressCount]=0;
  553. CallRemoteFunction("UpdateBombProgressBar", "d", 0);
  554. ObjectiveInfo[ObjectiveTimer] = SetTimer("PlacingTimer",1000,true);
  555. ObjectiveInfo[ProgressTimer] = SetTimer("ProgressFillUP",100,true);
  556. }
  557. }
  558. else
  559. {
  560. if(ObjectiveInfo[BeingPlaced] != -1)
  561. {
  562. CallRemoteFunction("ShowInfoBox", "iisi", playerid, -1, "This is bomb placing sight, protect it.", 0);
  563. }
  564. else
  565. {
  566. format(string,sizeof(string),"%s is trying to place the bomb. Stop them!",PlayerMissionInfo[ObjectiveInfo[BeingPlaced]][UserName]);
  567. CallRemoteFunction("ShowInfoBox", "iisi", playerid, -1, string, 0);
  568. }
  569. }
  570. return 1;
  571. }
  572.  
  573. public OnPlayerLeaveCheckpoint(playerid)
  574. {
  575. if(!MissionStarted || ObjectivePlaced) return 1;
  576. new string[128];
  577. if(PlayerMissionInfo[playerid][TeamSelection] == TEAM_ATTACK && !ObjectivePlaced && ObjectiveInfo[BeingPlaced] == playerid)
  578. {
  579. ObjectiveInfo[BeingPlaced]=-1;
  580. format(string,sizeof(string),"~y~%s~w~ has left ~r~~h~planting~w~ the bomb.",PlayerMissionInfo[playerid][UserName],playerid);
  581. CallRemoteFunction("ShowInfoText", "iisi", -1, playerid, string, 0);
  582. ObjectiveInfo[Count]=0;
  583. KillTimer(ObjectiveInfo[ObjectiveTimer]);
  584. ObjectiveInfo[ProgressCount]=0;
  585. KillTimer(ObjectiveInfo[ProgressTimer]);
  586. CallRemoteFunction("UpdateBombProgressBar", "d", 0);
  587. }
  588. return 1;
  589. }
  590.  
  591. public OnVehicleSpawn(vehicleid)
  592. {
  593. SetVehicleHealth(vehicleid,VEHICLE_HEALTH);
  594. return 1;
  595. }
  596.  
  597. FUNCTION EndTheMission()
  598. {
  599. if(!MissionStarted) return 1;
  600. MissionStarted= false;
  601. if(!MissionCancelled)
  602. {
  603. new string[256];
  604. new amount= 10000;
  605. if(!ObjectivePlaced)
  606. {
  607. amount+=Team[TEAM_DEFEND][Kills]*100;
  608. format(string,sizeof(string),""SERVER_KEY_MSG" %s has won the mission, by successfully defending the %s. Reward: $%d",Team[TEAM_DEFEND][Name],ObjectiveInfo[ObjectiveName],amount);
  609. SendClientMessageToAll(COLOR_SERVER,string);
  610. CallRemoteFunction("IRC_SendMessage","ss",string,IRC_SERVER_COLOR);
  611. format(string,sizeof(string),""SERVER_KEY_MSG" You have received $%i because your team has won the mission!",amount);
  612. for(new i=0,j=GetPlayerPoolSize(); i <= j; i++)
  613. {
  614. if(!PlayerMissionInfo[i][TeamChosen]) continue;
  615. if(PlayerMissionInfo[i][TeamSelection] == TEAM_DEFEND)
  616. {
  617. PlayerPlaySound(i,3200,0,0,0);
  618. SendClientMessage(i,COLOR_TEAM_DEFEND,string);
  619. CallRemoteFunction("GivePlayerCash","ii",i,amount);
  620. CallRemoteFunction("PlayerMissionStats","dd",i,0);
  621. }
  622. if(PlayerMissionInfo[i][TeamSelection] != TEAM_DEFEND)
  623. {
  624. PlayerPlaySound(i,17004,0,0,0);
  625. GameTextForPlayer(i,"~R~MISSION FAILED~w~!",3000,3);
  626. CallRemoteFunction("PlayerMissionStats","dd",i,1);
  627. }
  628. }
  629. }
  630. else
  631. {
  632. amount+=Team[TEAM_ATTACK][Kills]*100;
  633. format(string,sizeof(string),""SERVER_KEY_MSG" %s (%d) placed the bomb to destroy %s's %s. %s's has won the mission. Reward: 1 Token.",PlayerMissionInfo[ObjectiveInfo[BeingPlaced]][UserName],ObjectiveInfo[BeingPlaced],Team[TEAM_DEFEND][Name],ObjectiveInfo[ObjectiveName]);
  634. SendClientMessageToAll(COLOR_SERVER,string);
  635. format(string,sizeof(string),""SERVER_KEY_MSG" %s have won the mission. Reward: $%d.",Team[TEAM_ATTACK][Name],amount);
  636. SendClientMessageToAll(COLOR_SERVER,string);
  637. CallRemoteFunction("IRC_SendMessage","ss",string,IRC_SERVER_COLOR);
  638. CallRemoteFunction("PlayerMissionStats","dd",ObjectiveInfo[BeingPlaced],8);
  639. CallRemoteFunction("GivePlayerToken","dd",ObjectiveInfo[BeingPlaced],1);
  640. format(string,sizeof(string),""SERVER_KEY_MSG" You have received $%i because your team has won the Team-Deathmatch!",amount);
  641. for(new i=0,j=GetPlayerPoolSize(); i <= j; i++)
  642. {
  643. if(!PlayerMissionInfo[i][TeamChosen]) continue;
  644. if(PlayerMissionInfo[i][TeamSelection] == TEAM_ATTACK)
  645. {
  646. PlayerPlaySound(i,3200,0,0,0);
  647. SendClientMessage(i,COLOR_TEAM_ATTACK,string);
  648. CallRemoteFunction("GivePlayerCash","ii",i,amount);
  649. CallRemoteFunction("PlayerMissionStats","dd",i,0);
  650. }
  651. if(PlayerMissionInfo[i][TeamSelection] != TEAM_ATTACK)
  652. {
  653. PlayerPlaySound(i,17004,0,0,0);
  654. GameTextForPlayer(i,"~R~MISSION FAILED~w~!",3000,3);
  655. CallRemoteFunction("PlayerMissionStats","dd",i,1);
  656. }
  657. }
  658. }
  659. }
  660. else
  661. {
  662. PlaySoundForAll(1058);
  663. SendClientMessageToAll(COLOR_SERVER,""SERVER_KEY_MSG" The mission has been cancelled.");
  664. CallRemoteFunction("IRC_SendMessage","ss",""SERVER_KEY_MSG" The mission has been cancelled.",IRC_SERVER_COLOR);
  665. CallRemoteFunction("ShowInfoBox", "iisi", -1, -1,"The mission has been cancelled.",0);
  666. GameTextForAll("~R~MISSION CANCELLED~w~!",3000,3);
  667. }
  668. return 1;
  669. }
  670.  
  671. //==============================================================================
  672. // Mission functions
  673. //==============================================================================
  674.  
  675. FUNCTION ProgressFillUP()
  676. {
  677. ObjectiveInfo[ProgressCount]++;
  678. CallRemoteFunction("UpdateBombProgressBar", "d", ObjectiveInfo[ProgressCount]);
  679. }
  680.  
  681. FUNCTION PlacingTimer()
  682. {
  683. if(!MissionStarted || ObjectivePlaced) return 1;
  684. if(ObjectiveInfo[BeingPlaced] == -1)
  685. {
  686. ObjectiveInfo[Count]=0;
  687. ObjectiveInfo[ProgressCount]=0;
  688. KillTimer(ObjectiveInfo[ObjectiveTimer]);
  689. KillTimer(ObjectiveInfo[ProgressTimer]);
  690. }
  691. ObjectiveInfo[Count]++;
  692. if(ObjectiveInfo[Count] == PLACING_TIME)
  693. {
  694. ObjectivePlaced=true;
  695. new string[128],id=ObjectiveInfo[BeingPlaced];
  696. format(string,sizeof(string),""SERVER_KEY_MSG" %s (%d) has successfully planted the bomb, 15 seconds before the bomb explodes.",PlayerMissionInfo[id][UserName],id);
  697. SendClientMessageToAll(COLOR_SERVER,string);
  698. SetTimerEx("Explosion",15000,false,"ii",0,5);
  699. KillTimer(ObjectiveInfo[ObjectiveTimer]);
  700. KillTimer(ObjectiveInfo[ProgressTimer]);
  701. FlashTimer= SetTimer("FlasBomb",500,true);
  702. CallRemoteFunction("FlashBombBar", "");
  703. CallRemoteFunction("UpdateBombInfo", "");
  704. CallRemoteFunction("KillGameModeTimer","");
  705. CallRemoteFunction("TD_Clock","s","_");
  706. DisableCheckpointForAll();
  707. }
  708. return 1;
  709. }
  710. FUNCTION FlasBomb()
  711. {
  712. CallRemoteFunction("FlashBombBar", "");
  713. return 1;
  714. }
  715.  
  716. FUNCTION Explosion(start, until)
  717. {
  718. for(new i = start; i < until; i++)
  719. {
  720. if(i >= MaxExplosions) break;
  721. CreateExplosion(ExplosionsInfo[i][0], ExplosionsInfo[i][1], ExplosionsInfo[i][2] , 7, 20.0);
  722. }
  723.  
  724. start += 5;
  725. until += 5;
  726.  
  727. if(until > MaxExplosions)
  728. {
  729. CallRemoteFunction("EndMission","");
  730. KillTimer(FlashTimer);
  731. }
  732. else
  733. {
  734. SetTimerEx("Explosion", 1000, false, "ii", start, until);
  735. }
  736. return 1;
  737. }
  738. DisableCheckpointForAll()
  739. {
  740. for(new i=0,j=GetPlayerPoolSize(); i <=j ; i++)
  741. {
  742. if(!IsPlayerConnected(i)) continue;
  743. DisablePlayerCheckpoint(i);
  744. }
  745. }
  746. PlaySoundForAll(sound)
  747. {
  748. for(new i=0,j=GetPlayerPoolSize(); i <=j ; i++)
  749. {
  750. if(IsPlayerConnected(i)) PlayerPlaySound(i,sound,0,0,0);
  751. }
  752. }
  753.  
  754. //==============================================================================
  755. // Important functions required
  756. //==============================================================================
  757.  
  758. FUNCTION OnPlayerNameRecieve(playerid,name[])
  759. {
  760. format(PlayerMissionInfo[playerid][UserName],MAX_PLAYER_NAME,"%s",name);
  761. return 1;
  762. }
  763.  
  764. FUNCTION CancelTheMission()
  765. {
  766. MissionCancelled= true;
  767. return 1;
  768. }
  769.  
  770. FUNCTION MissionObjectiveStarted() return ObjectiveStarted;
  771.  
  772. FUNCTION OnPlayerSpectateObjective(playerid)
  773. {
  774. SetPlayerCameraPos(playerid, CP_POS + 2.5);
  775. SetPlayerCameraLookAt(playerid, CP_POS);
  776. SetPlayerPos(playerid, CP_POS - 5);
  777.  
  778. SetPlayerColor(playerid, (PlayerMissionInfo[playerid][TeamSelection] == TEAM_ATTACK) ? COLOR_TEAM_ATTACK_INV : COLOR_TEAM_DEFEND_INV);
  779. return 1;
  780. }
Add Comment
Please, Sign In to add comment