Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Created By [88] Murcielago - mgllgm@hotmail.com (Comments and/or job offers are welcome)
- _DM_Max_Score = DM_Max_Score;
- _DM_Winner = ObjNull;
- _CurrentBestPlayer = "";
- _CurrentBestPlayerName = "";
- _Array = [];
- _ID_Players = [];
- _TimeLeft = GetMarkerPos "ServerTimeSec" Select 0;
- _TimeLeft_Text = "";
- _AI_No = 0;
- While {!DM_END} Do
- {
- _ID_Players = [];
- {
- If (IsPlayer _x) Then
- {
- _ID_Players = _ID_Players + [GetPlayerUID _x];
- };
- } ForEach (AllUnits+AllDeadMen);
- _Array = [_ID_Players,[],{GetMarkerPos _x Select 0},"DESCEND"] Call BIS_fnc_sortBy;
- If (GetMarkerPos (_Array Select 0) Select 0 > 0) Then {_CurrentBestPlayer = _Array Select 0;};
- If (MarkerText _CurrentBestPlayer != _CurrentBestPlayerName) Then
- {
- If (GetMarkerPos (_Array Select 0) Select 0 > 0) Then
- {
- _CurrentBestPlayerName = MarkerText _CurrentBestPlayer;
- 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;
- PlaySound "Blip1";
- };
- };
- _TimeLeft = GetMarkerPos "ServerTimeSec" Select 0;
- If (_TimeLeft > 59) Then {_TimeLeft_Text = STR(Round((GetMarkerPos "ServerTimeSec" Select 0)/60))+"min";} Else {_TimeLeft_Text = STR(Round(GetMarkerPos "ServerTimeSec" Select 0))+"s";};
- _AI_No = Count AllUnits-(Count ([] Call BIS_fnc_listPlayers));
- If (_AI_No < 0) Then {_AI_No = 0;};
- If (Ready_ON) Then
- {
- If (GetMarkerPos (_Array Select 0) Select 0 > 0) Then
- {
- 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]];
- }
- Else
- {
- 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]];
- };
- }
- Else
- {
- HintSilent "";
- };
- If (GetMarkerPos _CurrentBestPlayer Select 0 >= _DM_Max_Score) Then {DM_END = True;};
- If (Damage DM_End_Obj > 0) Then {_DM_Max_Score = _DM_Max_Score - 1;};
- Sleep 0.1;
- };
- MissionEnd_Obj SetDamage 1;
- Player RemoveAllEventHandlers "Killed";
- Player SetCaptive True;
- (Vehicle Player ) EnableSimulation False;
- (Vehicle Player ) AllowDamage False;
- {
- If (Name _x == _CurrentBestPlayerName) Then {_DM_Winner = _x;};
- } ForEach ([] Call BIS_fnc_listPlayers);
- _DM_Winner AllowDamage False;
- CloseDialog 0;
- Cam CameraEffect ["Terminate", "Back"];
- CamDestroy Cam;
- Null = ['<t color="#D8D800">'+"FIN"+'</t>',0,0.35,1,1] Spawn Bis_fnc_dynamictext;
- PlayMusic "Track05_Underwater2";
- HintSilent "";
- Sleep 3;
- While {_DM_Winner Distance (GetMarkerPos "Respawn_West") < 100} Do
- {
- Sleep 0.1;
- };
- HintSilent "";
- TitleRsc ["Black","PLAIN",0];
- CutRsc ["Black","PLAIN",0];
- TitleText ["","PLAIN",0];
- _Cam = "Camera" CamCreate (GetPos Centre);
- _Cam CameraEffect ["External", "Back"];
- _Angle = 0;
- TitleCut ["","BLACK FADED"];
- SetTerrainGrid 6.25;
- If (GetMarkerPos _CurrentBestPlayer Select 0 < DM_Max_Score) Then
- {
- If (Damage DM_End_Obj > 0) Then
- {
- If (GetMarkerPos _CurrentBestPlayer Select 0 == 0) Then
- {
- SetViewDistance 1500;
- WaitUntil {PreloadCamera (Position Centre)};
- TitleCut ["","BLACK IN",7];
- _Angle = Getdir Centre;
- _Pos_x = (GetPos Centre select 0) + (100*Sin (_Angle));
- _Pos_y = (GetPos Centre select 1) + (100*Cos (_Angle));
- _Cam CamsetTarget Centre;
- _Cam CamSetPos [_Pos_x,_Pos_y,(GetPosATL Centre select 2) + 50];
- _Cam Camcommit 0;
- Sleep 2;
- Null = ['<t color="#D8D800">'+"DRAW!"+'</t>',0,0.50,999,2] Spawn Bis_Fnc_dynamictext;
- }
- Else
- {
- WaitUntil {PreloadCamera (Position _DM_Winner)};
- TitleCut ["","BLACK IN",7];
- _Angle = (Getdir _DM_Winner)+10;
- _Pos_x = (GetPos _DM_Winner select 0) + (2.0*Sin (_Angle));
- _Pos_y = (GetPos _DM_Winner select 1) + (2.0*Cos (_Angle));
- _Cam CamsetTarget _DM_Winner;
- _Cam CamSetPos [_Pos_x,_Pos_y,(GetPosATL _DM_Winner select 2) + 1.8];
- _Cam Camcommit 0;
- Sleep 2;
- Null = ['<t color="#D8D800">'+Format ["WINNER: %1",Name _DM_Winner]+'</t>',0,0.10,999,2] Spawn Bis_Fnc_dynamictext;
- };
- };
- }
- Else
- {
- WaitUntil {PreloadCamera (Position Grave)};
- TitleCut ["","BLACK IN",7];
- _Angle = (Getdir _DM_Winner);
- _Pos_x = (GetPos Grave select 0) + (0.5*Sin (_Angle));
- _Pos_y = (GetPos Grave select 1) + (0.5*Cos (_Angle));
- _Cam CamsetTarget DM_LastDead;
- _Cam CamSetPos [_Pos_x,_Pos_y,(GetPosATL Grave select 2)+1.5];
- _Cam Camcommit 0;
- Sleep 2;
- _Cam CamsetTarget _DM_Winner;
- _Cam Camcommit 2;
- Sleep 2;
- 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;
- WaitUntil {CamCommitted _Cam};
- _Angle = (Getdir _DM_Winner)+10;
- _Pos_x = (GetPos _DM_Winner select 0) + (2.0*Sin (_Angle));
- _Pos_y = (GetPos _DM_Winner select 1) + (2.0*Cos (_Angle));
- _Cam CamSetPos [_Pos_x,_Pos_y,(GetPosATL _DM_Winner select 2) + 1.8];
- _Cam Camcommit 5;
- WaitUntil {CamCommitted _Cam};
- };
- Sleep 8;
- "END1" call BIS_fnc_endMission;
- }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement