-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcustomfunctions.sqf
More file actions
162 lines (155 loc) · 3.51 KB
/
customfunctions.sqf
File metadata and controls
162 lines (155 loc) · 3.51 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
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;
player groupChat 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 == "<NULL-object>") or (_this == "Error: No vehicle") or (_this == "Error: No Unit")) 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_CreateMarkerArray =
{
private ["_name", "_text", "_color", "_shape", "_pos", "_typ", "_marker", "_size"];
_pos = [0,0];
if ((typeName (_this select 0)) == "OBJECT") then
{
_pos = [((getPos (_this select 0)) select 0), ((getPos (_this select 0)) select 1)];
};
if ((typeName (_this select 0)) == "ARRAY") then
{
_pos = [((_this select 0) select 0), ((_this select 0) select 1)];
};
_text = "";
if (count _this > 1) then {_text = _this select 1};
_typ = "Destroy";
if (count _this > 2) then {_typ = _this select 2};
_color = "ColorRed";
if (count _this > 3) then {_color = _this select 3};
_shape = "ICON";
if (count _this > 4) then {_shape = _this select 4};
_size = [1, 1];
if (count _this > 5) then {_size = _this select 5};
if (isNil("GespawnteMarkerCounter")) then {GespawnteMarkerCounter = 0;};
_name = format["SpawnedMarker_%1", GespawnteMarkerCounter];
if (count _this > 6) then {_name = _this select 6};
_marker = createMarkerLocal [_name, _pos];
_marker setMarkerShapeLocal _shape;
_marker setMarkerTypeLocal _typ;
_marker setMarkerColorLocal _color;
_marker setMarkerTextLocal _text;
_marker setMarkerSizeLocal _size;
GespawnteMarkerCounter = GespawnteMarkerCounter + 1;
[_name, _marker]
};
ISSE_IsVictim =
{
private ["_state", "_victimStats"];
_state = animationState _this;
_victimStats = ["amovppnemstpsnonwnondnon","amovpercmstpssurwnondnon", "testsurrender", "inbasemoves_handsbehindback1", "amovpercmstpsnonwnondnon_amovpercmstpssurwnondnon"];
if (isstunned or _state in _victimStats) then
{
true
}
else
{
false
};
};
ISSE_DeleteVehicle = {
private ["_vcl", "_deltime"];
_vcl = _this select 0;
_deltime = _this select 1;
sleep _deltime;
if (not(isNull(_vcl))) then
{
call compile format["%1 = nil;", _vcl];
deleteVehicle _vcl;
};
};