Skip to content

Commit 18d1edc

Browse files
committed
[scripts] upgrade pFLIR
1 parent eae0e9f commit 18d1edc

File tree

3 files changed

+96
-4
lines changed

3 files changed

+96
-4
lines changed

source/pFLIR/livefeed.sqf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ _lol = [player, trucPIPtarget, player,2] call BIS_fnc_liveFeed;
1010
BIS_liveFeed attachTo [player,[0,1,1]];
1111
BIS_liveFeed camPrepareFOV 0.2;
1212
BIS_liveFeed camCommitPrepared 0;
13+
14+
pFlirActivated = true;
15+
player removeEventHandler ["respawn",PlayerKilledEH3];
1316
player removeAction pFlirEnable;
1417

18+
1519
// Stance management init
1620
_actualStance = stance player;
1721
switch (_actualStance) do
@@ -38,8 +42,11 @@ switch (_actualStance) do
3842

3943
// add action to disable FLIR
4044
sleep 1;
41-
pFlirActivated = true;
45+
4246
pFLIRdisable = player addaction ["<t color='#a9ff59'>Deactivate FLIR</t>","pflir\livefeedexit.sqf","", 0,false,true,"","_target == _this"];
47+
PlayerKilledEH2 = player addEventHandler ["killed", {execvm "pflir\livefeedexit.sqf"}]; //removes screen from hud
48+
49+
4350

4451
while {pFlirActivated} do {
4552
waitUntil {(_actualStance != stance player) or !pFlirActivated};

source/pFLIR/livefeed1.sqf

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// pFLIRenable = player addaction ["<t color='#a9ff59'>Activate FLIR</t>","pflir\livefeed.sqf","", 0,false,true,"","_target == _this"];
2+
3+
// pflir aim
4+
trucPIPtarget = "Land_Sack_F" createVehicle ([0,0,0]); // PAS OUBLIER DE SUPPRIMER LE TRUC
5+
trucPIPtarget attachTo [player,[0,2000,1]];
6+
trucPIPtarget hideobject true;
7+
8+
// pflir camera creation
9+
_lol = [player, trucPIPtarget, player,2] call BIS_fnc_liveFeed;
10+
BIS_liveFeed attachTo [player,[0,1,1]];
11+
BIS_liveFeed camPrepareFOV 0.2;
12+
BIS_liveFeed camCommitPrepared 0;
13+
14+
pFlirActivated = true;
15+
player removeEventHandler ["respawn",PlayerRespawnEH2];
16+
player removeAction pFLIRenable;
17+
18+
19+
// Stance management init
20+
_actualStance = stance player;
21+
switch (_actualStance) do
22+
{
23+
case "STAND":
24+
{
25+
BIS_liveFeed attachTo [player,[0,1,1.68]];
26+
trucPIPtarget attachTo [player,[0,2000,1.68]];
27+
};
28+
29+
case "CROUCH":
30+
{
31+
BIS_liveFeed attachTo [player,[0,1,0.85]];
32+
trucPIPtarget attachTo [player,[0,2000,0.85]];
33+
};
34+
35+
case "PRONE":
36+
{
37+
BIS_liveFeed attachTo [player,[0,1,0.25]];
38+
trucPIPtarget attachTo [player,[0,2000,0.25]];
39+
};
40+
41+
};
42+
43+
// add action to disable FLIR
44+
sleep 1;
45+
46+
pFLIRdisable = player addaction ["<t color='#a9ff59'>Deactivate FLIR</t>","pflir\livefeedexit.sqf","", 0,false,true,"","_target == _this"];
47+
PlayerKilledEH2 = player addEventHandler ["killed", {execvm "pflir\livefeedexit.sqf"}]; //removes screen from hud
48+
49+
50+
51+
while {pFlirActivated} do {
52+
waitUntil {(_actualStance != stance player) or !pFlirActivated};
53+
if (!pFlirActivated) exitWith {};
54+
_actualStance = stance player;
55+
switch (_actualStance) do
56+
{
57+
case "STAND":
58+
{
59+
BIS_liveFeed attachTo [player,[0,1,1.68]];
60+
trucPIPtarget attachTo [player,[0,2000,1.68]];
61+
};
62+
63+
case "CROUCH":
64+
{
65+
BIS_liveFeed attachTo [player,[0,1,0.85]];
66+
trucPIPtarget attachTo [player,[0,2000,0.85]];
67+
};
68+
69+
case "PRONE":
70+
{
71+
BIS_liveFeed attachTo [player,[0,1,0.25]];
72+
trucPIPtarget attachTo [player,[0,2000,0.25]];
73+
};
74+
75+
};
76+
};

source/pFLIR/livefeedexit.sqf

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
pFlirActivated = false;
12
[] call BIS_fnc_liveFeedTerminate;
23
deleteVehicle trucPIPtarget;
3-
player removeAction pFLIRdisable;
4-
pFlirActivated = false;
4+
5+
player removeAction pFlirDisable;
6+
player removeAction pFlirEnable;
7+
player removeEventHandler ["killed",PlayerKilledEH2];
8+
59
sleep 2;
6-
pFLIRenable = player addaction ["<t color='#a9ff59'>Enable FLIR</t>","pflir\livefeed.sqf","", 0,false,true,"","_target == _this"];
10+
11+
waitUntil {alive player};
12+
pFLIRenable = player addaction ["<t color='#a9ff59'>Enable FLIR</t>","pflir\livefeed.sqf","", 0,false,true,"","_target == _this"]; //original last line in script
13+
14+
PlayerKilledEH3 = player addEventHandler ["respawn",{player addaction ["<t color='#a9ff59'>Enable FLIR</t>","pflir\livefeed.sqf","", 0,false,true,"","_target == _this"]}];
15+

0 commit comments

Comments
 (0)