-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHack-in 3rd-Person.sqf
89 lines (83 loc) · 3.49 KB
/
Hack-in 3rd-Person.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// Execute this as Local if the _target is to be given 3rd person.
// If you set _targeg as player and execute as global, everyone will be given 3rd person.
// uncomment the target you want, re comment other other one.
private _target = player;
//private _target = cursorObject;
hack3rd_setup = {
hack3rd_script =
{
while {true} do
{
vehicle player switchCamera "External";
uiSleep 0.008;
};
};
_hack3rd_handle = player getVariable ["hack3rd_handle", objNull ];
if !( isNull _hack3rd_handle) then {terminate _hack3rd_handle};
player setVariable ["hack3rd_active", false, true ];
player setVariable ["hack3rd_minimised", false, true ];
player setVariable ["hack3rd_handle", objNull, true ];
(findDisplay 46) displayAddEventHandler ["KeyDown",
{
params ["_displayorcontrol", "_key", "_shift", "_ctrl", "_alt"];
if (inputAction "personView" > 0) then
{
_hack3rd_handle = player getVariable ["hack3rd_handle", objNull ];
if !( isNull _hack3rd_handle) then {terminate _hack3rd_handle};
_hack3rd_active = player getVariable ["hack3rd_active", false ];
_hack3rd_minimised = player getVariable ["hack3rd_minimised", false ];
if (_hack3rd_active) then
{
player setVariable ["hack3rd_active", false, true ];
}
else
{
if (_hack3rd_minimised) then
{
_hack3rd_handle = [] spawn hack3rd_script;
player setVariable ["hack3rd_handle", _hack3rd_handle, true ];
player setVariable ["hack3rd_minimised", false, true ];
player setVariable ["hack3rd_active", true, true ];
}
else
{
_hack3rd_handle = [] spawn hack3rd_script;
player setVariable ["hack3rd_handle", _hack3rd_handle, true ];
player setVariable ["hack3rd_active", true, true ];
};
};
};
}];
(findDisplay 46) displayAddEventHandler ["MouseButtonDown",
{
params ["_displayorcontrol", "_button", "_xPos", "_yPos", "_shift", "_ctrl", "_alt"];
if (_button == 1) then
{
_hack3rd_minimised = player getVariable ["hack3rd_minimised", false ];
_hack3rd_active = player getVariable ["hack3rd_active", false ];
if (_hack3rd_minimised) then
{
_hack3rd_handle = [] spawn hack3rd_script;
player setVariable ["hack3rd_handle", _hack3rd_handle, true ];
player setVariable ["hack3rd_minimised", false, true ];
player setVariable ["hack3rd_active", true, true ];
}
else
{
if (_hack3rd_active) then
{
_hack3rd_handle = player getVariable ["hack3rd_handle", objNull ];
if !( isNull _hack3rd_handle) then {terminate _hack3rd_handle};
player setVariable ["hack3rd_minimised", true, true ];
player setVariable ["hack3rd_active", false, true ];
};
};
};
}];
};
if (target isEqualTo player) then {
call hack3rd_setup;
} else {
if (!isPlayer _target) exitWith {};
[[],hack3rd_setup] remoteExecCall ["call",_target];
};