Bulletje

Untitled

Jan 24th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.57 KB | None | 0 0
  1. /*
  2. Script by: Bullet
  3. Map by: MM
  4. Mission Base: Team Deathmatch
  5. Mission Type: Team Deathmatch
  6. Mission Type ID: 6
  7. */
  8. //==============================================================================
  9. // Includes
  10. //==============================================================================
  11. #include <a_samp>
  12. #include <crashdetect>
  13. #include <float>
  14. #include <fixes2>
  15.  
  16. #include "..\filterscripts\MM\stuff\defines"
  17. #include "..\filterscripts\MM\stuff\serverkeymsg"
  18.  
  19. //==============================================================================
  20. // Defines
  21. //==============================================================================
  22.  
  23. #define MISSION_NAME "Odd Little Town"
  24. #define Health 99.0
  25. #define TEAM_DEFEND_NAME "Farmers"
  26. #define TEAM_ATTACK_NAME "Groves"
  27. #define MAX_MAP_OBJECTS 70
  28. #define VEHICLE_HEALTH 0
  29. #define CLASS_POSTION 503.0191,-2854.5225,10.8612
  30. #define CLASS_CAMERA 501.6259,-2856.3896,10.8612
  31. #define CLASS_FACING_AGNLE 147.6429
  32. #define SINKING false
  33. #define SPAWN_PROTECTION true
  34.  
  35. //==============================================================================
  36. // Per mission functions
  37. //==============================================================================
  38.  
  39. enum ped_enum
  40. {
  41. TeamID,
  42. Skin,
  43. Float:SpawnX,
  44. Float:SpawnY,
  45. Float:SpawnZ,
  46. Float:SpawnAngle,
  47. SpawnInterior,
  48. VirtualWorld,
  49. Weapon1,
  50. Ammo1,
  51. Weapon2,
  52. Ammo2,
  53. Weapon3,
  54. Ammo3,
  55. };
  56.  
  57.  
  58. new PedInfo[][ped_enum] = {
  59. {TEAM_DEFEND, 159,524.6245,-2817.3066,8.3140,272.6659,0,0,WEAPON_DEAGLE,50,WEAPON_AK47,100,WEAPON_RIFLE,100},
  60. {TEAM_ATTACK, 106,496.3615,-2937.5986,3.5580,298.3361,0,0,WEAPON_DEAGLE,50,WEAPON_AK47,100,WEAPON_RIFLE,100}
  61.  
  62. };
  63.  
  64. #if SINKING == true
  65. new MapSkining[2];
  66. #endif
  67.  
  68. #if MAX_MAP_OBJECTS != 0
  69. new Object[MAX_MAP_OBJECTS];
  70.  
  71. CreateMap()
  72. {
  73. Object[0] = CreateObject(8417,551.1520400,-2846.1235400,2.0656900,0.0000000,180.4818300,0.0000000); //
  74. Object[1] = CreateObject(8417,551.1637600,-2886.0046400,2.0525100,0.0000000,180.4818300,0.0000000); //
  75. Object[2] = CreateObject(8417,510.0944500,-2886.0888700,2.3805800,0.0000000,180.4818300,0.0000000); //
  76. Object[3] = CreateObject(8417,509.8413100,-2846.1096200,2.4106100,0.0000000,180.4818300,0.0000000); //
  77. Object[4] = CreateObject(1684,557.8017000,-2844.1096200,3.5387100,0.0000000,0.0000000,-89.9999800); //
  78. Object[5] = CreateObject(1684,553.6347700,-2844.1171900,3.5498100,0.0000000,0.0000000,-89.9999800); //
  79. Object[6] = CreateObject(1684,549.4845000,-2844.1816400,3.5528000,0.0000000,0.0000000,-89.9999800); //
  80. Object[7] = CreateObject(1684,553.1867100,-2851.1914100,3.4518900,0.0000000,0.0000000,0.0000000); //
  81. Object[8] = CreateObject(1684,553.6315300,-2844.1777300,6.4805600,0.0000000,0.0000000,-89.9999800); //
  82. Object[9] = CreateObject(8417,551.1010700,-2925.8164100,2.0674100,0.0000000,180.4818300,0.0000000); //
  83. Object[10] = CreateObject(8417,509.7698100,-2925.7985800,2.4061900,0.0000000,180.4818300,0.0000000); //
  84. Object[11] = CreateObject(5711,505.4043000,-2918.1064500,5.6591300,0.0000000,0.0000000,89.9999800); //
  85. Object[12] = CreateObject(8591,503.8954200,-2857.8674300,8.3681100,0.0000000,0.0000000,0.0000600); //
  86. Object[13] = CreateObject(8675,557.6261000,-2921.0461400,10.8891600,0.0000000,0.0000000,-56.2500200); //
  87. Object[14] = CreateObject(16770,556.3837300,-2863.2605000,3.5263200,0.0000000,0.0000000,-89.9999800); //
  88. Object[15] = CreateObject(12959,527.6482500,-2818.1135300,2.2446200,0.0000000,0.8594400,0.0000000); //
  89. Object[16] = CreateObject(12943,558.4145500,-2886.6574700,1.9244800,0.0000000,0.0000000,-180.0000200); //
  90. Object[17] = CreateObject(3660,513.9243800,-2819.3928200,4.9409900,0.0000000,0.0000000,-89.9999800); //
  91. Object[18] = CreateObject(3660,523.5487700,-2810.7116700,4.9418700,0.0000000,0.0000000,-179.1405300); //
  92. Object[19] = CreateObject(3660,540.4578900,-2810.4350600,4.4875200,0.0000000,0.0000000,-179.1405300); //
  93. Object[20] = CreateObject(3660,549.1470900,-2818.0607900,4.4905700,0.0000000,0.0000000,-269.1405600); //
  94. Object[21] = CreateObject(3660,540.2949200,-2826.7082500,4.5133500,0.0000000,0.0000000,-179.1405300); //
  95. Object[22] = CreateObject(615,528.0319800,-2925.2717300,1.2105200,0.0000000,0.0000000,-101.2500100); //
  96. Object[23] = CreateObject(615,563.5445600,-2898.8212900,1.4312900,0.0000000,0.0000000,-157.4999700); //
  97. Object[24] = CreateObject(615,546.6186500,-2935.2080100,1.5380000,0.0000000,0.0000000,-225.0000200); //
  98. Object[25] = CreateObject(618,537.9965800,-2927.0610400,2.1694900,0.0000000,0.0000000,-33.7500200); //
  99. Object[26] = CreateObject(660,542.9467800,-2912.9489700,1.8626100,0.0000000,0.0000000,0.0000000); //
  100. Object[27] = CreateObject(669,531.0501100,-2913.1586900,2.0730700,0.0000000,0.0000000,-33.7500200); //
  101. Object[28] = CreateObject(669,521.3153100,-2938.9316400,2.3461500,0.0000000,0.0000000,-67.4999800); //
  102. Object[29] = CreateObject(689,527.8356900,-2889.3420400,1.0346500,0.0000000,0.0000000,-44.9999900); //
  103. Object[30] = CreateObject(691,567.5714700,-2856.8898900,1.4391400,0.0000000,0.0000000,-56.2500200); //
  104. Object[31] = CreateObject(703,497.1223800,-2896.1118200,2.6043200,0.0000000,0.0000000,-22.5000000); //
  105. Object[32] = CreateObject(706,522.8354500,-2839.0676300,1.6455400,0.0000000,0.0000000,0.0000000); //
  106. Object[33] = CreateObject(3187,514.4813200,-2893.6015600,6.2102500,0.0000000,0.0000000,0.0000000); //
  107. Object[34] = CreateObject(1684,558.0654900,-2832.2959000,3.5115000,0.0000000,0.0000000,-202.4999500); //
  108. Object[35] = CreateObject(11292,548.5015300,-2874.9104000,3.4029900,0.0000000,0.0000000,-89.9999800); //
  109. Object[36] = CreateObject(9339,558.7874100,-2826.1030300,2.6133600,0.0000000,0.0000000,-270.0000000); //
  110. Object[37] = CreateObject(9339,571.8043800,-2839.1154800,2.6228300,0.0000000,0.0000000,-360.0000300); //
  111. Object[38] = CreateObject(9339,571.8121900,-2865.1569800,2.6355700,0.0000000,0.0000000,-360.0000300); //
  112. Object[39] = CreateObject(9339,571.8235500,-2891.2299800,2.6223800,0.0000000,0.0000000,-360.0000300); //
  113. Object[40] = CreateObject(9339,571.8392900,-2917.0786100,2.6339000,0.0000000,0.0000000,-360.0000300); //
  114. Object[41] = CreateObject(9339,571.8184200,-2932.7824700,2.6351300,0.0000000,0.0000000,-360.0000300); //
  115. Object[42] = CreateObject(9339,558.8171400,-2945.6999500,2.6461200,0.0000000,0.0000000,-450.0000300); //
  116. Object[43] = CreateObject(9339,532.8727400,-2945.6789600,2.6472600,0.0000000,0.0000000,-450.0000300); //
  117. Object[44] = CreateObject(9339,506.7415200,-2945.6731000,2.6563200,0.0000000,0.0000000,-450.0000300); //
  118. Object[45] = CreateObject(5260,485.1346700,-2941.7810100,0.9533000,0.0000000,0.0000000,89.9999800); //
  119. Object[46] = CreateObject(5260,489.7026400,-2949.8002900,0.9703100,0.0000000,0.0000000,179.9999700); //
  120. Object[47] = CreateObject(5260,485.1255200,-2949.7695300,0.9907800,0.0000000,0.0000000,270.0000000); //
  121. Object[48] = CreateObject(9339,489.2563500,-2924.6716300,3.1101000,0.0000000,0.0000000,-540.0000000); //
  122. Object[49] = CreateObject(9339,489.3155800,-2898.7741700,3.0877500,0.0000000,0.0000000,-540.0000000); //
  123. Object[50] = CreateObject(9339,489.2992200,-2872.6040000,3.1154400,0.0000000,0.0000000,-540.0000000); //
  124. Object[51] = CreateObject(9339,489.2677900,-2846.3230000,3.2713300,0.0000000,0.0000000,-540.0000000); //
  125. Object[52] = CreateObject(9339,489.2816500,-2839.1359900,3.2687000,0.0000000,0.0000000,-540.0000000); //
  126. Object[53] = CreateObject(9339,502.2388600,-2826.1906700,3.2587200,0.0000000,0.0000000,-629.9999400); //
  127. Object[54] = CreateObject(615,559.4965200,-2875.5527300,1.3903300,0.0000000,0.0000000,-157.4999700); //
  128. Object[55] = CreateObject(615,546.9201000,-2830.5974100,1.8341800,0.0000000,0.0000000,-247.5000000); //
  129. Object[56] = CreateObject(615,568.2676400,-2940.4843800,1.6559400,0.0000000,0.0000000,-292.5000000); //
  130. Object[57] = CreateObject(615,509.3282200,-2933.5139200,-0.4822000,0.0000000,0.0000000,-168.7500000); //
  131. Object[58] = CreateObject(1684,529.0905200,-2863.6396500,3.8026700,0.0000000,0.0000000,-180.0000200); //
  132. Object[59] = CreateObject(1684,530.8297100,-2873.6135300,3.7274400,0.0000000,0.0000000,-134.9999700); //
  133. Object[60] = CreateObject(1684,540.0202000,-2858.2773400,3.7382500,0.0000000,0.0000000,-202.5000200); //
  134. Object[61] = CreateObject(1684,529.0515100,-2863.5859400,6.7584300,0.0000000,0.0000000,-180.0000200); //
  135. Object[62] = CreateObject(1684,518.3396600,-2871.3501000,3.8401800,0.0000000,0.0000000,-247.5000000); //
  136. Object[63] = CreateObject(1684,521.9143700,-2855.0500500,3.7630200,0.0000000,0.0000000,-146.2499400); //
  137. Object[64] = CreateObject(3361,499.7529000,-2907.1606400,4.5609700,0.0000000,0.0000000,89.9999800); //
  138. Object[65] = CreateObject(3361,503.9980500,-2910.6862800,8.5483500,0.0000000,0.0000000,179.9999700); //
  139. Object[66] = CreateObject(3361,507.9319800,-2914.3686500,8.5379600,0.0000000,0.0000000,270.0000000); //
  140. Object[67] = CreateObject(3361,495.6740100,-2874.6877400,4.7034600,0.0000000,0.0000000,270.0000000); //
  141. Object[68] = CreateObject(3361,495.6679700,-2868.6972700,8.6919400,0.0000000,0.0000000,270.0000000); //
  142. Object[69] = CreateObject(615,536.6812100,-2844.2155800,2.0202800,0.0000000,0.0000000,-236.2500300); //
  143. }
  144. #endif
  145.  
  146. //==============================================================================
  147. // Basic vars
  148. //==============================================================================
  149.  
  150. new bool:MissionStarted;
  151. new bool:ObjectiveStarted;
  152. new bool:MissionCancelled;
  153.  
  154. native IsValidVehicle(vehicleid);
  155.  
  156. enum teamdata
  157. {
  158. Kills,
  159. Name[32],
  160. Members
  161. };
  162.  
  163. enum playerdata
  164. {
  165. UserName[MAX_PLAYER_NAME],
  166. bool:Counted,
  167. TeamSelection,
  168. PlayerClassID
  169. };
  170.  
  171. new Team[2][teamdata];
  172. new PlayerMissionInfo[MAX_PLAYERS][playerdata];
  173.  
  174. //==============================================================================
  175. // Basic script
  176. //==============================================================================
  177.  
  178. main()
  179. {
  180. print("----------------------------------");
  181. print(" Mission: "MISSION_NAME" started.");
  182. print("----------------------------------\n");
  183. }
  184.  
  185. public OnGameModeInit()
  186. {
  187. MissionStarted= true;
  188.  
  189. format(Team[TEAM_DEFEND][Name],32,"%s",TEAM_DEFEND_NAME);
  190. format(Team[TEAM_ATTACK][Name],32,"%s",TEAM_ATTACK_NAME);
  191.  
  192. if(CallRemoteFunction("GetCurrentMissionCJWalk","")) UsePlayerPedAnims();
  193.  
  194. #if MAX_MAP_OBJECTS != 0
  195. CreateMap();
  196. #endif
  197.  
  198. for(new i=0; i<sizeof(PedInfo); i++)AddPlayerClassEx(PedInfo[i][TeamID],PedInfo[i][Skin],PedInfo[i][SpawnX],PedInfo[i][SpawnY],PedInfo[i][SpawnZ],PedInfo[i][SpawnAngle],0,0,0,0,0,0);
  199.  
  200. #if SINKING == true
  201. MapSkining[0] = SetTimer("SinkMap", 80*1000, false);
  202. #endif
  203.  
  204. for(new i=0; i<MAX_VEHICLES; i++) if(IsValidVehicle(i)) SetVehicleHealth(i,VEHICLE_HEALTH);
  205. for(new i=0; i<MAX_PLAYERS; i++) PlayerMissionInfo[i][TeamSelection]= NO_TEAM;
  206.  
  207. SetTimer("StartMissionFunc",3000,false);
  208. return 1;
  209. }
  210.  
  211. FUNCTION StartMissionFunc()
  212. {
  213. CallRemoteFunction("StartMission","");
  214. ObjectiveStarted= true;
  215. return 1;
  216. }
  217.  
  218. public OnGameModeExit()
  219. {
  220. #if MAX_MAP_OBJECTS != 0
  221. for(new i=0;i<MAX_MAP_OBJECTS;i++) DestroyObject(Object[i]);
  222. #endif
  223. return 1;
  224. }
  225.  
  226. public OnPlayerDisconnect(playerid)
  227. {
  228. if(PlayerMissionInfo[playerid][TeamSelection] != NO_TEAM && PlayerMissionInfo[playerid][Counted])
  229. {
  230. Team[PlayerMissionInfo[playerid][TeamSelection]][Members] --;
  231. PlayerMissionInfo[playerid][Counted] = false;
  232. }
  233. return 1;
  234. }
  235.  
  236. public OnPlayerRequestClass(playerid,classid)
  237. {
  238. SetPlayerPos(playerid,CLASS_POSTION);
  239. SetPlayerCameraPos(playerid,CLASS_CAMERA);
  240. SetPlayerCameraLookAt(playerid,CLASS_POSTION);
  241. SetPlayerFacingAngle(playerid,CLASS_FACING_AGNLE);
  242.  
  243. CallRemoteFunction("TdmHide","i",playerid);
  244. CallRemoteFunction("ShowClassSelection","ddsddd",playerid, PedInfo[classid][TeamID],Team[PedInfo[classid][TeamID]][Name], PedInfo[classid][Weapon1], PedInfo[classid][Weapon2], PedInfo[classid][Weapon3]);
  245. if(PlayerMissionInfo[playerid][Counted] && PlayerMissionInfo[playerid][TeamSelection] != NO_TEAM)
  246. {
  247. Team[PlayerMissionInfo[playerid][TeamSelection]][Members]--;
  248. PlayerMissionInfo[playerid][Counted] = false;
  249. }
  250. PlayerMissionInfo[playerid][TeamSelection] = PedInfo[classid][TeamID];
  251. PlayerMissionInfo[playerid][PlayerClassID]=classid;
  252. return 1;
  253. }
  254.  
  255. public OnPlayerRequestSpawn(playerid)
  256. {
  257. new opp_team = (PlayerMissionInfo[playerid][TeamSelection] == 1)? 0:1;
  258. if(Team[PlayerMissionInfo[playerid][TeamSelection]][Members] > Team[opp_team][Members])
  259. {
  260. CallRemoteFunction("ShowInfoBox", "iisi", playerid, -1,"This Team is full, choose another!",0);
  261. return 0;
  262. }
  263. return 1;
  264. }
  265. public OnPlayerSpawn(playerid)
  266. {
  267. new string[124];
  268. CallRemoteFunction("UpdateAliveState","ii",playerid,1);
  269. CallRemoteFunction("TdmShow","i",playerid);
  270. CallRemoteFunction("TdmUpdate","sssdd","Kills",Team[TEAM_DEFEND][Name],Team[TEAM_ATTACK][Name],Team[TEAM_DEFEND][Kills],Team[TEAM_ATTACK][Kills]);
  271. SetPlayerHealth(playerid,Health);
  272. if(CallRemoteFunction("GetSpectateStatus","d",playerid)) return CallRemoteFunction("SpecOffAdmin","d",playerid);
  273. if(CallRemoteFunction("GetJailedStatus","d",playerid)) CallRemoteFunction("SetJailed","d",playerid);
  274. else
  275. {
  276. SetPlayerPos(playerid,PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][SpawnX],PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][SpawnY],PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][SpawnZ]);
  277. SetPlayerFacingAngle(playerid,PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][SpawnAngle]);
  278. SetPlayerInterior(playerid,PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][SpawnInterior]);
  279. SetPlayerVirtualWorld(playerid,PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][VirtualWorld]);
  280. CallRemoteFunction("GivePlayerWeaponEx","ddd",playerid,PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][Weapon1],PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][Ammo1]);
  281. CallRemoteFunction("GivePlayerWeaponEx","ddd",playerid,PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][Weapon2],PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][Ammo2]);
  282. CallRemoteFunction("GivePlayerWeaponEx","ddd",playerid,PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][Weapon3],PedInfo[PlayerMissionInfo[playerid][PlayerClassID]][Ammo3]);
  283. if(!PlayerMissionInfo[playerid][Counted])
  284. {
  285. Team[PlayerMissionInfo[playerid][TeamSelection]][Members]++;
  286. PlayerMissionInfo[playerid][Counted] = true;
  287. new opp_team = (PlayerMissionInfo[playerid][TeamSelection] == 1)? 0:1;
  288. format(string,sizeof(string),"You have chosen team %s, your mission is to kill %s.",Team[PlayerMissionInfo[playerid][TeamSelection]][Name],Team[opp_team][Name]);
  289. CallRemoteFunction("ShowInfoBox", "iisi", playerid, -1,string,0);
  290. format(string,sizeof(string),"~r~~h~Eliminate ~w~%s.",Team[opp_team][Name]);
  291. CallRemoteFunction("ShowInfoText", "iisi", playerid, -1,string,0);
  292. }
  293. }
  294. SetPlayerTeam(playerid,PlayerMissionInfo[playerid][TeamSelection]);
  295. if(PlayerMissionInfo[playerid][TeamSelection] == TEAM_ATTACK) SetPlayerColor(playerid,COLOR_TEAM_ATTACK);
  296. else SetPlayerColor(playerid,COLOR_TEAM_DEFEND);
  297. #if SPAWN_PROTECTION == true
  298. CallRemoteFunction("SetSpawnProtection","df",playerid,Health);
  299. #endif
  300. return 1;
  301. }
  302.  
  303. public OnPlayerDeath(playerid, killerid, reason)
  304. {
  305. if(killerid != INVALID_PLAYER_ID && PlayerMissionInfo[playerid][TeamSelection] != NO_TEAM && MissionStarted)
  306. {
  307. Team[PlayerMissionInfo[killerid][TeamSelection]][Kills]++;
  308. SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
  309. CallRemoteFunction("TdmUpdate","sssdd","Kills",Team[TEAM_DEFEND][Name],Team[TEAM_ATTACK][Name],Team[TEAM_DEFEND][Kills],Team[TEAM_ATTACK][Kills]);
  310. }
  311. CallRemoteFunction("UpdateAliveState","ii",playerid,0);
  312. return 1;
  313. }
  314.  
  315. public OnVehicleSpawn(vehicleid)
  316. {
  317. SetVehicleHealth(vehicleid,VEHICLE_HEALTH);
  318. return 1;
  319. }
  320.  
  321. FUNCTION EndTheMission()
  322. {
  323. if(!MissionStarted) return 1;
  324. MissionStarted= false;
  325. if(!MissionCancelled)
  326. {
  327. new string[256];
  328. new amount= 10000;
  329. new winning_team;
  330. if(Team[TEAM_DEFEND][Kills] == Team[TEAM_ATTACK][Kills]) { winning_team = 2; }
  331. else if(Team[TEAM_DEFEND][Kills] > Team[TEAM_ATTACK][Kills]) { winning_team = 0; }
  332. else { winning_team = 1; }
  333.  
  334. if(winning_team != 2)
  335. {
  336. amount =amount+(Team[winning_team][Kills]*100);
  337. format(string,sizeof(string),""SERVER_KEY_MSG" %s has won the team deathmatch! Reward: $%d",Team[winning_team][Name],amount);
  338. CallRemoteFunction("IRC_SendMessage","ss",string,IRC_SERVER_COLOR);
  339. SendClientMessageToAll(COLOR_SERVER,string);
  340. format(string,sizeof(string),""SERVER_KEY_MSG" You have received $%i because your team has won the team deathmatch!",amount);
  341. for(new i=0,j=GetPlayerPoolSize(); i <= j; i++)
  342. {
  343. if(PlayerMissionInfo[i][TeamSelection] == winning_team && PlayerMissionInfo[i][Counted])
  344. {
  345. PlayerPlaySound(i,3200,0,0,0);
  346. SendClientMessage(i,COLOR_SERVER,string);
  347. CallRemoteFunction("GivePlayerCash","ii",i,amount);
  348. CallRemoteFunction("PlayerMissionStats","dd",i,0);
  349. CallRemoteFunction("PlayerMissionStats","dd",i,6);
  350. }
  351. if(PlayerMissionInfo[i][TeamSelection] != winning_team && PlayerMissionInfo[i][Counted])
  352. {
  353. PlayerPlaySound(i,17004,0,0,0);
  354. GameTextForPlayer(i,"~R~MISSION FAILED~w~!",3000,3);
  355. CallRemoteFunction("PlayerMissionStats","dd",i,1);
  356. }
  357. }
  358. }
  359. else
  360. {
  361. PlaySoundForAll(1058);
  362. format(string,sizeof(string),""SERVER_KEY_MSG" IT'S A DRAW! No team has won the team-deathmatch.");
  363. SendClientMessageToAll(COLOR_SERVER,string);
  364. CallRemoteFunction("IRC_SendMessage","ss",string,IRC_SERVER_COLOR);
  365. for(new i=0,j=GetPlayerPoolSize(); i <= j; i++) if(IsPlayerConnected(i) && PlayerMissionInfo[i][Counted]) CallRemoteFunction("PlayerMissionStats","dd",i,2);
  366. }
  367. }
  368. else
  369. {
  370. PlaySoundForAll(1058);
  371. SendClientMessageToAll(COLOR_SERVER,""SERVER_KEY_MSG" The mission has been cancelled.");
  372. CallRemoteFunction("IRC_SendMessage","ss",""SERVER_KEY_MSG" The mission has been cancelled.",IRC_SERVER_COLOR);
  373. CallRemoteFunction("ShowInfoBox", "iisi", -1, -1,"The mission has been cancelled.",0);
  374. GameTextForAll("~R~MISSION CANCELLED~w~!",3000,3);
  375. }
  376. return 1;
  377. }
  378.  
  379. //==============================================================================
  380. // Mission functions
  381. //==============================================================================
  382.  
  383. #if SINKING == true
  384. FUNCTION SinkMap()
  385. {
  386. GameTextForAll("~r~the island is sinking!",4000,3);
  387. new Float:X, Float:Y, Float:Z;
  388. new Float:oldRotX, Float:oldRotY, Float:oldRotZ;
  389.  
  390. for(new i = 0; i < MAX_MAP_OBJECTS; i++) { GetObjectPos(Object[i], X, Y, Z), GetObjectRot(Object[i], oldRotX, oldRotY, oldRotZ); MoveObject(Object[i], X, Y, Z-40, 0.6, oldRotX, oldRotY, oldRotZ+0.05); }
  391. MapSkining[0] = SetTimer("ResurfaceMap", 150*1000,false);
  392. return true;
  393. }
  394.  
  395.  
  396. FUNCTION ResurfaceMap()
  397. {
  398. GameTextForAll("~g~the island is resurfacing!",4000,3);
  399. new Float:X, Float:Y, Float:Z;
  400. new Float:oldRotX, Float:oldRotY, Float:oldRotZ;
  401.  
  402. for(new i = 0; i < MAX_MAP_OBJECTS; i++) { GetObjectPos(Object[i], X, Y, Z), GetObjectRot(Object[i], oldRotX, oldRotY, oldRotZ); MoveObject(Object[i], X, Y, Z+40, 0.6, oldRotX, oldRotY, oldRotZ-0.05); }
  403. //MapSkining[1] = SetTimer("SinkMap", 80000,false);
  404. return true;
  405. }
  406. #endif
  407.  
  408. PlaySoundForAll(sound)
  409. {
  410. for (new i=0,j=GetPlayerPoolSize(); i <=j ; i++)
  411. {
  412. if(IsPlayerConnected(i)) PlayerPlaySound(i,sound,0,0,0);
  413. }
  414. }
  415.  
  416. //==============================================================================
  417. // Important functions required
  418. //==============================================================================
  419.  
  420. FUNCTION OnPlayerNameRecieve(playerid,name[])
  421. {
  422. format(PlayerMissionInfo[playerid][UserName],MAX_PLAYER_NAME,"%s",name);
  423. return 1;
  424. }
  425.  
  426.  
  427. FUNCTION CancelTheMission()
  428. {
  429. MissionCancelled= true;
  430. return 1;
  431. }
  432.  
  433. FUNCTION MissionObjectiveStarted() return ObjectiveStarted;
Advertisement
Add Comment
Please, Sign In to add comment