-
Notifications
You must be signed in to change notification settings - Fork 4
/
customfunctions.sqf
96 lines (92 loc) · 1.92 KB
/
customfunctions.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
TastenDruck = {
private ["_ctrl", "_zeichennummer", "_ctrlid"];
_ctrl = ((_this select 0) select 0);
_zeichennummer = ((_this select 0) select 1);
_ctrlid = (_this select 1);
if (ISSE_str_const_validInput find _zeichennummer < 0) then
{
closedialog 0;
hintSilent format[localize "STRS_wrong_input", _zeichennummer];
};
};
ISSE_UnitExists = {
private ["_obj"];
if ((typeName _this) == "STRING") then
{
if ((isnil(_this)) or (_this == "scalar bool array string 0xe0ffffef") or (_this == "<NULL-Object>") or (_this == "Error: No vehicle")) then {
false
} else {
_obj = call compile format ["%1", _this];
if (format ["%1", isplayer _obj] == "true") then
{
true
}
else
{
false
};
};
} else {
if (isNull _this) then {
false
} else {
true
};
};
};
ISSE_ArrayIsNear = {
private ["_c", "_obj", "_arr", "_dis", "_res"];
_obj = _this select 0;
_arr = (_this select 1) - [_obj];
_dis = _this select 2;
_res = false;
if (isNull _obj) then
{
_res = false;
}
else
{
for "_c" from 0 to (count _arr - 1) do {
if (not(isNull(_arr select _c))) then
{
if ((_obj distance (_arr select _c)) < _dis) then
{
_res = true;
};
};
};
};
_res
};
ISSE_ArrayNumberNear = {
private ["_c", "_obj", "_arr", "_dis", "_res"];
_obj = _this select 0;
_arr = _this select 1;
_dis = _this select 2;
_res = 0;
if (isNull _obj) then
{
_res = 0;
} else {
for "_c" from 0 to (count _arr - 1) do {
if (not(isNull(_arr select _c))) then
{
if ((_obj distance (_arr select _c)) < _dis) then
{
_res = _res + 1;
};
};
};
};
_res
};
ISSE_IsVictim = {
private ["_state", "_victimStats"];
_state = animationState _this;
_victimStats = ["amovpercmstpssurwnondnon", "adthppnemstpsraswpstdnon_2", "adthpercmstpslowwrfldnon_4", "amovpercmwlkssurwnondf_forgoten", "civillying01"];
if (_state in _victimStats) then {
true
} else {
false
};
};