-
Notifications
You must be signed in to change notification settings - Fork 6
/
appbroadcast.c4
535 lines (493 loc) · 12.6 KB
/
appbroadcast.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
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
// 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_12 = "NULL";
l_17 = 80.0;
l_18 = 140.0;
l_19 = 180.0;
l_1E/*"16"*/ = "CELL_212";
l_22/*"16"*/ = "CELL_213";
l_26/*"16"*/ = "CELL_39";
l_2A/*"16"*/ = "CELL_MP_300";
l_2E/*"16"*/ = "CELL_MP_301";
l_32/*"16"*/ = "CELL_MP_302";
GAMEPLAY::NETWORK_SET_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();
sub_ae1(&l_1C);
sub_739();
while (1) {
SYSTEM::WAIT(0);
if (!NETWORK::NETWORK_IS_IN_SESSION()) {
sub_6ad(1);
sub_6a1();
}
if ((!(g_384D._f1 == 9)) && (g_384D._f1 > 3)) {
sub_14a();
if (g_384D._f1 != 8) {
if (sub_121()) {
sub_6a1();
}
}
}
if (sub_de()) {
sub_6a1();
}
}
}
auto sub_de() {
if ((((g_384D._f1 == 1) || (g_384D._f1 == 3)) || (g_384D._f1 == 0)) || (g_3815 == 1)) {
g_3840 = 1;
return 1;
} else {
return 0;
}
}
auto sub_121() {
if ((g_B49 == 1) || (g_384D._f1 < 7)) {
g_3840 = 1;
return 1;
} else {
return 0;
}
}
void sub_14a() {
if (sub_5db(&l_1C)) {
if (sub_474()) {
if (g_25405A) {
NETWORK::_57B192B4D4AD23D5(0);
sub_305(37, sub_333(1, 1));
g_25405A = 0;
} else {
NETWORK::_57B192B4D4AD23D5(1);
sub_305(36, sub_333(1, 1));
g_25405A = 1;
}
sub_1a0(0);
return ;
}
}
}
void sub_1a0(auto a_0) {
if (g_38EB) {
sub_237(0, 0);
}
if ((g_384D._f1 == 10) || (g_384D._f1 == 9)) {
GAMEPLAY::SET_BIT(&g_8EC, 16);
}
if (AUDIO::IS_MOBILE_PHONE_CALL_ONGOING()) {
AUDIO::STOP_SCRIPTED_CONVERSATION(0);
}
g_3D60 = 5;
if (a_0 == 1) {
GAMEPLAY::SET_BIT(&g_8EB, 30);
} else {
GAMEPLAY::CLEAR_BIT(&g_8EB, 30);
}
if (!sub_210()) {
g_384D._f1 = 3;
}
}
auto sub_210() {
if ((g_384D._f1 == 1) || (g_384D._f1 == 0)) {
return 1;
} else {
return 0;
}
}
void sub_237(auto a_0, auto a_1) {
if (a_0) {
if (sub_2ab(0)) {
g_38EB = 1;
if (a_1) {
MOBILE::GET_MOBILE_PHONE_POSITION(&g_380E);
}
g_3805/*{3}*/ = g_3817[g_3816/*3*/];
MOBILE::SET_MOBILE_PHONE_POSITION(g_3805);
}
} else if (g_38EB == 1) {
g_38EB = 0;
g_3805/*{3}*/ = g_381E[g_3816/*3*/];
if (a_1) {
MOBILE::SET_MOBILE_PHONE_POSITION(g_380E);
} else {
MOBILE::SET_MOBILE_PHONE_POSITION(g_3805);
}
}
}
auto sub_2ab(auto a_0) {
if (a_0 == 1) {
if (g_384D._f1 > 3) {
if (GAMEPLAY::IS_BIT_SET(g_8EB, 14)) {
return 1;
} else {
return 0;
}
} else {
return 0;
}
} else {
if (SCRIPT::_GET_NUMBER_OF_INSTANCES_OF_STREAMED_SCRIPT(${cellphone_flashhand}) > 0) {
return 1;
}
if (g_384D._f1 > 3) {
return 1;
} else {
return 0;
}
}
}
void sub_305(auto a_0, auto a_1) {
v_4 = 2;
v_4._f1 = PLAYER::PLAYER_ID();
v_4._f2 = a_0;
if (!(a_1 == 0)) {
SCRIPT::TRIGGER_SCRIPT_EVENT(1, &v_4, 3, a_1);
} else { }
}
auto sub_333(auto a_0, auto a_1) {
for (v_5 = 0; v_5 < 32; v_5 += 1) {
v_6 = PLAYER::INT_TO_PLAYERINDEX(v_5);
if (sub_430(v_6, 0, 0)) {
if ((v_6 != PLAYER::PLAYER_ID()) || a_0) {
if (a_1) {
GAMEPLAY::SET_BIT(&v_4, v_5);
} else if (!sub_398(v_6, 0)) {
GAMEPLAY::SET_BIT(&v_4, v_5);
}
}
}
}
return v_4;
}
auto sub_398(auto a_0, auto a_1) {
if (a_0 == PLAYER::PLAYER_ID()) {
v_4 = sub_3e3(-1, 0) == 8;
} else {
v_4 = g_1837E7[a_0/*410*/]._fC0 == 8;
}
if (a_1 == 1) {
if (NETWORK::NETWORK_IS_PLAYER_ACTIVE(a_0)) {
v_4 = PLAYER::GET_PLAYER_TEAM(a_0) == 8;
}
}
return v_4;
}
auto sub_3e3(auto a_0, auto a_1) {
v_5 = a_0;
if (v_5 == -1) {
v_5 = sub_424();
}
if (g_141431[v_5/*1*/] == 1) {
if (a_1) {}
v_4 = 8;
} else {
v_4 = g_1407E4[v_5/*1*/];
if (a_1) {}
}
return v_4;
}
auto sub_424() {
return g_1407EA;
}
auto sub_430(auto a_0, auto a_1, auto a_2) {
v_5 = a_0;
if (NETWORK::NETWORK_IS_PLAYER_ACTIVE(a_0)) {
if (a_1) {
if (!PLAYER::IS_PLAYER_PLAYING(a_0)) {
return 0;
}
}
if (a_2) {
if (!g_2507F3._f3[v_5/*1*/]) {
return 0;
}
}
return 1;
}
return 0;
}
auto sub_474() {
if ((!sub_53f(PLAYER::PLAYER_ID(), 1)) && sub_497()) {
return 1;
}
return 0;
}
auto sub_497() {
if (g_1406BE) {
return 1;
}
if (sub_533()) {
return 1;
}
if (sub_527()) {
return 1;
}
return sub_4c7(120, -1);
}
auto sub_4c7(auto a_0, auto a_1) {
v_4 = g_25F257[a_0/*5*/][sub_4f3(a_1)/*1*/];
if (STATS::STAT_GET_BOOL(v_4, &v_5, -1)) {
return v_5;
}
return 0;
}
auto sub_4f3(auto a_0) {
v_3 = a_0;
if (v_3 == -1) {
v_4 = sub_424();
if (v_4 > -1) {
g_25A2B7 = 0;
v_3 = v_4;
} else {
v_3 = 0;
g_25A2B7 = 1;
}
}
return v_3;
}
auto sub_527() {
return g_14143B;
}
auto sub_533() {
return g_14143D;
}
auto sub_53f(auto a_0, auto a_1) {
if (g_1406BF != 0) {
return sub_5b9(a_0) != 0;
} else {
return sub_565(a_0, a_1);
}
}
auto sub_565(auto a_0, auto a_1) {
if (a_1) {
if (sub_591(a_0)) {
return 1;
}
}
if (g_1837E7[a_0/*410*/] == -1) {
return 0;
}
return 1;
}
auto sub_591(auto a_0) {
return sub_59f(a_0);
}
auto sub_59f(auto a_0) {
return GAMEPLAY::IS_BIT_SET(g_1837E7[a_0/*410*/]._fD._f1, 0);
}
auto sub_5b9(auto a_0) {
if (sub_430(a_0, 0, 1)) {
return g_24E1AF[a_0/*306*/]._f1;
}
return 0;
}
auto sub_5db(auto a_0) {
if (!GAMEPLAY::IS_BIT_SET(a_0, 0)) {
return 0;
}
if (g_3837) {
return 0;
}
if (!CAM::IS_SCREEN_FADED_IN()) {
return 0;
}
if (!CONTROLS::IS_CONTROL_JUST_PRESSED(2, g_382E)) {
return 0;
}
sub_622();
g_3837 = 1;
return 1;
}
void sub_622() {
if (!ENTITY::IS_ENTITY_DEAD(PLAYER::PLAYER_PED_ID())) {
AUDIO::PLAY_SOUND_FRONTEND(-1, "Menu_Accept", &g_3842, 1);
sub_646();
}
}
void sub_646() {
if (sub_65a()) {
MOBILE::_MOVE_FINGER(5);
}
}
auto sub_65a() {
if (g_10EC5) {
return 0;
} else {
v_4 = 0;
v_2 = CAM::_19CAFA3C87F7C2FF();
v_3 = CAM::_EE778F8C7E1142E2(v_2);
if (v_3 == 4) {
v_4 = 1;
}
if (g_270EBA || v_4) {
return 1;
} else {
return 1;
}
}
}
void sub_6a1() {
SCRIPT::TERMINATE_THIS_THREAD();
}
void sub_6ad(auto a_0) {
if (a_0) {
sub_710();
if ((g_384D._f1 == 10) || (g_384D._f1 == 9)) {
GAMEPLAY::SET_BIT(&g_8EC, 16);
}
g_384D._f1 = 1;
if (sub_2ab(0)) {
sub_1a0(0);
}
} else if (g_384D._f1 == 1) {
if (!(g_384D._f1 == 0)) {
g_384D._f1 = 3;
}
}
}
void sub_710() {
if ((g_384D._f1 == 9) || (g_384D._f1 == 10)) {
g_3D95 = 0;
g_3D91 = 1;
}
}
void sub_739() {
if (!(g_384D._f1 == 7)) {
g_384D._f1 = 7;
}
sub_a7e(g_383A, "SET_DATA_SLOT_EMPTY", __678_$BBDA792448DB5A89(13), 0xbf800000, 0xbf800000, 0xbf800000, 0xbf800000);
if (sub_474()) {
if (g_25405A) {
sub_9cb(g_383A, "SET_DATA_SLOT", __678_$BBDA792448DB5A89(13), __678_$BBDA792448DB5A89(0), __678_$BBDA792448DB5A89(12), -1.0, -1.0, &l_2E, 0, 0, 0, 0);
} else {
sub_9cb(g_383A, "SET_DATA_SLOT", __678_$BBDA792448DB5A89(13), __678_$BBDA792448DB5A89(0), __678_$BBDA792448DB5A89(12), -1.0, -1.0, &l_2A, 0, 0, 0, 0);
}
} else {
sub_9cb(g_383A, "SET_DATA_SLOT", __678_$BBDA792448DB5A89(13), __678_$BBDA792448DB5A89(0), __678_$BBDA792448DB5A89(12), -1.0, -1.0, &l_32, 0, 0, 0, 0);
}
sub_a7e(g_383A, "DISPLAY_VIEW", __678_$BBDA792448DB5A89(13), 0xbf800000, 0xbf800000, 0xbf800000, 0xbf800000);
sub_946(&l_26);
if (sub_474()) {
sub_849(13, &l_1E, 1, "", 4, &l_22, &l_1C);
} else {
sub_849(1, "", 1, "", 4, &l_22, &l_1C);
}
}
void sub_849(auto a_0, auto a_1, auto a_2, auto a_3, auto a_4, auto a_5, auto a_6) {
sub_879(2, a_0, a_1, 0, a_6, -1);
sub_879(1, a_2, a_3, 1, a_6, 17);
sub_879(3, a_4, a_5, 2, a_6, -1);
}
void sub_879(auto a_0, auto a_1, auto a_2, auto a_3, auto a_4, auto a_5) {
if (a_1 == 1) {
sub_9cb(g_383A, "SET_SOFT_KEYS", __678_$BBDA792448DB5A89(a_0), 0.0, __678_$BBDA792448DB5A89(a_1), -1.0, -1.0, 0, 0, 0, 0, 0);
GAMEPLAY::CLEAR_BIT(a_4, a_3);
sub_91b(a_5, 0);
return ;
}
if (g_3841) {
sub_9cb(g_383A, "SET_SOFT_KEYS", __678_$BBDA792448DB5A89(a_0), 1.0, __678_$BBDA792448DB5A89(a_1), -1.0, -1.0, a_2, 0, 0, 0, 0);
GAMEPLAY::SET_BIT(a_4, a_3);
sub_91b(a_5, 1);
return ;
}
sub_9cb(g_383A, "SET_SOFT_KEYS", __678_$BBDA792448DB5A89(a_0), 1.0, __678_$BBDA792448DB5A89(a_1), -1.0, -1.0, 0, 0, 0, 0, 0);
GAMEPLAY::SET_BIT(a_4, a_3);
sub_91b(a_5, 1);
}
void sub_91b(auto a_0, auto a_1) {
if (a_0 == -1) {
return ;
}
if (a_1) {
GAMEPLAY::SET_BIT(&g_8EB, a_0);
return ;
}
GAMEPLAY::CLEAR_BIT(&g_8EB, a_0);
}
void sub_946(auto a_0) {
sub_95e(g_383A, "SET_HEADER", a_0, 0, 0, 0, 0);
}
void sub_95e(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);
sub_9b9(a_2);
if (!GAMEPLAY::IS_STRING_NULL_OR_EMPTY(a_3)) {
sub_9b9(a_3);
}
if (!GAMEPLAY::IS_STRING_NULL_OR_EMPTY(a_4)) {
sub_9b9(a_4);
}
if (!GAMEPLAY::IS_STRING_NULL_OR_EMPTY(a_5)) {
sub_9b9(a_5);
}
if (!GAMEPLAY::IS_STRING_NULL_OR_EMPTY(a_6)) {
sub_9b9(a_6);
}
GRAPHICS::_POP_SCALEFORM_MOVIE_FUNCTION_VOID();
}
void sub_9b9(auto a_0) {
GRAPHICS::_BEGIN_TEXT_COMPONENT(a_0);
GRAPHICS::_END_TEXT_COMPONENT();
}
void sub_9cb(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_9b9(a_7);
}
if (!GAMEPLAY::IS_STRING_NULL_OR_EMPTY(a_8)) {
sub_9b9(a_8);
}
if (!GAMEPLAY::IS_STRING_NULL_OR_EMPTY(a_9)) {
sub_9b9(a_9);
}
if (!GAMEPLAY::IS_STRING_NULL_OR_EMPTY(a_A)) {
sub_9b9(a_A);
}
if (!GAMEPLAY::IS_STRING_NULL_OR_EMPTY(a_B)) {
sub_9b9(a_B);
}
GRAPHICS::_POP_SCALEFORM_MOVIE_FUNCTION_VOID();
}
void sub_a7e(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();
}
void sub_ae1(auto a_0) {
a_0 = 0;
}