-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFunctions.sqf
102 lines (94 loc) · 2.3 KB
/
Functions.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
90
91
92
93
94
95
96
97
98
99
100
101
102
FindRandomFlatArea = {
private ["_centreX", "_centreY", "_rangeX", "_rangeY"];
_isSuitable = false;
_centreX = _this select 0;
_centreY = _this select 1;
_rangeX = _this select 2;
_rangeY = _this select 3;
_randPos = [_centreX, _centreY];
_normal = surfaceNormal _randPos;
while {!_isSuitable} do {
_offsetX = (random (2 * _rangeX)) - _rangeX;
_offsetY = (random (2 * _rangeY)) - _rangeY;
_randPos = [_centreX + _offsetX, _centreY + _offsetY];
_isLand = !surfaceIsWater _randPos;
if(_isLand) then {
_normal = surfaceNormal _randPos;
_flatAndEmpty = count (_randPos isFlatEmpty [0, 0, 0.25, 1, 0, false, objNull]) > 0;
_isNearRoad = (count (_randPos nearRoads 20)) != 0;
_isNearBuilding = (nearestBuilding _randPos) distance _randPos < 20;
_isSuitable = _isLand && _flatAndEmpty && !_isNearRoad && !_isNearBuilding;
};
};
_randPos;
};
BuildPrison = {
private ["_position"];
_position = _this select 0;
createVehicle ["Land_Metal_Shed_F",_position, [], 0, "NONE"];
};
GetPlayers = {
players = [];
if (!isNil "p1") then {
if (isPlayer p1) then {
players set [count players, p1];
};
};
if (!isNil "p2") then {
if (isPlayer p2) then {
players set [count players, p2];
};
};
if (!isNil "p3") then {
if (isPlayer p3) then {
players set [count players, p3];
};
};
if (!isNil "p4") then {
if (isPlayer p4) then {
players set [count players, p4];
};
};
if (!isNil "p5") then {
if (isPlayer p5) then {
players set [count players, p5];
};
};
if (!isNil "p6") then {
if (isPlayer p6) then {
players set [count players, p6];
};
};
if (!isNil "p7") then {
if (isPlayer p7) then {
players set [count players, p7];
};
};
if (!isNil "p8") then {
if (isPlayer p8) then {
players set [count players, p8];
};
};
players
};
StripInventory = {
private ["_pc"];
_pc = _this select 0;
removeAllWeapons _pc;
removeAllItems _pc;
_pc unassignItem "itemmap";
_pc unassignItem "itemcompass";
_pc unassignItem "NVGoggles";
_pc unassignItem "itemwatch";
_pc unassignItem "itemgps";
_pc unassignItem "itemradio";
_pc removeItem "itemmap";
_pc removeItem "itemcompass";
_pc removeItem "NVGoggles";
_pc removeItem "itemwatch";
_pc removeItem "itemgps";
_pc removeItem "itemradio";
_pc addItem "ACRE_PRC343";
removeVest _pc;
removeHeadgear _pc;
}