-
Notifications
You must be signed in to change notification settings - Fork 6
/
apptrackify.c4
348 lines (330 loc) · 11.8 KB
/
apptrackify.c4
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
// listener's C4 decompiler
void main() {
l_2 = 1;
l_3 = 134;
l_4 = 134;
l_5 = 1;
l_6 = 1;
l_7 = 1;
l_8 = 134;
l_9 = 1;
l_A = 12;
l_B = 12;
l_E = 0.001;
l_11 = -1;
l_1B = 9.99;
l_1C = 0.0;
l_1D = 0.0;
l_1E = 0.0;
GAMEPLAY::NETWORK_SET_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();
sub_3ae();
sub_257();
SYSTEM::SETTIMERA(0);
SYSTEM::SETTIMERB(0);
while (1) {
SYSTEM::WAIT(0);
if (g_384D._f1 != 9) {
switch (g_384D._f1) {
case 7:
if (SYSTEM::TIMERA() > 125) {
sub_3ae();
SYSTEM::SETTIMERA(0);
}
if ((SYSTEM::TIMERB() > (SYSTEM::FLOOR(l_1D) * 30)) && (SYSTEM::TIMERB() > 150)) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION(g_383A, "APP_FUNCTION");
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(1);
GRAPHICS::_POP_SCALEFORM_MOVIE_FUNCTION_VOID();
SYSTEM::SETTIMERB(0);
}
if (SYSTEM::TIMERB() > 2000) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION(g_383A, "APP_FUNCTION");
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(1);
GRAPHICS::_POP_SCALEFORM_MOVIE_FUNCTION_VOID();
SYSTEM::SETTIMERB(0);
}
break;
case 8:
if (sub_1e5(2, g_382D, 0)) {
sub_1c5();
g_3837 = 1;
sub_3ae();
sub_257();
if (g_384D._f1 > 3) {
g_384D._f1 = 7;
}
}
break;
default:
break;
}
if (sub_19c()) {
sub_187();
}
} else {
g_384F = 6;
sub_187();
}
if (sub_144()) {
sub_187();
}
}
}
auto sub_144() {
if ((((g_384D._f1 == 1) || (g_384D._f1 == 3)) || (g_384D._f1 == 0)) || (g_3815 == 1)) {
g_3840 = 1;
return 1;
} else {
return 0;
}
}
void sub_187() {
GAMEPLAY::CLEAR_BIT(&g_8EC, 22);
SCRIPT::TERMINATE_THIS_THREAD();
}
auto sub_19c() {
if ((g_B49 == 1) || (g_384D._f1 < 7)) {
g_3840 = 1;
return 1;
} else {
return 0;
}
}
void sub_1c5() {
if (!ENTITY::IS_ENTITY_DEAD(PLAYER::PLAYER_PED_ID())) {
AUDIO::PLAY_SOUND_FRONTEND(-1, "Menu_Back", &g_3842, 1);
}
}
auto sub_1e5(auto a_0, auto a_1, auto a_2) {
if (CONTROLS::IS_CONTROL_JUST_PRESSED(a_0, a_1) || ((a_2 == 1) && CONTROLS::IS_DISABLED_CONTROL_JUST_PRESSED(a_0, a_1))) {
if (GAMEPLAY::IS_PC_VERSION()) {
if ((GAMEPLAY::UPDATE_ONSCREEN_KEYBOARD() == 0) || (NETWORK::_NETWORK_IS_TEXT_CHAT_ACTIVE() && CONTROLS::_GET_LAST_INPUT_METHOD(2))) {
return 0;
}
}
if (UI::IS_PAUSE_MENU_ACTIVE() || UI::_E18B138FABC53103()) {
return 0;
} else {
return 1;
}
} else {
return 0;
}
}
void sub_257() {
if (g_3841) {
sub_2e9(g_383A, "SET_SOFT_KEYS", 2.0, 0.0, 13.0, -1.0, -1.0, "CELL_201", 0, 0, 0, 0);
sub_2e9(g_383A, "SET_SOFT_KEYS", 3.0, 1.0, 14.0, -1.0, -1.0, "CELL_213", 0, 0, 0, 0);
} else {
sub_2e9(g_383A, "SET_SOFT_KEYS", 2.0, 0.0, 13.0, -1.0, -1.0, 0, 0, 0, 0, 0);
sub_2e9(g_383A, "SET_SOFT_KEYS", 3.0, 1.0, 14.0, -1.0, -1.0, 0, 0, 0, 0, 0);
}
sub_2e9(g_383A, "SET_SOFT_KEYS", 1.0, 0.0, 1.0, -1.0, -1.0, 0, 0, 0, 0, 0);
GAMEPLAY::CLEAR_BIT(&g_8EB, 17);
}
void sub_2e9(auto a_0, auto a_1, auto a_2, auto a_3, auto a_4, auto a_5, auto a_6, auto a_7, auto a_8, auto a_9, auto a_10, auto a_11) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION(a_0, a_1);
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::ROUND(a_2));
if (a_3 != -1.0) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::ROUND(a_3));
}
if (a_4 != -1.0) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::ROUND(a_4));
}
if (a_5 != -1.0) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::ROUND(a_5));
}
if (a_6 != -1.0) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::ROUND(a_6));
}
if (!GAMEPLAY::IS_STRING_NULL_OR_EMPTY(a_7)) {
sub_39c(a_7);
}
if (!GAMEPLAY::IS_STRING_NULL_OR_EMPTY(a_8)) {
sub_39c(a_8);
}
if (!GAMEPLAY::IS_STRING_NULL_OR_EMPTY(a_9)) {
sub_39c(a_9);
}
if (!GAMEPLAY::IS_STRING_NULL_OR_EMPTY(a_A)) {
sub_39c(a_A);
}
if (!GAMEPLAY::IS_STRING_NULL_OR_EMPTY(a_B)) {
sub_39c(a_B);
}
GRAPHICS::_POP_SCALEFORM_MOVIE_FUNCTION_VOID();
}
void sub_39c(auto a_0) {
GRAPHICS::_BEGIN_TEXT_COMPONENT(a_0);
GRAPHICS::_END_TEXT_COMPONENT();
}
void sub_3ae() {
if (sub_852() == 0) {
if (!ENTITY::IS_ENTITY_DEAD(PLAYER::PLAYER_PED_ID())) {
l_14/*{3}*/ = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), 1);
l_17 = ENTITY::GET_ENTITY_HEADING(PLAYER::PLAYER_PED_ID());
sub_81f();
sub_7f6();
sub_7aa();
l_18 = 360.0 - l_17;
l_1B -= l_18;
if (l_1B < 0.0) {
l_1B += 360.0;
}
if (l_1F == 0) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION(g_383A, "SET_DATA_SLOT");
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(23);
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(0);
if (GAMEPLAY::IS_BIT_SET(g_8EC, 30)) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(-99);
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(0);
} else {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::FLOOR(l_1B));
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::FLOOR(l_1C));
}
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(100);
if (GAMEPLAY::IS_BIT_SET(g_8EC, 22)) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(1);
} else {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(0);
}
if (GAMEPLAY::IS_BIT_SET(g_8EC, 29)) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_BOOL(0);
} else {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_BOOL(1);
}
if (GAMEPLAY::IS_BIT_SET(g_8ED, 1)) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_FLOAT(l_1E);
}
GRAPHICS::_POP_SCALEFORM_MOVIE_FUNCTION_VOID();
}
if (l_17 == l_17) {}
sub_747(g_383A, "DISPLAY_VIEW", 23.0, __678_$BBDA792448DB5A89(1), 0xbf800000, 0xbf800000, 0xbf800000);
}
} else if (!ENTITY::IS_ENTITY_DEAD(PLAYER::PLAYER_PED_ID())) {
l_14/*{3}*/ = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), 1);
l_17 = ENTITY::GET_ENTITY_HEADING(PLAYER::PLAYER_PED_ID());
if (g_270EB7 > 5) {}
for (v_2 = 0; v_2 < g_270EB7; v_2 += 1) {
sub_700(v_2);
sub_6cd(v_2);
sub_677(v_2);
l_18 = 360.0 - l_17;
l_1B -= l_18;
if (l_1B < 0.0) {
l_1B += 360.0;
}
if (l_1F == 0) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION(g_383A, "SET_DATA_SLOT");
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(23);
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(v_2);
v_3 = 0;
switch (v_2) {
case 0:
if (GAMEPLAY::IS_BIT_SET(g_270DEA, 5)) {
v_3 = 1;
}
break;
case 1:
if (GAMEPLAY::IS_BIT_SET(g_270DEA, 6)) {
v_3 = 1;
}
break;
case 2:
if (GAMEPLAY::IS_BIT_SET(g_270DEA, 7)) {
v_3 = 1;
}
break;
case 3:
if (GAMEPLAY::IS_BIT_SET(g_270DEA, 8)) {
v_3 = 1;
}
break;
}
if (v_3) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(-99);
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(0);
} else {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::FLOOR(l_1B));
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::FLOOR(l_1C));
}
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(100);
if (GAMEPLAY::IS_BIT_SET(g_8EC, 22)) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_BOOL(1);
} else {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_BOOL(1);
}
if (GAMEPLAY::IS_BIT_SET(g_8EC, 29)) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_BOOL(0);
} else {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_BOOL(1);
}
if (GAMEPLAY::IS_BIT_SET(g_8ED, 1)) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_FLOAT(l_1E);
}
GRAPHICS::_POP_SCALEFORM_MOVIE_FUNCTION_VOID();
}
if (l_17 == l_17) {}
sub_747(g_383A, "DISPLAY_VIEW", 23.0, __678_$BBDA792448DB5A89(1), 0xbf800000, 0xbf800000, 0xbf800000);
}
}
}
auto sub_677(auto a_0) {
l_19 = g_270EA7[a_0/*3*/] - l_14;
l_1A = SYSTEM::COS((3.141590118408203 / 180.0) * l_14) * (g_270EA7[a_0/*3*/]._f1 - l_14._f1);
l_1B = GAMEPLAY::ATAN2(l_19, l_1A);
if (l_1B < 0.0) {
l_1B += 360.0;
}
return l_1B;
}
auto sub_6cd(auto a_0) {
l_1D = SYSTEM::SQRT(SYSTEM::VDIST2(g_270EA7[a_0/*3*/], l_14));
l_1E = g_270EA7[a_0/*3*/]._f2 - l_14._f2;
return l_1D;
}
auto sub_700(auto a_0) {
l_1C = SYSTEM::SQRT(((g_270EA7[a_0/*3*/] - l_14) * (g_270EA7[a_0/*3*/] - l_14)) + ((g_270EA7[a_0/*3*/]._f1 - l_14._f1) * (g_270EA7[a_0/*3*/]._f1 - l_14._f1)));
return l_1C;
}
void sub_747(auto a_0, auto a_1, auto a_2, auto a_3, auto a_4, auto a_5, auto a_6) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION(a_0, a_1);
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::ROUND(a_2));
if (a_3 != -1.0) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::ROUND(a_3));
}
if (a_4 != -1.0) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::ROUND(a_4));
}
if (a_5 != -1.0) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::ROUND(a_5));
}
if (a_6 != -1.0) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::ROUND(a_6));
}
GRAPHICS::_POP_SCALEFORM_MOVIE_FUNCTION_VOID();
}
auto sub_7aa() {
l_19 = g_41B2 - l_14;
l_1A = SYSTEM::COS((3.141590118408203 / 180.0) * l_14) * (g_41B2._f1 - l_14._f1);
l_1B = GAMEPLAY::ATAN2(l_19, l_1A);
if (l_1B < 0.0) {
l_1B += 360.0;
}
return l_1B;
}
auto sub_7f6() {
l_1D = SYSTEM::SQRT(SYSTEM::VDIST2(g_41B2, l_14));
l_1E = g_41B2._f2 - l_14._f2;
return l_1D;
}
auto sub_81f() {
l_1C = SYSTEM::SQRT(((g_41B2 - l_14) * (g_41B2 - l_14)) + ((g_41B2._f1 - l_14._f1) * (g_41B2._f1 - l_14._f1)));
return l_1C;
}
auto sub_852() {
if (g_10EC5 == 1) {
return 1;
} else {
return 0;
}
}