Skip to content

Commit c0f76bf

Browse files
committed
Update
1 parent fce362b commit c0f76bf

3 files changed

Lines changed: 2518 additions & 51 deletions

File tree

‎RScript.lua‎

Lines changed: 150 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
--- Author: Rostal
33
-------------------------------
44

5+
require("RScript.tables")
6+
57
require("RScript.functions")
68

79

@@ -14,53 +16,6 @@ local function print(text)
1416
end
1517

1618

17-
local VehicleRadioStation <const> = {
18-
"OFF",
19-
"RADIO_11_TALK_02", -- Blaine County Radio
20-
"RADIO_12_REGGAE", -- The Blue Ark
21-
"RADIO_13_JAZZ", -- Worldwide FM
22-
"RADIO_14_DANCE_02", -- FlyLo FM
23-
"RADIO_15_MOTOWN", -- The Lowdown 9.11
24-
"RADIO_20_THELAB", -- The Lab
25-
"RADIO_16_SILVERLAKE", -- Radio Mirror Park
26-
"RADIO_17_FUNK", -- Space 103.2
27-
"RADIO_18_90S_ROCK", -- Vinewood Boulevard Radio
28-
"RADIO_21_DLC_XM17", -- Blonded Los Santos 97.8 FM
29-
"RADIO_22_DLC_BATTLE_MIX1_RADIO", -- Los Santos Underground Radio
30-
"RADIO_23_DLC_XM19_RADIO", -- iFruit Radio
31-
"RADIO_19_USER", -- Self Radio
32-
"RADIO_01_CLASS_ROCK", -- Los Santos Rock Radio
33-
"RADIO_02_POP", -- Non-Stop-Pop FM
34-
"RADIO_03_HIPHOP_NEW", -- Radio Los Santos
35-
"RADIO_04_PUNK", -- Channel X
36-
"RADIO_06_COUNTRY", -- Rebel Radio
37-
"RADIO_07_DANCE_01", -- Soulwax FM
38-
"RADIO_08_MEXICAN", -- East Los FM
39-
"RADIO_09_HIPHOP_OLD", -- West Coast Classics
40-
"RADIO_37_MOTOMAMI", -- MOTOMAMI Los Santos
41-
"RADIO_05_TALK_01", -- West Coast Talk Radio
42-
"RADIO_36_AUDIOPLAYER", -- Media Player
43-
"RADIO_35_DLC_HEI4_MLR", -- The Music Locker
44-
"RADIO_34_DLC_HEI4_KULT", -- Kult FM
45-
"RADIO_27_DLC_PRHEI4", -- Still Slipping Los Santos
46-
}
47-
48-
local CommonWeapons <const> = {
49-
joaat("WEAPON_KNIFE"),
50-
joaat("WEAPON_APPISTOL"),
51-
joaat("WEAPON_MICROSMG"),
52-
joaat("WEAPON_SPECIALCARBINE"),
53-
joaat("WEAPON_ASSAULTSHOTGUN"),
54-
joaat("WEAPON_MINIGUN"),
55-
joaat("WEAPON_HOMINGLAUNCHER"),
56-
joaat("WEAPON_RPG"),
57-
joaat("WEAPON_RAILGUN"),
58-
joaat("WEAPON_GRENADE"),
59-
joaat("WEAPON_SMOKEGRENADE"),
60-
joaat("WEAPON_MOLOTOV"),
61-
}
62-
63-
6419
--------------------------------
6520
-- Main Tab
6621
--------------------------------
@@ -102,6 +57,9 @@ tab_root:add_button("恢复默认受伤倍数", function()
10257
end)
10358
tab_root:add_separator()
10459

