-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathendhandler.sqf
52 lines (51 loc) · 905 Bytes
/
endhandler.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
if (!isDedicated) then
{
winnerSidePVHandler =
{
if (dialog) then
{
closeDialog 0;
};
if (sidePlayer == winnerSide) then
{
["END1", sidePlayer == winnerSide, 1] spawn BIS_fnc_endMission;
}
else
{
["END2", sidePlayer == winnerSide, 1] spawn BIS_fnc_endMission;
};
};
"winnerSide" addPublicVariableEventHandler winnerSidePVHandler;
if (!(isNil "winnerSide")) then
{
[] call winnerSidePVHandler;
};
};
if (isServer) then
{
waitUntil {!(isNil "scoreW")};
waitUntil {!(isNil "scoreE")};
waitUntil {((scoreW >= maxScore) && (scoreW > (scoreE + 1))) || ((scoreE >= maxScore) && (scoreE > (scoreW + 1)))};
if (scoreW > scoreE) then
{
winnerSide = West;
}
else
{
winnerSide = East;
};
publicVariable "winnerSide";
if (dialog) then
{
closeDialog 0;
};
sleep 5;
if (!isDedicated) then
{
[] call winnerSidePVHandler;
}
else
{
endMission "END1";
};
};