-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRScript.lua
More file actions
2324 lines (2005 loc) · 79.2 KB
/
Copy pathRScript.lua
File metadata and controls
2324 lines (2005 loc) · 79.2 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
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
----------------------------------------------------------------
-- Author: Rostal
-- Github: https://github.com/TCRoid/YimMenu-Lua-RScript
----------------------------------------------------------------
local SUPPORT_GAME_VERSION <const> = "1.70-3411"
--#region check game version
script.run_in_fiber(function()
local build_version = memory.scan_pattern("8B C3 33 D2 C6 44 24 20"):add(0x24):rip()
local online_version = build_version:add(0x20)
local CURRENT_GAME_VERSION <const> = string.format("%s-%s", online_version:get_string(), build_version:get_string())
if SUPPORT_GAME_VERSION ~= CURRENT_GAME_VERSION then
gui.show_message("[RScript]", "未兼容当前游戏版本, 部分功能可能会失效")
end
end)
--#endregion
require("RScript.tables")
require("RScript.functions")
self = nil
MainLoop = {} -- No Delay
--------------------------------
-- Locals
--------------------------------
Locals = {
["fm_mission_controller"] = {
sFMMC_SBD = {
-- MC_serverBD_1.sFMMC_SBD.niVehicle[index]
niVehicle = 22995 + 834 + 81 + 1
},
},
["fm_mission_controller_2020"] = {
sFMMC_SBD = {
-- MC_serverBD_1.sFMMC_SBD.niVehicle[index]
niVehicle = 55623 + 777 + 81 + 1
},
},
}
----------------------------------------
-- Menu: Main
----------------------------------------
local menu_root <const> = gui.add_tab("RScript")
local MenuMain = { _parent = menu_root }
----------------
-- 自我
----------------
menu_root:add_text("<< 自我 >>")
menu.add_input_float(MenuMain, "生命恢复速率", 1.0, "[ 0.0 ~ 100.0 ]")
menu.add_input_float(MenuMain, "生命恢复程度", 0.5, "[ 0.0 ~ 1.0 ]")
menu.add_toggle_loop(MenuMain, "自定义设置生命恢复", "", function()
local rate = menu.get_input_value(MenuMain["生命恢复速率"], 0.0, 100.0)
local percent = menu.get_input_value(MenuMain["生命恢复程度"], 0.0, 1.0)
PLAYER.SET_PLAYER_HEALTH_RECHARGE_MULTIPLIER(PLAYER.PLAYER_ID(), rate)
PLAYER.SET_PLAYER_HEALTH_RECHARGE_MAX_PERCENT(PLAYER.PLAYER_ID(), percent)
end, function()
PLAYER.SET_PLAYER_HEALTH_RECHARGE_MULTIPLIER(PLAYER.PLAYER_ID(), 1.0)
PLAYER.SET_PLAYER_HEALTH_RECHARGE_MAX_PERCENT(PLAYER.PLAYER_ID(), 0.5)
end)
menu_root:add_separator()
menu.add_input_float(MenuMain, "自我受伤倍数", 1.0, "[ 0.1 ~ 1.0 ]")
menu.add_toggle_loop(MenuMain, "自定义设置受伤倍数", "(数值越低,受到的伤害就越低)", function()
local value = menu.get_input_value(MenuMain["自我受伤倍数"], 0.1, 1.0)
PLAYER.SET_PLAYER_WEAPON_DEFENSE_MODIFIER(PLAYER.PLAYER_ID(), value)
PLAYER.SET_PLAYER_WEAPON_MINIGUN_DEFENSE_MODIFIER(PLAYER.PLAYER_ID(), value)
PLAYER.SET_PLAYER_MELEE_WEAPON_DEFENSE_MODIFIER(PLAYER.PLAYER_ID(), value)
PLAYER.SET_PLAYER_VEHICLE_DEFENSE_MODIFIER(PLAYER.PLAYER_ID(), value)
PLAYER.SET_PLAYER_WEAPON_TAKEDOWN_DEFENSE_MODIFIER(PLAYER.PLAYER_ID(), value)
end, function()
PLAYER.SET_PLAYER_WEAPON_DEFENSE_MODIFIER(PLAYER.PLAYER_ID(), 1.0)
PLAYER.SET_PLAYER_WEAPON_MINIGUN_DEFENSE_MODIFIER(PLAYER.PLAYER_ID(), 1.0)
PLAYER.SET_PLAYER_MELEE_WEAPON_DEFENSE_MODIFIER(PLAYER.PLAYER_ID(), 1.0)
PLAYER.SET_PLAYER_VEHICLE_DEFENSE_MODIFIER(PLAYER.PLAYER_ID(), 1.0)
PLAYER.SET_PLAYER_WEAPON_TAKEDOWN_DEFENSE_MODIFIER(PLAYER.PLAYER_ID(), 1.0)
end)
menu_root:add_separator()
menu.add_toggle_loop(MenuMain, "步行时人称视角快捷切换", "(第一人称视角 和 第三人称近距离视角 快捷切换)", function()
if CAM.IS_FOLLOW_PED_CAM_ACTIVE() then
if CAM.GET_FOLLOW_PED_CAM_VIEW_MODE() == 1 or CAM.GET_FOLLOW_PED_CAM_VIEW_MODE() == 2 then
CAM.SET_FOLLOW_PED_CAM_VIEW_MODE(4)
end
end
end)
menu_root:add_button("强制进入警星闪烁状态", function()
PLAYER.FORCE_START_HIDDEN_EVASION(PLAYER.PLAYER_ID())
end)
menu_root:add_sameline()
menu.add_toggle_loop(MenuMain, "禁止刷出警察", "(通缉前开启,仅单人时有效)", function()
PLAYER.SET_DISPATCH_COPS_FOR_PLAYER(PLAYER.PLAYER_ID(), false)
end, function()
PLAYER.SET_DISPATCH_COPS_FOR_PLAYER(PLAYER.PLAYER_ID(), true)
end)
menu_root:add_separator()
----------------
-- 载具
----------------
menu_root:add_text("<< 载具 >>")
menu.add_toggle_loop(MenuMain, "无限动能回收加速", "", function()
local vehicle = get_user_vehicle(false)
if vehicle ~= 0 then
if VEHICLE.GET_VEHICLE_HAS_KERS(vehicle) then
local vehicle_ptr = memory.handle_to_ptr(vehicle)
--local kers_boost_max = vehicle_ptr:add(0x92c):get_float()
vehicle_ptr:add(0x930):set_float(3.0) -- m_kers_boost
end
end
end)
menu_root:add_sameline()
menu.add_toggle_button(MenuMain, "电台只播放音乐", false, function(toggle)
for _, stationName in pairs(T.VehicleRadioStations) do
AUDIO.SET_RADIO_STATION_MUSIC_ONLY(stationName, toggle)
end
end)
menu_root:add_sameline()
menu_root:add_button("移除当前载具通缉状态", function()
local vehicle = get_user_vehicle()
if vehicle ~= 0 then
clear_vehicle_wanted(vehicle)
toast("完成!")
end
end)
menu_root:add_separator()
menu.add_toggle(MenuMain, "性能升级", true)
menu_root:add_sameline()
menu.add_toggle(MenuMain, "涡轮增压", true)
menu_root:add_sameline()
menu.add_toggle(MenuMain, "属性强化", true, "(提高防炸性等)")
menu.add_input_float(MenuMain, "载具受伤倍数", 0.5, "[ 0.0 ~ 1.0 ]")
menu_root:add_text("(数值越低,受到的伤害就越低)")
menu_root:add_button("强化当前或上一辆载具", function()
local vehicle = get_user_vehicle()
if vehicle == 0 then
notify("强化载具", "请先进入一辆载具")
return
end
if MenuMain["性能升级"]:is_enabled() then
for _, mod_type in pairs({ 11, 12, 13, 16 }) do
local mod_num = VEHICLE.GET_NUM_VEHICLE_MODS(vehicle, mod_type)
VEHICLE.SET_VEHICLE_MOD(vehicle, mod_type, mod_num - 1, false)
end
end
if MenuMain["涡轮增压"]:is_enabled() then
VEHICLE.TOGGLE_VEHICLE_MOD(vehicle, 18, true)
end
if MenuMain["属性强化"]:is_enabled() then
strong_vehicle(vehicle)
end
local damage_scale = menu.get_input_value(MenuMain["载具受伤倍数"], 0.0, 1.0)
VEHICLE.SET_VEHICLE_DAMAGE_SCALE(vehicle, damage_scale)
VEHICLE.SET_VEHICLE_WEAPON_DAMAGE_SCALE(vehicle, damage_scale)
notify("强化载具", "完成!")
end)
menu_root:add_sameline()
menu_root:add_button("弱化当前或上一辆载具", function()
local vehicle = get_user_vehicle()
if vehicle == 0 then
notify("弱化载具", "请先进入一辆载具")
return
end
for i = 0, 5 do
if VEHICLE.GET_IS_DOOR_VALID(vehicle, i) then
VEHICLE.SET_DOOR_ALLOWED_TO_BE_BROKEN_OFF(vehicle, i, true)
end
end
VEHICLE.SET_VEHICLE_HAS_UNBREAKABLE_LIGHTS(vehicle, false)
VEHICLE.SET_VEHICLE_CAN_BREAK(vehicle, true)
ENTITY.SET_ENTITY_MAX_HEALTH(vehicle, 1000)
SET_ENTITY_HEALTH(vehicle, 1000)
VEHICLE.SET_VEHICLE_ENGINE_HEALTH(vehicle, 1000)
VEHICLE.SET_VEHICLE_BODY_HEALTH(vehicle, 1000)
VEHICLE.SET_VEHICLE_PETROL_TANK_HEALTH(vehicle, 1000)
VEHICLE.SET_HELI_MAIN_ROTOR_HEALTH(vehicle, 1000)
VEHICLE.SET_HELI_TAIL_ROTOR_HEALTH(vehicle, 1000)
VEHICLE.SET_VEHICLE_DAMAGE_SCALE(vehicle, 1.0)
VEHICLE.SET_VEHICLE_WEAPON_DAMAGE_SCALE(vehicle, 1.0)
VEHICLE.SET_VEHICLE_NO_EXPLOSION_DAMAGE_FROM_DRIVER(vehicle, false)
VEHICLE.SET_VEHICLE_WHEELS_CAN_BREAK(vehicle, true)
VEHICLE.SET_VEHICLE_CAN_ENGINE_MISSFIRE(vehicle, true)
VEHICLE.SET_VEHICLE_CAN_LEAK_OIL(vehicle, true)
VEHICLE.SET_VEHICLE_CAN_LEAK_PETROL(vehicle, true)
VEHICLE.SET_DISABLE_VEHICLE_ENGINE_FIRES(vehicle, false)
VEHICLE.SET_DISABLE_VEHICLE_PETROL_TANK_FIRES(vehicle, false)
VEHICLE.SET_DISABLE_VEHICLE_PETROL_TANK_DAMAGE(vehicle, false)
VEHICLE.SET_VEHICLE_STRONG(vehicle, false)
VEHICLE.SET_VEHICLE_HAS_STRONG_AXLES(vehicle, false)
VEHICLE.VEHICLE_SET_RAMP_AND_RAMMING_CARS_TAKE_DAMAGE(vehicle, true)
VEHICLE.SET_INCREASE_WHEEL_CRUSH_DAMAGE(vehicle, true)
VEHICLE.SET_DISABLE_DAMAGE_WITH_PICKED_UP_ENTITY(vehicle, 0)
VEHICLE.SET_VEHICLE_USES_MP_PLAYER_DAMAGE_MULTIPLIER(vehicle, 0)
VEHICLE.SET_FORCE_VEHICLE_ENGINE_DAMAGE_BY_BULLET(vehicle, true)
VEHICLE.SET_DISABLE_EXPLODE_FROM_BODY_DAMAGE_ON_COLLISION(vehicle, 0)
VEHICLE.SET_VEHICLE_EXPLODES_ON_HIGH_EXPLOSION_DAMAGE(vehicle, true)
VEHICLE.SET_VEHICLE_EXPLODES_ON_EXPLOSION_DAMAGE_AT_ZERO_BODY_HEALTH(vehicle, true)
VEHICLE.SET_HELI_TAIL_BOOM_CAN_BREAK_OFF(vehicle, true)
VEHICLE.SET_DISABLE_HELI_EXPLODE_FROM_BODY_DAMAGE(vehicle, 0)
VEHICLE.SET_PLANE_RESIST_TO_EXPLOSION(vehicle, false)
VEHICLE.SET_HELI_RESIST_TO_EXPLOSION(vehicle, false)
notify("弱化载具", "完成!")
end)
menu_root:add_separator()
----------------
-- 实体
----------------
menu_root:add_text("<< 实体 >>")
local entity_t = {
npc_type_select = 0
}
function entity_t.check_ped_type(ped)
if PED.IS_PED_A_PLAYER(ped) then
return false
end
if entity_t.npc_type_select == 0 and not is_friendly_ped(ped) then
return true
end
if entity_t.npc_type_select == 1 and is_hostile_ped(ped) then
return true
end
if entity_t.npc_type_select == 2 then
return true
end
return false
end
function entity_t.is_cop_ped(ped)
local hash = ENTITY.GET_ENTITY_MODEL(ped)
return hash == 1581098148 or hash == 2974087609 or hash == 2374966032
end
menu_root:add_imgui(function()
entity_t.npc_type_select, clicked = ImGui.Combo("选择NPC类型", entity_t.npc_type_select, {
"全部NPC (排除友好)", "仅敌对NPC", "全部NPC"
}, 3)
end)
menu_root:add_button("NPC 删除", function()
script.run_in_fiber(function()
for _, ped in pairs(entities.get_all_peds_as_handles()) do
if entity_t.check_ped_type(ped) then
delete_entity(ped)
end
end
end)
end)
menu_root:add_sameline()
menu_root:add_button("NPC 死亡", function()
script.run_in_fiber(function()
for _, ped in pairs(entities.get_all_peds_as_handles()) do
if not ENTITY.IS_ENTITY_DEAD(ped) and entity_t.check_ped_type(ped) then
SET_ENTITY_HEALTH(ped, 0)
end
end
end)
end)
menu_root:add_sameline()
menu_root:add_button("NPC 爆头击杀", function()
script.run_in_fiber(function()
local weaponHash = joaat("WEAPON_APPISTOL")
for _, ped in pairs(entities.get_all_peds_as_handles()) do
if not ENTITY.IS_ENTITY_DEAD(ped) and entity_t.check_ped_type(ped) then
shoot_ped_head(ped, weaponHash, PLAYER.PLAYER_PED_ID())
end
end
end)
end)
menu_root:add_separator()
menu.add_toggle_loop(MenuMain, "警察 删除", "", function()
for _, ped in pairs(entities.get_all_peds_as_handles()) do
if entity_t.is_cop_ped(ped) then
delete_entity(ped)
end
end
end)
menu_root:add_sameline()
menu.add_toggle_loop(MenuMain, "警察 死亡", "", function()
for _, ped in pairs(entities.get_all_peds_as_handles()) do
if entity_t.is_cop_ped(ped) then
SET_ENTITY_HEALTH(ped, 0)
end
end
end)
menu_root:add_sameline()
menu_root:add_button("友方NPC 无敌强化", function()
script.run_in_fiber(function()
for _, ped in pairs(entities.get_all_peds_as_handles()) do
if not ENTITY.IS_ENTITY_DEAD(ped) and not PED.IS_PED_A_PLAYER(ped) then
if is_friendly_ped(ped) then
strong_ped_combat(ped, true)
end
end
end
end)
end)
menu_root:add_sameline()
menu_root:add_button("友方NPC 给予武器", function()
script.run_in_fiber(function()
for _, ped in pairs(entities.get_all_peds_as_handles()) do
if not ENTITY.IS_ENTITY_DEAD(ped) and not PED.IS_PED_A_PLAYER(ped) then
if is_friendly_ped(ped) then
for _, weaponHash in pairs(T.CommonWeapons) do
WEAPON.GIVE_DELAYED_WEAPON_TO_PED(ped, weaponHash, -1, false)
end
end
end
end
end)
end)
menu_root:add_separator()
menu_root:add_text("敌对实体")
menu_root:add_button("爆炸敌对NPC", function()
script.run_in_fiber(function()
for _, ped in pairs(entities.get_all_peds_as_handles()) do
if is_hostile_entity(ped) then
local coords = ENTITY.GET_ENTITY_COORDS(ped)
FIRE.ADD_OWNED_EXPLOSION(PLAYER.PLAYER_PED_ID(), coords.x, coords.y, coords.z,
4, 100.0, false, false, 0.0)
end
end
end)
end)
menu_root:add_sameline()
menu_root:add_button("摧毁敌对载具", function()
script.run_in_fiber(function()
for _, vehicle in pairs(entities.get_all_vehicles_as_handles()) do
if is_hostile_entity(vehicle) then
SET_ENTITY_HEALTH(vehicle, 0)
VEHICLE.SET_VEHICLE_ENGINE_HEALTH(vehicle, -4000.0)
local coords = ENTITY.GET_ENTITY_COORDS(vehicle)
FIRE.ADD_OWNED_EXPLOSION(PLAYER.PLAYER_PED_ID(), coords.x, coords.y, coords.z,
4, 100.0, false, false, 0.0)
end
end
end)
end)
menu_root:add_sameline()
menu_root:add_button("摧毁敌对物体", function()
script.run_in_fiber(function()
for _, object in pairs(entities.get_all_objects_as_handles()) do
if is_hostile_entity(object) then
SET_ENTITY_HEALTH(object, 0)
local coords = ENTITY.GET_ENTITY_COORDS(object)
FIRE.ADD_OWNED_EXPLOSION(PLAYER.PLAYER_PED_ID(), coords.x, coords.y, coords.z,
4, 100.0, false, false, 0.0)
end
end
end)
end)
menu_root:add_separator()
menu_root:add_text("拾取物")
menu.add_toggle(MenuMain, "仅任务拾取物", true)
menu_root:add_sameline()
menu_root:add_button("拾取物 传送到我", function()
script.run_in_fiber(function()
for _, pickup in pairs(get_all_pickups_as_handles()) do
if MenuMain["仅任务拾取物"]:is_enabled() and not ENTITY.IS_ENTITY_A_MISSION_ENTITY(pickup) then
goto continue
end
OBJECT.SET_PICKUP_OBJECT_COLLECTABLE_IN_VEHICLE(pickup)
tp_entity_to_me(pickup)
::continue::
end
end)
end)
----------------------------------------
-- Menu: Mission
----------------------------------------
local menu_mission <const> = menu_root:add_tab("[RS] 任务助手")
local MenuMission = { _parent = menu_mission }
----------------
-- 日常任务
----------------
menu_mission:add_text("<< 日常任务 >>")
menu_mission:add_button("传送到 藏匿屋", function()
local blip = HUD.GET_CLOSEST_BLIP_INFO_ID(845)
if HUD.DOES_BLIP_EXIST(blip) then
local coords = HUD.GET_BLIP_COORDS(blip)
teleport(coords)
else
notify("传送到藏匿屋", "未在地图上找到藏匿屋")
end
end)
menu_mission:add_sameline()
menu_mission:add_button("通知藏匿屋密码", function()
if get_user_interior() == 289793 then
local code_list = {
[4221637939] = "01-23-45",
[1433270535] = "02-12-87",
[944906360] = "05-02-91",
[3046060548] = "24-10-81",
[1626709912] = "28-03-98",
[921471402] = "28-11-97",
[3648550039] = "44-23-37",
[4136820571] = "72-68-83",
[1083248297] = "73-27-38",
[2104921722] = "77-79-73",
}
for _, obj in pairs(entities.get_all_objects_as_handles()) do
if ENTITY.IS_ENTITY_A_MISSION_ENTITY(obj) then
local hash = ENTITY.GET_ENTITY_MODEL(obj)
if code_list[hash] ~= nil then
notify("藏匿屋密码", code_list[hash])
end
end
end
end
end)
menu_mission:add_sameline()
menu_mission:add_button("传送到 杰拉德包裹", function()
local blip = HUD.GET_CLOSEST_BLIP_INFO_ID(842)
if HUD.DOES_BLIP_EXIST(blip) then
local coords = HUD.GET_BLIP_COORDS(blip)
teleport(coords)
else
notify("传送到杰拉德包裹", "未在地图上找到杰拉德包裹")
end
end)
menu_mission:add_sameline()
menu_mission:add_button("进入范围后,传送到包裹", function()
local entity_list = get_entities_by_hash(ENTITY_OBJECT, true, 138777325, 2674233009, 765087784)
if next(entity_list) ~= nil then
for _, ent in pairs(entity_list) do
tp_to_entity(ent, 0.0, 0.0, 0.5)
end
end
end)
menu_mission:add_button("传送到 电脑", function()
local blip = HUD.GET_CLOSEST_BLIP_INFO_ID(521)
if HUD.DOES_BLIP_EXIST(blip) then
local coords = HUD.GET_BLIP_COORDS(blip)
teleport2(coords.x - 1.0, coords.y + 1.0, coords.z)
end
end)
menu_mission:add_sameline()
menu_mission:add_button("传送到 夜总会VIP客户", function()
local blip = HUD.GET_NEXT_BLIP_INFO_ID(480)
if HUD.DOES_BLIP_EXIST(blip) then
local coords = HUD.GET_BLIP_COORDS(blip)
teleport2(coords.x, coords.y, coords.z + 0.8)
end
end)
menu_mission:add_sameline()
menu_mission:add_button("传送到 地图蓝点", function()
local blip = HUD.GET_NEXT_BLIP_INFO_ID(143)
if HUD.DOES_BLIP_EXIST(blip) then
local coords = HUD.GET_BLIP_COORDS(blip)
teleport2(coords.x, coords.y, coords.z + 0.8)
end
end)
menu_mission:add_sameline()
menu_mission:add_button("出口载具 传送到我", function()
local blip = HUD.GET_NEXT_BLIP_INFO_ID(143)
if HUD.DOES_BLIP_EXIST(blip) then
local ent = HUD.GET_BLIP_INFO_ID_ENTITY_INDEX(blip)
if ENTITY.IS_ENTITY_A_VEHICLE(ent) then
tp_vehicle_to_me(ent)
end
end
end)
menu_mission:add_button("打开恐霸电脑", function()
start_game_script("apphackertruck")
end)
menu_mission:add_sameline()
menu.add_toggle_loop(MenuMission, "跳过NPC对话", "", function()
if AUDIO.IS_SCRIPTED_CONVERSATION_ONGOING() then
AUDIO.STOP_SCRIPTED_CONVERSATION(false)
end
end)
menu_mission:add_sameline()
menu.add_toggle(MenuMission, "自动收集财物", false, "(模拟鼠标左键点击拿取财物,不要一直开启)")
menu_mission:add_separator()
----------------
-- 资产任务
----------------
menu_mission:add_text("<< 资产任务 >>")
menu_mission:add_text("办公室拉货")
menu_mission:add_button("传送到 特种货物", function()
local blip = HUD.GET_CLOSEST_BLIP_INFO_ID(478)
if HUD.DOES_BLIP_EXIST(blip) then
local coords = HUD.GET_BLIP_COORDS(blip)
teleport2(coords.x, coords.y, coords.z + 1.0)
end
end)
menu_mission:add_sameline()
menu_mission:add_button("特种货物 传送到我", function()
script.run_in_fiber(function()
local entity_list = get_mission_pickups("gb_contraband_buy")
if next(entity_list) ~= nil then
OBJECT.SET_MAX_NUM_PORTABLE_PICKUPS_CARRIED_BY_PLAYER(ENTITY.GET_ENTITY_MODEL(entity_list[1]), 3)
for _, ent in pairs(entity_list) do
tp_pickup_to_me(ent)
end
return
end
local blip = HUD.GET_CLOSEST_BLIP_INFO_ID(478)
if HUD.DOES_BLIP_EXIST(blip) then
local ent = HUD.GET_BLIP_INFO_ID_ENTITY_INDEX(blip)
if ENTITY.DOES_ENTITY_EXIST(ent) then
set_entity_heading_to_entity(ent, PLAYER.PLAYER_PED_ID())
tp_entity_to_me(ent)
if ENTITY.IS_ENTITY_A_VEHICLE(ent) then
tp_into_vehicle(ent, "delete", "delete")
end
else
toast("目标不是实体,无法传送到我")
end
end
end)
end)
menu_mission:add_sameline()
menu_mission:add_button("特种货物(载具) 传送到我", function()
script.run_in_fiber(function()
local entity_list = get_mission_entities_by_hash(ENTITY_OBJECT, "gb_contraband_buy", 2972783418, 2272050386)
if next(entity_list) == nil then
return
end
for _, ent in pairs(entity_list) do
if ENTITY.IS_ENTITY_ATTACHED(ent) then
local attached_ent = ENTITY.GET_ENTITY_ATTACHED_TO(ent)
if ENTITY.IS_ENTITY_A_VEHICLE(attached_ent) then
tp_vehicle_to_me(attached_ent, "delete", "delete")
end
end
end
end)
end)
menu_mission:add_text("地堡拉货")
menu_mission:add_button("传送到 地堡原材料", function()
local blip1 = HUD.GET_CLOSEST_BLIP_INFO_ID(556)
local blip2 = HUD.GET_CLOSEST_BLIP_INFO_ID(561)
local blip3 = HUD.GET_CLOSEST_BLIP_INFO_ID(477)
if HUD.DOES_BLIP_EXIST(blip1) then
local coords = HUD.GET_BLIP_COORDS(blip1)
teleport2(coords.x, coords.y + 2.0, coords.z + 1.0)
elseif HUD.DOES_BLIP_EXIST(blip2) then
local coords = HUD.GET_BLIP_COORDS(blip2)
teleport2(coords.x, coords.y, coords.z + 1.0)
elseif HUD.DOES_BLIP_EXIST(blip3) then
local coords = HUD.GET_BLIP_COORDS(blip3)
teleport2(coords.x, coords.y, coords.z + 1.0)
end
end)
menu_mission:add_sameline()
menu_mission:add_button("地堡原材料 传送到我", function()
script.run_in_fiber(function()
local blip = HUD.GET_NEXT_BLIP_INFO_ID(556)
if not HUD.DOES_BLIP_EXIST(blip) then
local entity_list = get_mission_pickups("gb_gunrunning")
if next(entity_list) ~= nil then
for _, ent in pairs(entity_list) do
tp_entity_to_me(ent)
end
end
return
end
local ent = HUD.GET_BLIP_INFO_ID_ENTITY_INDEX(blip)
if ENTITY.DOES_ENTITY_EXIST(ent) then
set_entity_heading_to_entity(ent, PLAYER.PLAYER_PED_ID())
tp_entity_to_me(ent)
if ENTITY.IS_ENTITY_A_VEHICLE(ent) then
tp_into_vehicle(ent, "delete", "delete")
end
else
toast("目标不是实体,无法传送到我")
end
end)
end)
menu_mission:add_text("机库空运货物")
menu_mission:add_button("传送到 机库空运货物", function()
local blip = HUD.GET_NEXT_BLIP_INFO_ID(568)
if HUD.DOES_BLIP_EXIST(blip) then
local coords = HUD.GET_BLIP_COORDS(blip)
teleport2(coords.x, coords.y, coords.z + 1.0)
end
end)
menu_mission:add_sameline()
menu_mission:add_button("机库空运货物 传送到我", function()
script.run_in_fiber(function()
for _, ent in pairs(get_all_pickups_as_handles()) do
if ENTITY.IS_ENTITY_A_MISSION_ENTITY(ent) then
local entity_script = GET_ENTITY_SCRIPT(ent)
if entity_script == "gb_smuggler" or entity_script == "fm_content_smuggler_resupply" then
tp_pickup_to_me(ent)
end
end
end
end)
end)
menu_mission:add_text("摩托帮工厂")
menu_mission:add_button("传送到 工厂原材料", function()
local blip1 = HUD.GET_CLOSEST_BLIP_INFO_ID(501)
local blip2 = HUD.GET_CLOSEST_BLIP_INFO_ID(64)
local blip3 = HUD.GET_CLOSEST_BLIP_INFO_ID(427)
local blip4 = HUD.GET_CLOSEST_BLIP_INFO_ID(423)
if HUD.DOES_BLIP_EXIST(blip1) then
local coords = HUD.GET_BLIP_COORDS(blip1)
teleport2(coords.x, coords.y - 1.5, coords.z)
elseif HUD.DOES_BLIP_EXIST(blip2) then
local coords = HUD.GET_BLIP_COORDS(blip2)
teleport2(coords.x, coords.y - 1.5, coords.z)
elseif HUD.DOES_BLIP_EXIST(blip3) then
local coords = HUD.GET_BLIP_COORDS(blip3)
teleport2(coords.x, coords.y, coords.z + 1.0)
elseif HUD.DOES_BLIP_EXIST(blip4) then
local coords = HUD.GET_BLIP_COORDS(blip4)
teleport2(coords.x, coords.y + 1.5, coords.z - 1.0)
end
end)
menu_mission:add_sameline()
menu_mission:add_button("工厂原材料 传送到我", function()
script.run_in_fiber(function()
local blip = HUD.GET_CLOSEST_BLIP_INFO_ID(501)
if HUD.DOES_BLIP_EXIST(blip) then
local ent = HUD.GET_BLIP_INFO_ID_ENTITY_INDEX(blip)
if ENTITY.DOES_ENTITY_EXIST(ent) then
set_entity_heading_to_entity(ent, PLAYER.PLAYER_PED_ID())
tp_entity_to_me(ent)
if ENTITY.IS_ENTITY_A_VEHICLE(ent) then
tp_into_vehicle(ent, "delete", "delete")
end
else
toast("目标不是实体,无法传送到我")
end
end
end)
end)
menu_mission:add_separator()
----------------
-- 佩里科岛抢劫
----------------
menu_mission:add_text("<< 佩里科岛抢劫 >>")
menu_mission:add_button("摧毁主要目标玻璃柜、保险箱 (会在豪宅外生成主要目标包裹)", function()
script.run_in_fiber(function()
local entity_list = get_entities_by_hash(ENTITY_OBJECT, false, 2580434079, 1098122770)
if next(entity_list) ~= nil then
for _, ent in pairs(entity_list) do
if request_control2(ent) then
SET_ENTITY_HEALTH(ent, 0)
end
end
end
end)
end)
menu_mission:add_sameline()
menu_mission:add_button("主要目标掉落包裹 传送到我", function()
script.run_in_fiber(function()
local blip = HUD.GET_NEXT_BLIP_INFO_ID(765)
if HUD.DOES_BLIP_EXIST(blip) then
local ent = HUD.GET_BLIP_INFO_ID_ENTITY_INDEX(blip)
if ENTITY.DOES_ENTITY_EXIST(ent) then
if request_control2(ent) then
tp_entity_to_me(ent)
end
end
end
end)
end)
local CayoPericoDoors = {
joaat("h4_prop_h4_gate_l_01a"),
joaat("h4_prop_h4_gate_r_01a"),
joaat("h4_prop_h4_gate_02a"),
joaat("h4_prop_h4_gate_03a"),
joaat("h4_prop_h4_gate_05a"),
joaat("v_ilev_garageliftdoor"),
joaat("h4_prop_office_elevator_door_01"),
joaat("h4_prop_h4_gate_r_03a"),
joaat("h4_prop_h4_gate_l_03a"),
joaat("prop_fnclink_02gate6_r"),
joaat("prop_fnclink_02gate6_l"),
joaat("h4_prop_h4_garage_door_01a"),
joaat("prop_fnclink_03gate5")
}
menu_mission:add_button("删除门 (仅本地)", function()
script.run_in_fiber(function()
for _, obj in pairs(entities.get_all_objects_as_handles()) do
local objHash = ENTITY.GET_ENTITY_MODEL(obj)
for __, hash in pairs(CayoPericoDoors) do
if objHash == hash then
delete_entity(obj)
end
end
end
end)
end)
menu_mission:add_separator()
----------------
-- 公寓抢劫
----------------
menu_mission:add_text("<< 公寓抢劫 >>")
menu_mission:add_text("越狱")
menu_mission:add_button("梅杜莎飞机 无敌", function()
script.run_in_fiber(function()
local entity_list = get_mission_entities_by_hash(ENTITY_VEHICLE, "fm_mission_controller", 1077420264)
if next(entity_list) == nil then
return
end
for _, ent in pairs(entity_list) do
if request_control2(ent) then
set_entity_godmode(ent, true)
strong_vehicle(ent)
toast("完成!")
end
end
end)
end)
menu_mission:add_sameline()
menu_mission:add_button("秃鹰直升机 无敌", function()
script.run_in_fiber(function()
local entity_list = get_mission_entities_by_hash(ENTITY_VEHICLE, "fm_mission_controller", 788747387)
if next(entity_list) == nil then
return
end
for _, ent in pairs(entity_list) do
if request_control2(ent) then
set_entity_godmode(ent, true)
strong_vehicle(ent)
toast("完成!")
end
end
end)
end)
menu_mission:add_sameline()
menu_mission:add_button("敌对天煞 冻结", function()
script.run_in_fiber(function()
local entity_list = get_mission_entities_by_hash(ENTITY_VEHICLE, "fm_mission_controller", 3013282534)
if next(entity_list) == nil then
return
end
for _, ent in pairs(entity_list) do
if request_control2(ent) then
ENTITY.FREEZE_ENTITY_POSITION(ent, true)
toast("完成!")
end
end
end)
end)
menu_mission:add_sameline()
menu_mission:add_button("光头 无敌强化", function()
script.run_in_fiber(function()
local entity_list = get_mission_entities_by_hash(ENTITY_PED, "fm_mission_controller", 940330470)
if next(entity_list) == nil then
return
end
for _, ent in pairs(entity_list) do
if request_control2(ent) then
strong_ped_combat(ent, true)
toast("完成!")
end
end
end)
end)
menu_mission:add_sameline()
menu_mission:add_button("光头 传送进美杜莎", function()
script.run_in_fiber(function()
local entity_list = get_mission_entities_by_hash(ENTITY_VEHICLE, "fm_mission_controller", 1077420264)
if next(entity_list) == nil then
return
end
local velum2 = entity_list[1]
entity_list = get_mission_entities_by_hash(ENTITY_PED, "fm_mission_controller", 940330470)
if next(entity_list) == nil then
return
end
for _, ent in pairs(entity_list) do
if request_control2(ent) then
PED.SET_PED_INTO_VEHICLE(ent, velum2, 0)
toast("完成!")
end
end
end)
end)
menu_mission:add_text("突袭人道实验室")
menu_mission:add_button("九头蛇 无敌", function()
script.run_in_fiber(function()
local entity_list = get_mission_entities_by_hash(ENTITY_VEHICLE, "fm_mission_controller", 970385471)
if next(entity_list) == nil then
return
end
for _, ent in pairs(entity_list) do
if request_control2(ent) then
set_entity_godmode(ent, true)
strong_vehicle(ent)
toast("完成!")
end
end
end)
end)
menu_mission:add_sameline()
menu_mission:add_button("天煞(没有人驾驶的) 无敌", function()
script.run_in_fiber(function()
local entity_list = get_mission_entities_by_hash(ENTITY_VEHICLE, "fm_mission_controller", 30132825342)
if next(entity_list) == nil then
return
end
local i = 0
for _, ent in pairs(entity_list) do
if VEHICLE.IS_VEHICLE_SEAT_FREE(ent, -1, true) then
request_control(ent)
set_entity_godmode(ent, true)
strong_vehicle(ent)
if has_control_entity(ent) then
i = i + 1
end
end
end
toast("完成!\n数量: " .. i)
end)
end)
menu_mission:add_sameline()
menu_mission:add_button("女武神直升机 无敌", function()
script.run_in_fiber(function()
local entity_list = get_mission_entities_by_hash(ENTITY_VEHICLE, "fm_mission_controller", 2694714877)
if next(entity_list) == nil then
return
end
for _, ent in pairs(entity_list) do
if request_control2(ent) then
set_entity_godmode(ent, true)
strong_vehicle(ent)
toast("完成!")
end
end
end)
end)
menu_mission:add_text("首轮募资")
menu_mission:add_button("穿梭者直升机 无敌", function()
script.run_in_fiber(function()
local entity_list = get_mission_entities_by_hash(ENTITY_VEHICLE, "fm_mission_controller", 744705981)
if next(entity_list) == nil then
return
end
for _, ent in pairs(entity_list) do
if request_control2(ent) then
set_entity_godmode(ent, true)
strong_vehicle(ent)
toast("完成!")
end
end
end)
end)
menu_mission:add_sameline()
menu_mission:add_button("油罐车 无敌", function()
script.run_in_fiber(function()
local entity_list = get_mission_entities_by_hash(ENTITY_VEHICLE, "fm_mission_controller", 1956216962)
if next(entity_list) == nil then
return
end
for _, ent in pairs(entity_list) do
if request_control2(ent) then
set_entity_godmode(ent, true)
strong_vehicle(ent)
toast("完成!")
end
end
end)
end)
menu_mission:add_text("太平洋标准银行")
menu_mission:add_button("厢型车 添加地图标记点", function()
script.run_in_fiber(function()
local entity_list = get_mission_entities_by_hash(ENTITY_VEHICLE, "fm_mission_controller", 444171386)
if next(entity_list) == nil then
return
end
local blip_sprite = 535 -- radar_target_a
for _, ent in pairs(entity_list) do
local blip = HUD.GET_BLIP_FROM_ENTITY(ent)
if not HUD.DOES_BLIP_EXIST(blip) then
blip = HUD.ADD_BLIP_FOR_ENTITY(ent)
HUD.SET_BLIP_SPRITE(blip, blip_sprite)
HUD.SET_BLIP_COLOUR(blip, 5) -- Yellow
HUD.SET_BLIP_SCALE(blip, 0.8)
end
blip_sprite = blip_sprite + 1
end
toast("完成!")
end)
end)
menu_mission:add_sameline()
menu_mission:add_button("厢型车司机 传送到天上", function()
script.run_in_fiber(function()
local entity_list = get_mission_entities_by_hash(ENTITY_VEHICLE, "fm_mission_controller", 444171386)