60+
tabs.add_checkbox(tab_root, "步行时人称视角快捷切换", MainTab, false, "第一人称视角和第三人称(近距离)视角快捷切换")
61+
tab_root:add_separator()
62+
10563
----------------
10664
-- 载具
10765
----------------
@@ -123,7 +81,7 @@ tab_root:add_sameline()
12381
tabs.add_checkbox(tab_root, "无限动能回收加速", MainTab)
12482
tab_root:add_sameline()
12583
tabs.add_toggle_button(tab_root, "电台只播放音乐", MainToggle, false, function(toggle)
126-
for _, stationName in pairs(VehicleRadioStation) do
84+
for _, stationName in pairs(T.VehicleRadioStations) do
12785
AUDIO.SET_RADIO_STATION_MUSIC_ONLY(stationName, toggle)
12886
end
12987
end)
@@ -253,7 +211,7 @@ tab_root:add_button("友方NPC 给予武器", function()
253211
for _, ped in pairs(entities.get_all_peds_as_handles()) do
254212
if not ENTITY.IS_ENTITY_DEAD(ped) and not PED.IS_PED_A_PLAYER(ped) then
255213
if is_friendly_ped(ped) then
256-
for _, weaponHash in pairs(CommonWeapons) do
214+
for _, weaponHash in pairs(T.CommonWeapons) do
257215
WEAPON.GIVE_WEAPON_TO_PED(ped, weaponHash, -1, false, false)
258216
end
259217
end
@@ -378,6 +336,8 @@ tab_mission:add_button("打开恐霸电脑", function()
378336
end)
379337
tab_mission:add_sameline()
380338
tabs.add_checkbox(tab_mission, "跳过NPC对话", MissionTab)
339+
tab_mission:add_sameline()
340+
tabs.add_checkbox(tab_mission, "自动收集财物", MissionTab, false, "模拟鼠标左键点击拿取财物")
381341
tab_mission:add_separator()
382342

383343
----------------
@@ -706,6 +666,34 @@ tab_mission:add_button("雷克卓摩托车 升级无敌", function()
706666
end)
707667
notify("", "完成!\n数量: " .. i)
708668
end)
669+
tab_mission:add_separator()
670+
671+
----------------
672+
-- 佩里科岛抢劫
673+
----------------
674+
675+
tab_mission:add_text("<< 佩里科岛抢劫 >>")
676+
tab_mission:add_button("摧毁主要目标玻璃柜、保险箱 (会在豪宅外生成主要目标包裹)", function()
677+
get_mission_entities_by_hash("object", { 2580434079, 1098122770 }, function(ent)
678+
if request_control2(ent) then
679+
SET_ENTITY_HEALTH(ent, 0)
680+
681+
notify("", "完成!")
682+
end
683+
end)
684+
end)
685+
tab_mission:add_sameline()
686+
tab_mission:add_button("主要目标掉落包裹 传送到我", function()
687+
local blip = HUD.GET_NEXT_BLIP_INFO_ID(765)
688+
if HUD.DOES_BLIP_EXIST(blip) then
689+
local ent = HUD.GET_BLIP_INFO_ID_ENTITY_INDEX(blip)
690+
if ENTITY.DOES_ENTITY_EXIST(ent) then
691+
if request_control2(ent) then
692+
tp_entity_to_me(ent)
693+
end
694+
end
695+
end
696+
end)
709697

710698

