Advertisement
Guest User

testestestest

a guest
May 26th, 2015
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.63 KB | None | 0 0
  1.  
  2. // Created By [88] Murcielago - mgllgm@hotmail.com (Comments and/or job offers are welcome)
  3.  
  4. _DM_Max_Score = DM_Max_Score;
  5.  
  6. _DM_Winner = ObjNull;
  7.  
  8. _CurrentBestPlayer = "";
  9. _CurrentBestPlayerName = "";
  10.  
  11. _Array = [];
  12. _ID_Players = [];
  13.  
  14. _TimeLeft = GetMarkerPos "ServerTimeSec" Select 0;
  15. _TimeLeft_Text = "";
  16.  
  17. _AI_No = 0;
  18.  
  19. While {!DM_END} Do
  20. {
  21. _ID_Players = [];
  22. {
  23. If (IsPlayer _x) Then
  24. {
  25. _ID_Players = _ID_Players + [GetPlayerUID _x];
  26. };
  27. } ForEach (AllUnits+AllDeadMen);
  28.  
  29. _Array = [_ID_Players,[],{GetMarkerPos _x Select 0},"DESCEND"] Call BIS_fnc_sortBy;
  30. If (GetMarkerPos (_Array Select 0) Select 0 > 0) Then {_CurrentBestPlayer = _Array Select 0;};
  31.  
  32. If (MarkerText _CurrentBestPlayer != _CurrentBestPlayerName) Then
  33. {
  34. If (GetMarkerPos (_Array Select 0) Select 0 > 0) Then
  35. {
  36. _CurrentBestPlayerName = MarkerText _CurrentBestPlayer;
  37. Null = ['<t color="#D8D800">'+'<t size="0.75">'+Format ["%1",_CurrentBestPlayerName]+'<br/>'+"is the new best player!"+'</t>',0,0.75,5,2] Spawn Bis_fnc_dynamictext;
  38. PlaySound "Blip1";
  39. };
  40. };
  41.  
  42. _TimeLeft = GetMarkerPos "ServerTimeSec" Select 0;
  43. If (_TimeLeft > 59) Then {_TimeLeft_Text = STR(Round((GetMarkerPos "ServerTimeSec" Select 0)/60))+"min";} Else {_TimeLeft_Text = STR(Round(GetMarkerPos "ServerTimeSec" Select 0))+"s";};
  44.  
  45. _AI_No = Count AllUnits-(Count ([] Call BIS_fnc_listPlayers));
  46. If (_AI_No < 0) Then {_AI_No = 0;};
  47.  
  48. If (Ready_ON) Then
  49. {
  50. If (GetMarkerPos (_Array Select 0) Select 0 > 0) Then
  51. {
  52. HintSilent ComposeText [Parsetext Format["<t size='1.3' color='#D8D800'>BEST PLAYER:<br/>%1 (%2/%3)<br/><t size='1.0'>YOUR SCORE: %4/%3</t><br/><t size='1.0' color='#5a6666'>(Players: %5 | AI: %6 | Time: %7)</t>", MarkerText _CurrentBestPlayer, GetMarkerPos _CurrentBestPlayer Select 0, DM_Max_Score, GetMarkerPos (GetPlayerUID Player) Select 0, Count ([] Call BIS_fnc_listPlayers), _AI_No,_TimeLeft_Text]];
  53. }
  54. Else
  55. {
  56. HintSilent ComposeText [Parsetext Format["<t size='1.3' color='#D8D800'>BEST PLAYER:<br/>??? (0/%1)<br/><t size='1.0'>YOUR SCORE: %2/%1</t><br/><t size='1.0' color='#5a6666'>(Players: %3 | AI: %4 | Time: %5)</t>", DM_Max_Score, GetMarkerPos (GetPlayerUID Player) Select 0, Count ([] Call BIS_fnc_listPlayers), _AI_No,_TimeLeft_Text]];
  57. };
  58. }
  59. Else
  60. {
  61. HintSilent "";
  62. };
  63.  
  64. If (GetMarkerPos _CurrentBestPlayer Select 0 >= _DM_Max_Score) Then {DM_END = True;};
  65.  
  66. If (Damage DM_End_Obj > 0) Then {_DM_Max_Score = _DM_Max_Score - 1;};
  67.  
  68. Sleep 0.1;
  69. };
  70.  
  71. MissionEnd_Obj SetDamage 1;
  72.  
  73. Player RemoveAllEventHandlers "Killed";
  74.  
  75. Player SetCaptive True;
  76. (Vehicle Player ) EnableSimulation False;
  77. (Vehicle Player ) AllowDamage False;
  78.  
  79. {
  80. If (Name _x == _CurrentBestPlayerName) Then {_DM_Winner = _x;};
  81. } ForEach ([] Call BIS_fnc_listPlayers);
  82.  
  83. _DM_Winner AllowDamage False;
  84.  
  85. CloseDialog 0;
  86. Cam CameraEffect ["Terminate", "Back"];
  87. CamDestroy Cam;
  88.  
  89. Null = ['<t color="#D8D800">'+"FIN"+'</t>',0,0.35,1,1] Spawn Bis_fnc_dynamictext;
  90.  
  91. PlayMusic "Track05_Underwater2";
  92.  
  93. HintSilent "";
  94.  
  95. Sleep 3;
  96.  
  97. While {_DM_Winner Distance (GetMarkerPos "Respawn_West") < 100} Do
  98. {
  99. Sleep 0.1;
  100. };
  101.  
  102. HintSilent "";
  103. TitleRsc ["Black","PLAIN",0];
  104. CutRsc ["Black","PLAIN",0];
  105. TitleText ["","PLAIN",0];
  106.  
  107. _Cam = "Camera" CamCreate (GetPos Centre);
  108. _Cam CameraEffect ["External", "Back"];
  109.  
  110. _Angle = 0;
  111.  
  112. TitleCut ["","BLACK FADED"];
  113.  
  114. SetTerrainGrid 6.25;
  115.  
  116. If (GetMarkerPos _CurrentBestPlayer Select 0 < DM_Max_Score) Then
  117. {
  118. If (Damage DM_End_Obj > 0) Then
  119. {
  120. If (GetMarkerPos _CurrentBestPlayer Select 0 == 0) Then
  121. {
  122. SetViewDistance 1500;
  123. WaitUntil {PreloadCamera (Position Centre)};
  124. TitleCut ["","BLACK IN",7];
  125. _Angle = Getdir Centre;
  126. _Pos_x = (GetPos Centre select 0) + (100*Sin (_Angle));
  127. _Pos_y = (GetPos Centre select 1) + (100*Cos (_Angle));
  128. _Cam CamsetTarget Centre;
  129. _Cam CamSetPos [_Pos_x,_Pos_y,(GetPosATL Centre select 2) + 50];
  130. _Cam Camcommit 0;
  131. Sleep 2;
  132. Null = ['<t color="#D8D800">'+"DRAW!"+'</t>',0,0.50,999,2] Spawn Bis_Fnc_dynamictext;
  133. }
  134. Else
  135. {
  136. WaitUntil {PreloadCamera (Position _DM_Winner)};
  137. TitleCut ["","BLACK IN",7];
  138. _Angle = (Getdir _DM_Winner)+10;
  139. _Pos_x = (GetPos _DM_Winner select 0) + (2.0*Sin (_Angle));
  140. _Pos_y = (GetPos _DM_Winner select 1) + (2.0*Cos (_Angle));
  141. _Cam CamsetTarget _DM_Winner;
  142. _Cam CamSetPos [_Pos_x,_Pos_y,(GetPosATL _DM_Winner select 2) + 1.8];
  143. _Cam Camcommit 0;
  144. Sleep 2;
  145. Null = ['<t color="#D8D800">'+Format ["WINNER: %1",Name _DM_Winner]+'</t>',0,0.10,999,2] Spawn Bis_Fnc_dynamictext;
  146. };
  147. };
  148. }
  149. Else
  150. {
  151. WaitUntil {PreloadCamera (Position Grave)};
  152. TitleCut ["","BLACK IN",7];
  153. _Angle = (Getdir _DM_Winner);
  154. _Pos_x = (GetPos Grave select 0) + (0.5*Sin (_Angle));
  155. _Pos_y = (GetPos Grave select 1) + (0.5*Cos (_Angle));
  156. _Cam CamsetTarget DM_LastDead;
  157. _Cam CamSetPos [_Pos_x,_Pos_y,(GetPosATL Grave select 2)+1.5];
  158. _Cam Camcommit 0;
  159. Sleep 2;
  160. _Cam CamsetTarget _DM_Winner;
  161. _Cam Camcommit 2;
  162. Sleep 2;
  163. Null = ['<t color="#D8D800">'+Format ["WINNER: %1 (%2m)",Name _DM_Winner,Floor(10*((GetPosATL Grave) Distance (GetPosATL _DM_Winner)))/10]+'</t>',0,0.10,999,2] spawn bis_fnc_dynamictext;
  164. WaitUntil {CamCommitted _Cam};
  165. _Angle = (Getdir _DM_Winner)+10;
  166. _Pos_x = (GetPos _DM_Winner select 0) + (2.0*Sin (_Angle));
  167. _Pos_y = (GetPos _DM_Winner select 1) + (2.0*Cos (_Angle));
  168. _Cam CamSetPos [_Pos_x,_Pos_y,(GetPosATL _DM_Winner select 2) + 1.8];
  169. _Cam Camcommit 5;
  170. WaitUntil {CamCommitted _Cam};
  171. };
  172. Sleep 8;
  173.  
  174. _nul = addMissionEventHandler ["Ended",{
  175. _password = ""; // Defined in the server.cfg
  176. serverCommand [_password,"#restart"];
  177. }];
  178.  
  179. EndMission "END1";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement