forked from root-cause/v-decompiled-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
am_casino_luxury_car.c
15538 lines (14039 loc) · 343 KB
/
am_casino_luxury_car.c
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
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#region Local Var
var uLocal_0 = 0;
var uLocal_1 = 0;
int iLocal_2 = 0;
int iLocal_3 = 0;
int iLocal_4 = 0;
int iLocal_5 = 0;
int iLocal_6 = 0;
int iLocal_7 = 0;
int iLocal_8 = 0;
int iLocal_9 = 0;
int iLocal_10 = 0;
int iLocal_11 = 0;
var uLocal_12 = 0;
var uLocal_13 = 0;
float fLocal_14 = 0f;
var uLocal_15 = 0;
var uLocal_16 = 0;
int iLocal_17 = 0;
char* sLocal_18 = NULL;
var uLocal_19 = 0;
var uLocal_20 = 0;
var uLocal_21 = 0;
var uLocal_22 = 0;
float fLocal_23 = 0f;
float fLocal_24 = 0f;
float fLocal_25 = 0f;
var uLocal_26 = 0;
var uLocal_27 = 0;
float fLocal_28 = 0f;
var uLocal_29 = 0;
var uLocal_30 = 0;
var uLocal_31 = 0;
float fLocal_32 = 0f;
float fLocal_33 = 0f;
var uLocal_34 = 0;
var uLocal_35 = 0;
int iLocal_36 = 0;
var uLocal_37 = 0;
var uLocal_38 = 0;
var uLocal_39 = 0;
int iLocal_40 = 0;
int iLocal_41 = 0;
int iLocal_42 = 0;
int iLocal_43 = 0;
var uLocal_44 = 0;
var uLocal_45 = 0;
var uLocal_46 = 0;
var uLocal_47 = 0;
var uLocal_48 = 0;
var uLocal_49 = 0;
var uLocal_50 = 0;
var uLocal_51 = 0;
var uLocal_52 = 0;
var uLocal_53 = 0;
var uLocal_54 = 0;
var uLocal_55 = 0;
var uLocal_56 = 0;
var uLocal_57 = 0;
var uLocal_58 = 0;
var uLocal_59 = 0;
var uLocal_60 = 0;
var uLocal_61 = 0;
float fLocal_62 = 0f;
var uLocal_63 = 0;
var uLocal_64 = 0;
var uLocal_65 = 0;
var uLocal_66 = 0;
var uLocal_67 = 0;
var uLocal_68 = 0;
var uLocal_69 = 0;
var uLocal_70 = 0;
var uLocal_71 = 0;
var uLocal_72 = 0;
var uLocal_73 = 0;
var uLocal_74 = 0;
var uLocal_75 = 0;
var uLocal_76 = 0;
var uLocal_77 = 0;
var uLocal_78 = 0;
var uLocal_79 = 0;
var uLocal_80 = 0;
var uLocal_81 = 0;
var uLocal_82 = 0;
var uLocal_83 = 0;
var uLocal_84 = 0;
struct<7> Local_85 = { 0, 0, 1, 0, 0, 0, 0 } ;
var uLocal_92 = 0;
struct<4> Local_93[8];
int iLocal_126[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
var uLocal_135[1] = { 0 };
var uLocal_137 = 0;
struct<4> Local_138 = { 0, 0, 0, 0 } ;
int iLocal_142 = 0;
struct<21> ScriptParam_0 = { 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, -1 } ;
#endregion
void __EntryFunction__()//Position - 0x0
{
iLocal_2 = 1;
iLocal_3 = 134;
iLocal_4 = 134;
iLocal_5 = 1;
iLocal_6 = 1;
iLocal_7 = 1;
iLocal_8 = 134;
iLocal_9 = 1;
iLocal_10 = 12;
iLocal_11 = 12;
fLocal_14 = 0.001f;
iLocal_17 = -1;
sLocal_18 = "NULL";
fLocal_23 = 80f;
fLocal_24 = 140f;
fLocal_25 = 180f;
fLocal_28 = 0f;
fLocal_32 = -0.0375f;
fLocal_33 = 0.17f;
iLocal_36 = 3;
iLocal_40 = 1;
iLocal_41 = 65;
iLocal_42 = 49;
iLocal_43 = 64;
fLocal_62 = ((0.05f + 0.275f) - 0.01f);
if (NETWORK::NETWORK_IS_GAME_IN_PROGRESS())
{
if (func_329(PLAYER::PLAYER_ID(), 0, 1))
{
if (!func_325(ScriptParam_0))
{
func_318();
}
}
else
{
func_318();
}
}
else
{
func_318();
}
while (true)
{
func_317();
if (func_310())
{
func_318();
}
if (func_309(1))
{
func_318();
}
func_306();
switch (func_305(NETWORK::PARTICIPANT_ID()))
{
case 0:
if (func_304() == 1 && func_302())
{
func_301(1);
}
break;
case 1:
switch (func_304())
{
case 1:
func_258();
break;
case 2:
func_301(2);
break;
}
break;
case 2:
func_318();
break;
}
if (NETWORK::NETWORK_IS_HOST_OF_THIS_SCRIPT())
{
switch (func_304())
{
case 0:
if (func_22())
{
func_21(1);
}
break;
case 1:
func_1();
break;
case 2:
func_318();
break;
}
}
}
}
void func_1()//Position - 0x183
{
if (func_20() > 0)
{
func_13();
func_4();
}
switch (func_20())
{
case 0:
func_3(1);
break;
case 1:
if (func_2() == 0)
{
}
else
{
func_3(3);
}
break;
case 3:
func_21(2);
break;
}
}
int func_2()//Position - 0x1D9
{
return Local_85.f_4;
}
void func_3(int iParam0)//Position - 0x1E5
{
if (!NETWORK::NETWORK_IS_HOST_OF_THIS_SCRIPT())
{
return;
}
Local_85.f_1 = iParam0;
}
void func_4()//Position - 0x1FE
{
if (func_2() != 0)
{
return;
}
if (func_12(1))
{
func_11(2);
return;
}
if (func_12(5))
{
func_11(3);
return;
}
if (!func_7())
{
if (func_5(PLAYER::PLAYER_ID()))
{
func_11(3);
}
else
{
func_11(1);
}
return;
}
}
bool func_5(int iParam0)//Position - 0x254
{
return func_6(iParam0, 12);
}
var func_6(int iParam0, int iParam1)//Position - 0x264
{
return BitTest(Global_1894573[iParam0 /*608*/].f_10.f_6, iParam1);
}
bool func_7()//Position - 0x27C
{
return func_8(func_10());
}
int func_8(int iParam0)//Position - 0x28C
{
if (NETWORK::NETWORK_DOES_NETWORK_ID_EXIST(iParam0))
{
return !func_9(NETWORK::NET_TO_VEH(iParam0));
}
return 0;
}
int func_9(int iParam0)//Position - 0x2AC
{
if (ENTITY::DOES_ENTITY_EXIST(iParam0))
{
if (ENTITY::IS_ENTITY_DEAD(iParam0, false))
{
return 1;
}
else if (!VEHICLE::IS_VEHICLE_DRIVEABLE(iParam0, false))
{
return 1;
}
}
else
{
return 1;
}
return 0;
}
int func_10()//Position - 0x2E5
{
return Local_85.f_6;
}
void func_11(int iParam0)//Position - 0x2F1
{
if (!NETWORK::NETWORK_IS_HOST_OF_THIS_SCRIPT())
{
return;
}
Local_85.f_4 = iParam0;
}
bool func_12(int iParam0)//Position - 0x30A
{
int iVar0;
int iVar1;
iVar0 = (iParam0 / 32);
iVar1 = (iParam0 % 32);
return BitTest(Local_85.f_2[iVar0], iVar1);
}
void func_13()//Position - 0x32B
{
if (func_19() > 0)
{
if (func_19() != 5)
{
if (!func_7())
{
func_18(5);
}
}
}
switch (func_19())
{
case 0:
func_18(1);
break;
case 1:
if (func_5(func_17()))
{
func_14(func_15(func_16(), 1, 0, 0), 0, 0f, 0, 0, 0, -1);
func_18(2);
}
break;
case 2:
if (func_12(3))
{
func_18(3);
}
break;
case 3:
if (func_12(4))
{
func_18(4);
}
break;
case 4:
break;
case 5:
break;
}
}
void func_14(int iParam0, int iParam1, float fParam2, int iParam3, int iParam4, int iParam5, int iParam6)//Position - 0x3D3
{
struct<9> Var0;
Var0.f_0 = -1603050746;
Var0.f_1 = PLAYER::PLAYER_ID();
Var0.f_7 = iParam6;
Var0.f_4 = iParam1;
Var0.f_5 = iParam4;
Var0.f_2 = fParam2;
Var0.f_3 = iParam3;
Var0.f_6 = iParam5;
Var0.f_8 = MISC::GET_FRAME_COUNT();
if (!iParam0 == 0)
{
SCRIPT::SEND_TU_SCRIPT_EVENT(1, &Var0, 9, iParam0);
}
}
int func_15(int iParam0, int iParam1, bool bParam2, bool bParam3)//Position - 0x42C
{
var uVar0;
int iVar1;
int iVar2;
int iVar3;
iVar1 = 0;
while (iVar1 < 32)
{
iVar3 = PLAYER::INT_TO_PLAYERINDEX(iVar1);
if (func_329(iVar3, 1, 0))
{
if (PED::IS_PED_IN_ANY_VEHICLE(PLAYER::GET_PLAYER_PED(iVar3), bParam3))
{
if (!PLAYER::IS_REMOTE_PLAYER_IN_NON_CLONED_VEHICLE(iVar3))
{
iVar2 = PED::GET_VEHICLE_PED_IS_IN(PLAYER::GET_PLAYER_PED(iVar3), bParam3);
if (iVar2 == iParam0)
{
if (PLAYER::GET_PLAYER_TEAM(iVar3) == PLAYER::GET_PLAYER_TEAM(PLAYER::PLAYER_ID()) || !bParam2)
{
if (iVar3 != PLAYER::PLAYER_ID() || iParam1)
{
MISC::SET_BIT(&uVar0, iVar1);
}
}
}
}
}
}
iVar1++;
}
return uVar0;
}
int func_16()//Position - 0x4BF
{
return NETWORK::NET_TO_VEH(func_10());
}
int func_17()//Position - 0x4CF
{
return Local_85.f_5;
}
void func_18(int iParam0)//Position - 0x4DB
{
if (!NETWORK::NETWORK_IS_HOST_OF_THIS_SCRIPT())
{
return;
}
Local_85.f_6.f_1 = iParam0;
}
int func_19()//Position - 0x4F6
{
return Local_85.f_6.f_1;
}
int func_20()//Position - 0x504
{
return Local_85.f_1;
}
void func_21(int iParam0)//Position - 0x510
{
Local_85.f_0 = iParam0;
}
int func_22()//Position - 0x51C
{
if (!func_12(0))
{
func_257(PLAYER::PLAYER_ID());
func_256(0);
}
if (!func_23())
{
return 0;
}
return 1;
}
int func_23()//Position - 0x547
{
int iVar0;
struct<103> Var1;
int iVar104;
if (NETWORK::NETWORK_DOES_ENTITY_EXIST_WITH_NETWORK_ID(func_10()))
{
return 1;
}
if (!func_309(0))
{
if (func_114(func_255(PLAYER::PLAYER_ID()), &Local_138, &(Local_138.f_3)))
{
func_113(0);
}
}
if (func_111(func_112()) && func_309(0))
{
MISC::CLEAR_AREA(Local_138, 5f, true, false, false, false);
if (func_108(&(Local_85.f_6), func_112(), Local_138, Local_138.f_3, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0))
{
iVar0 = func_16();
VEHICLE::SET_VEHICLE_DIRT_LEVEL(iVar0, 0f);
func_107(iVar0);
ENTITY::SET_PICK_UP_BY_CARGOBOB_DISABLED(iVar0, true);
Var1 = { func_106() };
func_24(iVar0, &Var1, 0, 1, 0);
if (DECORATOR::DECOR_IS_REGISTERED_AS_TYPE("MPBitset", 3))
{
if (DECORATOR::DECOR_EXIST_ON(iVar0, "MPBitset"))
{
iVar104 = DECORATOR::DECOR_GET_INT(iVar0, "MPBitset");
}
MISC::SET_BIT(&iVar104, 11);
DECORATOR::DECOR_SET_INT(iVar0, "MPBitset", iVar104);
}
if (DECORATOR::DECOR_IS_REGISTERED_AS_TYPE("Not_Allow_As_Saved_Veh", 3))
{
DECORATOR::DECOR_SET_INT(iVar0, "Not_Allow_As_Saved_Veh", 1);
}
VEHICLE::SET_DONT_ALLOW_PLAYER_TO_ENTER_VEHICLE_IF_LOCKED_FOR_PLAYER(iVar0, true);
VEHICLE::SET_VEHICLE_RESPECTS_LOCKS_WHEN_HAS_DRIVER(iVar0, true);
STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(func_112());
return 1;
}
}
return 0;
}
void func_24(int iParam0, var uParam1, bool bParam2, bool bParam3, bool bParam4)//Position - 0x655
{
int iVar0;
float fVar1;
if (ENTITY::DOES_ENTITY_EXIST(iParam0) && VEHICLE::IS_VEHICLE_DRIVEABLE(iParam0, false))
{
if ((NETWORK::NETWORK_IS_GAME_IN_PROGRESS() && NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(iParam0)) || !NETWORK::NETWORK_IS_GAME_IN_PROGRESS())
{
iVar0 = ENTITY::GET_ENTITY_MODEL(iParam0);
if (PLAYER::PLAYER_ID() != func_105())
{
uParam1->f_100 = PLAYER::PLAYER_ID();
}
if (uParam1->f_70 == 0)
{
uParam1->f_70 = 1;
}
func_81(iParam0, uParam1, bParam2, bParam3);
if (uParam1->f_102 != 0)
{
if (uParam1->f_102 == 2)
{
VEHICLE::SET_VEHICLE_TYRES_CAN_BURST(iParam0, true);
VEHICLE::SET_DRIFT_TYRES(iParam0, false);
}
else if (uParam1->f_102 == 1)
{
VEHICLE::SET_VEHICLE_TYRES_CAN_BURST(iParam0, false);
VEHICLE::SET_DRIFT_TYRES(iParam0, false);
}
else if (uParam1->f_102 == 3)
{
VEHICLE::SET_VEHICLE_TYRES_CAN_BURST(iParam0, true);
VEHICLE::SET_DRIFT_TYRES(iParam0, true);
}
}
if (func_80(ENTITY::GET_ENTITY_MODEL(iParam0)))
{
if (uParam1->f_9[44] == 2)
{
VEHICLE::SET_VEHICLE_ALLOW_HOMING_MISSLE_LOCKON_SYNCED(iParam0, false, true);
}
else
{
VEHICLE::SET_VEHICLE_ALLOW_HOMING_MISSLE_LOCKON_SYNCED(iParam0, true, true);
}
}
if (!uParam1->f_78 == -1 && uParam1->f_9[14] == -1)
{
AUDIO::OVERRIDE_VEH_HORN(iParam0, true, uParam1->f_78);
}
if (!uParam1->f_79 == -1)
{
AUDIO::SET_VEHICLE_HORN_SOUND_INDEX(iParam0, uParam1->f_79);
}
if (func_79(uParam1->f_66, &fVar1) && uParam1->f_80 != fVar1)
{
uParam1->f_80 = fVar1;
}
VEHICLE::SET_VEHICLE_ENVEFF_SCALE(iParam0, uParam1->f_80);
VEHICLE::SET_VEHICLE_EXTRA_COLOUR_5(iParam0, uParam1->f_97);
if (uParam1->f_99 >= 0)
{
VEHICLE::SET_VEHICLE_EXTRA_COLOUR_6(iParam0, uParam1->f_99);
}
if (func_78(iParam0))
{
func_72(iParam0, func_75(uParam1->f_74, uParam1->f_75, uParam1->f_76));
}
if (VEHICLE::GET_VEHICLE_LIVERY2_COUNT(iParam0) > 1 && uParam1->f_98 >= 0)
{
VEHICLE::SET_VEHICLE_LIVERY2(iParam0, uParam1->f_98);
}
if (BitTest(uParam1->f_95, 0))
{
func_43(iParam0, &(uParam1->f_81));
}
if ((!func_34(4) && !bParam4) && !NETWORK::NETWORK_IS_ACTIVITY_SESSION())
{
func_28(iParam0);
}
if (func_27(iVar0))
{
switch (uParam1->f_9[5])
{
case 0:
VEHICLE::REMOVE_VEHICLE_MOD(iParam0, 16);
break;
case 1:
VEHICLE::REMOVE_VEHICLE_MOD(iParam0, 16);
if ((VEHICLE::IS_VEHICLE_MODEL(iParam0, joaat("scarab")) || VEHICLE::IS_VEHICLE_MODEL(iParam0, joaat("scarab2"))) || VEHICLE::IS_VEHICLE_MODEL(iParam0, joaat("scarab3")))
{
VEHICLE::SET_VEHICLE_MOD(iParam0, 16, 0, false);
}
else
{
VEHICLE::SET_VEHICLE_MOD(iParam0, 16, 2, false);
}
break;
case 2:
VEHICLE::REMOVE_VEHICLE_MOD(iParam0, 16);
if ((VEHICLE::IS_VEHICLE_MODEL(iParam0, joaat("scarab")) || VEHICLE::IS_VEHICLE_MODEL(iParam0, joaat("scarab2"))) || VEHICLE::IS_VEHICLE_MODEL(iParam0, joaat("scarab3")))
{
VEHICLE::SET_VEHICLE_MOD(iParam0, 16, 1, false);
}
else
{
VEHICLE::SET_VEHICLE_MOD(iParam0, 16, 3, false);
}
break;
case 3:
VEHICLE::REMOVE_VEHICLE_MOD(iParam0, 16);
if ((VEHICLE::IS_VEHICLE_MODEL(iParam0, joaat("scarab")) || VEHICLE::IS_VEHICLE_MODEL(iParam0, joaat("scarab2"))) || VEHICLE::IS_VEHICLE_MODEL(iParam0, joaat("scarab3")))
{
VEHICLE::SET_VEHICLE_MOD(iParam0, 16, 2, false);
}
else
{
VEHICLE::SET_VEHICLE_MOD(iParam0, 16, 4, false);
}
break;
default:
if (uParam1->f_9[5] != -1)
{
VEHICLE::REMOVE_VEHICLE_MOD(iParam0, 16);
if ((VEHICLE::IS_VEHICLE_MODEL(iParam0, joaat("scarab")) || VEHICLE::IS_VEHICLE_MODEL(iParam0, joaat("scarab2"))) || VEHICLE::IS_VEHICLE_MODEL(iParam0, joaat("scarab3")))
{
VEHICLE::SET_VEHICLE_MOD(iParam0, 16, 2, false);
}
else
{
VEHICLE::SET_VEHICLE_MOD(iParam0, 16, 4, false);
}
}
break;
}
}
if (func_26(ENTITY::GET_ENTITY_MODEL(iParam0)))
{
switch (uParam1->f_9[5])
{
case 1:
VEHICLE::SET_VEHICLE_EXPLODES_ON_HIGH_EXPLOSION_DAMAGE(iParam0, false);
VEHICLE::SET_VEHICLE_STRONG(iParam0, true);
if (uParam1->f_9[16] == 5)
{
VEHICLE::SET_VEHICLE_DAMAGE_SCALE(iParam0, (Global_262145.f_21747 /* Tunable: -1001087518 */ + 0.05f));
}
else
{
VEHICLE::SET_VEHICLE_DAMAGE_SCALE(iParam0, Global_262145.f_21747 /* Tunable: -1001087518 */);
}
VEHICLE::SET_VEHICLE_EXPLODES_ON_EXPLOSION_DAMAGE_AT_ZERO_BODY_HEALTH(iParam0, true);
break;
default:
VEHICLE::SET_VEHICLE_EXPLODES_ON_HIGH_EXPLOSION_DAMAGE(iParam0, false);
VEHICLE::SET_VEHICLE_DAMAGE_SCALE(iParam0, 1f);
VEHICLE::SET_VEHICLE_EXPLODES_ON_EXPLOSION_DAMAGE_AT_ZERO_BODY_HEALTH(iParam0, true);
break;
}
}
switch (uParam1->f_94)
{
case 0:
break;
case 1:
if (BitTest(uParam1->f_95, 1) && BitTest(uParam1->f_95, 2))
{
if (BitTest(uParam1->f_95, 3))
{
}
}
else if (DECORATOR::DECOR_IS_REGISTERED_AS_TYPE("Player_Vehicle", 3))
{
DECORATOR::DECOR_SET_INT(iParam0, "Player_Vehicle", -1);
}
break;
case 2:
if (BitTest(uParam1->f_95, 1) && BitTest(uParam1->f_95, 2))
{
if (DECORATOR::DECOR_IS_REGISTERED_AS_TYPE("Veh_Modded_By_Player", 3))
{
DECORATOR::DECOR_SET_INT(iParam0, "Veh_Modded_By_Player", NETWORK::NETWORK_HASH_FROM_PLAYER_HANDLE(PLAYER::PLAYER_ID()));
}
}
else if (DECORATOR::DECOR_IS_REGISTERED_AS_TYPE("Veh_Modded_By_Player", 3))
{
if (func_25(uParam1->f_81) && NETWORK::NETWORK_IS_GAMER_IN_MY_SESSION(&(uParam1->f_81)))
{
DECORATOR::DECOR_SET_INT(iParam0, "Veh_Modded_By_Player", NETWORK::NETWORK_HASH_FROM_PLAYER_HANDLE(NETWORK::NETWORK_GET_PLAYER_FROM_GAMER_HANDLE(&(uParam1->f_81))));
}
else
{
DECORATOR::DECOR_SET_INT(iParam0, "Veh_Modded_By_Player", -1);
}
}
break;
case 3:
break;
case 4:
break;
}
}
}
}
bool func_25(var uParam0, var uParam1, var uParam2, var uParam3, var uParam4, var uParam5, var uParam6, var uParam7, var uParam8, var uParam9, var uParam10, var uParam11, var uParam12)//Position - 0xB2C
{
return NETWORK::NETWORK_IS_HANDLE_VALID(&uParam0, 13);
}
bool func_26(int iParam0)//Position - 0xB3C
{
return func_80(iParam0);
}
int func_27(int iParam0)//Position - 0xB4A
{
switch (iParam0)
{
case joaat("pounder2"):
case joaat("mule4"):
case joaat("speedo4"):
case joaat("imperator"):
case joaat("deathbike"):
case joaat("cerberus"):
case joaat("bruiser"):
case joaat("dominator4"):
case joaat("zr380"):
case joaat("issi4"):
case joaat("imperator2"):
case joaat("deathbike2"):
case joaat("cerberus2"):
case joaat("bruiser2"):
case joaat("dominator5"):
case joaat("zr3802"):
case joaat("issi5"):
case joaat("imperator3"):
case joaat("deathbike3"):
case joaat("cerberus3"):
case joaat("bruiser3"):
case joaat("dominator6"):
case joaat("zr3803"):
case joaat("issi6"):
case joaat("impaler2"):
case joaat("impaler3"):
case joaat("impaler4"):
case joaat("slamvan4"):
case joaat("slamvan5"):
case joaat("slamvan6"):
case joaat("monster3"):
case joaat("monster4"):
case joaat("monster5"):
case joaat("scarab"):
case joaat("scarab2"):
case joaat("scarab3"):
case joaat("brutus"):
case joaat("brutus2"):
case joaat("brutus3"):
return 1;
break;
}
return 0;
}
void func_28(int iParam0)//Position - 0xC4B
{
struct<3> Var0;
if (Global_262145.f_20156 /* Tunable: 1239690786 */)
{
if (ENTITY::DOES_ENTITY_EXIST(iParam0))
{
if (NETWORK::NETWORK_GET_ENTITY_IS_NETWORKED(iParam0))
{
Var0.f_0 = ENTITY::GET_ENTITY_MODEL(iParam0);
Var0.f_1 = MISC::GET_HASH_KEY(VEHICLE::GET_VEHICLE_NUMBER_PLATE_TEXT(iParam0));
if (DECORATOR::DECOR_IS_REGISTERED_AS_TYPE("RandomID", 3))
{
if (!DECORATOR::DECOR_EXIST_ON(iParam0, "RandomID"))
{
Var0.f_2 = MISC::GET_RANDOM_INT_IN_RANGE(0, 65535);
DECORATOR::DECOR_SET_INT(iParam0, "RandomID", Var0.f_2);
}
else
{
Var0.f_2 = DECORATOR::DECOR_GET_INT(iParam0, "RandomID");
}
}
func_29(Var0);
}
}
}
}
void func_29(struct<3> Param0)//Position - 0xCD6
{
struct<3> Var0;
Var0.f_0 = -1745262668;
Var0.f_1 = PLAYER::PLAYER_ID();
Var0.f_2 = Param0.f_0;
Var0.f_2.f_1 = Param0.f_1;
Var0.f_2.f_2 = Param0.f_2;
SCRIPT::SEND_TU_SCRIPT_EVENT(1, &Var0, 5, func_30(1, 1));
}
var func_30(int iParam0, bool bParam1)//Position - 0xD15
{
var uVar0;
int iVar1;
int iVar2;
iVar1 = 0;
while (iVar1 < 32)
{
iVar2 = PLAYER::INT_TO_PLAYERINDEX(iVar1);
if (func_329(iVar2, 0, 0))
{
if (iVar2 != PLAYER::PLAYER_ID() || iParam0)
{
if (bParam1)
{
MISC::SET_BIT(&uVar0, iVar1);
}
else if (!func_31(iVar2, 0))
{
MISC::SET_BIT(&uVar0, iVar1);
}
}
}
iVar1++;
}
return uVar0;
}
bool func_31(int iParam0, int iParam1)//Position - 0xD7A
{
bool bVar0;
if (iParam0 == PLAYER::PLAYER_ID())
{
bVar0 = func_32(-1, 0) == 8;
}
else
{
bVar0 = Global_1853910[iParam0 /*862*/].f_205 == 8;
}
if (iParam1 == 1)
{
if (NETWORK::NETWORK_IS_PLAYER_ACTIVE(iParam0))
{
bVar0 = PLAYER::GET_PLAYER_TEAM(iParam0) == 8;
}
}
return bVar0;
}
int func_32(int iParam0, bool bParam1)//Position - 0xDC5
{
int iVar0;
int iVar1;
iVar1 = iParam0;
if (iVar1 == -1)
{
iVar1 = func_33();
}
if (Global_1575040[iVar1] == 1)
{
if (bParam1)
{
}
iVar0 = 8;
}
else
{
iVar0 = Global_1574912[iVar1];
if (bParam1)
{
}
}
return iVar0;
}
int func_33()//Position - 0xE06
{
return Global_1574918;
}
int func_34(int iParam0)//Position - 0xE12
{
int iVar0;
if (func_42())
{
iVar0 = 0;
while (iVar0 < 60)
{
if (func_41(iVar0) == iParam0)
{
if (func_35(iVar0))
{
return 1;
}
}
iVar0++;
}
}
return 0;
}
bool func_35(int iParam0)//Position - 0xE4D
{
return func_36(iParam0, 6, 1);
}
int func_36(int iParam0, int iParam1, bool bParam2)//Position - 0xE5D
{
if (iParam0 == -1)
{
return 0;
}
if (bParam2)
{
return BitTest(Global_100733.f_1407[iParam0], iParam1);
}
else if (NETWORK::NETWORK_IS_GAME_IN_PROGRESS())
{
if (func_40() == 0)
{
return BitTest(func_37(func_39(iParam0), -1, 0), iParam1);
}
}
else
{
return BitTest(Global_113648.f_668[iParam0], iParam1);
}
return 0;
}
int func_37(int iParam0, int iParam1, int iParam2)//Position - 0xEBE
{
int iVar0;
var uVar1;