711699
--#endregion
@@ -755,6 +743,8 @@ function manage_entity.gui.info(tab, entity_type)
755743
gui_table["hash"] = tab:add_text("Hash: 0")
756744
tab:add_sameline()
757745
gui_table["index"] = tab:add_text("Index: 0")
746+
tab:add_sameline()
747+
gui_table["model"] = tab:add_text("Model: 0")
758748
gui_table["coords"] = tab:add_text("坐标: x = 0.0, y = 0.0, z = 0.0")
759749
gui_table["health"] = tab:add_text("血量: 0/0")
760750
tab:add_sameline()
@@ -1168,7 +1158,7 @@ function manage_entity.gui.ped(tab)
11681158
tab:add_button("给予武器", function()
11691159
local ent = manage_entity[entity_type].ent
11701160
if ENTITY.DOES_ENTITY_EXIST(ent) then
1171-
for _, weaponHash in pairs(CommonWeapons) do
1161+
for _, weaponHash in pairs(T.CommonWeapons) do
11721162
WEAPON.GIVE_WEAPON_TO_PED(ent, weaponHash, -1, false, false)
11731163
end
11741164
end
@@ -1228,8 +1218,10 @@ function manage_entity.gui.update_info(entity_type)
12281218
gui_table["owner"]:set_text("控制权: " .. PLAYER.GET_PLAYER_NAME(get_entity_owner(ent)))
12291219

12301220
if entity_type == "vehicle" then
1221+
gui_table["model"]:set_text("Model: " .. reverse_vehicle_hash(hash))
12311222
gui_table["display_name"]:set_text("载具: " .. get_vehicle_display_name_by_hash(hash))
12321223
elseif entity_type == "ped" then
1224+
gui_table["model"]:set_text("Model: " .. reverse_ped_hash(hash))
12331225
local ped_veh = GET_VEHICLE_PED_IS_IN(ent)
12341226
if ped_veh ~= 0 then
12351227
gui_table["display_name"]:set_text("载具: " .. get_vehicle_display_name_by_hash(ent))
@@ -1300,7 +1292,12 @@ function manage_entity.get_entity_info(ent, index)
13001292
end
13011293
end
13021294
else
1303-
name = name .. hash
1295+
local ped_name = reverse_ped_hash(hash)
1296+
if ped_name ~= "" then
1297+
name = name .. ped_name
1298+
else
1299+
name = name .. hash
1300+
end
13041301
end
13051302

13061303
if ENTITY.IS_ENTITY_A_PED(ent) then
@@ -1509,6 +1506,92 @@ tabs.add_checkbox(tab_manage_entity, "禁用筛选: 载具司机", ManageEntityT
15091506

15101507

15111508

1509+
--------------------------------
1510+
-- Debug Tab
1511+
--------------------------------
1512+
1513+
local tab_debug <const> = tab_root:add_tab(" > Debug")
1514+
1515+
local DebugTab = {}
1516+
1517+
tabs.add_checkbox(tab_debug, "RPG爆炸准星位置", DebugTab, false, "E键使用")
1518+
tab_debug:add_sameline()
1519+
tabs.add_checkbox(tab_debug, "署名爆炸", DebugTab)
1520+
1521+
tabs.add_checkbox(tab_debug, "RPG射击准星位置", DebugTab, false, "E键使用")
1522+
tab_debug:add_sameline()
1523+
tabs.add_checkbox(tab_debug, "署名射击", DebugTab)
1524+
1525+
1526+
1527+
script.register_looped("RScript_Debug", function(script_util)
1528+
if DebugTab["RPG爆炸准星位置"]:is_enabled() then
1529+
draw_crosshair()
1530+
1531+
local result = get_raycast_result(1500.0)
1532+
if result.hit then
1533+
-- local line_colour = { r = 255, g = 0, b = 255, a = 255 }
1534+
-- local coords = result.endCoords
1535+
-- local my_coords = ENTITY.GET_ENTITY_COORDS(PLAYER.PLAYER_PED_ID())
1536+
1537+
-- local ent = result.entityHit
1538+
-- if ENTITY.DOES_ENTITY_EXIST(ent) and ENTITY.GET_ENTITY_TYPE(ent) > 0 then
1539+
-- line_colour = { r = 0, g = 255, b = 0, a = 255 }
1540+
-- end
1541+
1542+
-- DRAW_LINE(my_coords, coords, line_colour)
1543+
1544+
1545+
if PAD.IS_CONTROL_PRESSED(0, 51) then
1546+
local coords = result.endCoords
1547+
1548+
local explosion_type = 4 -- EXP_TAG_ROCKET
1549+
1550+
if DebugTab["署名爆炸"]:is_enabled() then
1551+
FIRE.ADD_OWNED_EXPLOSION(PLAYER.PLAYER_PED_ID(),
1552+
coords.x, coords.y, coords.z, explosion_type,
1553+
1000.0, true, false, 0.0)
1554+
else
1555+
FIRE.ADD_EXPLOSION(coords.x, coords.y, coords.z, explosion_type,
1556+
1000.0, true, false, 0.0, false)
1557+
end
1558+
1559+
script_util:sleep(100)
1560+
end
1561+
end
1562+
end
1563+
1564+
if DebugTab["RPG射击准星位置"]:is_enabled() then
1565+
draw_crosshair()
1566+
1567+
if PAD.IS_CONTROL_PRESSED(0, 51) then
1568+
local start_pos = ENTITY.GET_ENTITY_COORDS(PLAYER.PLAYER_PED_ID())
1569+
local end_pos = get_offset_from_cam(1500.0)
1570+
1571+
local weapon_hash = 2982836145 -- WEAPON_RPG
1572+
local owner = 0
1573+
if DebugTab["署名射击"]:is_enabled() then
1574+
owner = PLAYER.PLAYER_PED_ID()
1575+
end
1576+
local ignore_ent = get_user_vehicle(false)
1577+
if ignore_ent == 0 then
1578+
ignore_ent = PLAYER.PLAYER_PED_ID()
1579+
end
1580+
1581+
MISC.SHOOT_SINGLE_BULLET_BETWEEN_COORDS_IGNORE_ENTITY(
1582+
start_pos.x, start_pos.y, start_pos.z + 2.0,
1583+
end_pos.x, end_pos.y, end_pos.z,
1584+
1000.0, true, weapon_hash, owner,
1585+
true, true, 2000,
1586+
ignore_ent, 0)
1587+
1588+
script_util:sleep(100)
1589+
end
1590+
end
1591+
end)
1592+
1593+
1594+
15121595
--------------------------------
15131596
-- Loop Script
15141597
--------------------------------
@@ -1532,6 +1615,13 @@ script.register_looped("RScript_Main", function()
15321615
PLAYER.SET_PLAYER_WEAPON_TAKEDOWN_DEFENSE_MODIFIER(PLAYER.PLAYER_ID(), value)
15331616
end
15341617
end
1618+
if MainTab["步行时人称视角快捷切换"]:is_enabled() then
1619+
if CAM.IS_FOLLOW_PED_CAM_ACTIVE() then
1620+
if CAM.GET_FOLLOW_PED_CAM_VIEW_MODE() == 1 or CAM.GET_FOLLOW_PED_CAM_VIEW_MODE() == 2 then
1621+
CAM.SET_FOLLOW_PED_CAM_VIEW_MODE(4)
1622+
end
1623+
end
1624+
end
15351625
if MainTab["无限动能回收加速"]:is_enabled() then
15361626
local vehicle = get_user_vehicle(false)
15371627
if vehicle ~= 0 then
@@ -1567,6 +1657,15 @@ script.register_looped("RScript_Main", function()
15671657
end
15681658
end)
15691659

1660+
script.register_looped("RScript_自动收集财物", function(script_util)
1661+
if MissionTab["自动收集财物"]:is_enabled() then
1662+
if TASK.GET_IS_TASK_ACTIVE(PLAYER.PLAYER_PED_ID(), 135) then
1663+
PAD.SET_CONTROL_VALUE_NEXT_FRAME(0, 237, 1)
1664+
script_util:sleep(30)
1665+
end
1666+
end
1667+
end)
1668+
15701669
script.register_looped("RScript_Manage_Entity", function()
15711670
if manage_entity["vehicle"].enable and tab_vehicle_list:is_selected() then
15721671
manage_entity.gui.update_info("vehicle")

0 commit comments

Comments
 (0)