forked from LexTheGreat/TLX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcamera.sqf
54 lines (48 loc) · 1.86 KB
/
camera.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
53
54
_mycv = cameraView;
_n2sh = 10;
_n2c = "Select Player:";
shnext = false;
nlist = [];
selecteditem = "";
if (isNil "spectate") then {spectate = true;} else {spectate = !spectate;};
if (spectate) then
{
{if (_x != player) then {nlist set [count nlist, name _x];};} forEach playableUnits;
shnmenu =
{
_pmenu = [["",true],[_n2c, [-1], "", -5, [["expression", ""]], "1", "0"]];
for "_i" from (_this select 0) to (_this select 1) do
{_arr = [format['%1',nlist select (_i)], [_i - (_this select 0) + 2], "", -5, [["expression", format["selecteditem = nlist select %1;",_i]]], "1", "1"];_pmenu set [_i+2, _arr];};
if (count nlist > (_this select 1)) then {_pmenu set [(_this select 1)+2, ["Next", [12], "", -5, [["expression", "shnext = true;"]], "1", "1"]];}
else {_pmenu set [(_this select 1)+2, ["", [-1], "", -5, [["expression", ""]], "1", "0"]];};
_pmenu set [(_this select 1)+3, ["Exit", [13], "", -5, [["expression", "selecteditem = 'exitscript';"]], "1", "1"]];
showCommandingMenu "#USER:_pmenu";
};
_j = 0; _n2sh = 10; if (_n2sh>9) then {_n2sh=10;};
while {selecteditem==""} do
{
[_j,(_j+_n2sh) min (count nlist)] call shnmenu;_j=_j+_n2sh;
WaitUntil {selecteditem!="" or shnext};
shnext = false;
};
if (selecteditem!= "exitscript") then
{
_name = selecteditem;
{
if(format[name _x] == _name) then
{
F3_EH = (findDisplay 46) displayAddEventHandler ["KeyDown","if ((_this select 1) == 0x3D) then {spectate = false;};"];
(vehicle _x) switchCamera "EXTERNAL";
titleText ["Spectating...","PLAIN DOWN"];titleFadeOut 4;
waitUntil { !(alive _x) or !(alive player) or !(spectate)};
(findDisplay 46) displayRemoveEventHandler ["KeyDown", F3_EH];
player switchCamera _mycv;
};
} forEach playableUnits;
};
spectate = false;
};
if (!spectate) then
{
titleText ["Back to player...","PLAIN DOWN"];titleFadeOut 4;
};