-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDev.lua
More file actions
212 lines (178 loc) · 8.47 KB
/
Copy pathDev.lua
File metadata and controls
212 lines (178 loc) · 8.47 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
------------------------------------------
-- Dev Options
------------------------------------------
menu.textslider_stateful(Dev_Options, "Copy My Coords & Heading", { "copyMyPos" }, "", {
"without key", "with key"
}, function(value)
local coords = ENTITY.GET_ENTITY_COORDS(players.user_ped())
local heading = ENTITY.GET_ENTITY_HEADING(players.user_ped())
local text = ""
if value == 1 then
text = string.format("%.10f, %.10f, %.10f, %.10f", coords.x, coords.y, coords.z, heading)
elseif value == 2 then
text = string.format("x = %.10f, y = %.10f, z = %.10f, heading = %.10f", coords.x, coords.y, coords.z, heading)
end
util.copy_to_clipboard(text, false)
util.toast("Copied!\n" .. text)
end)
menu.action(Dev_Options, "Get Network Time", {}, "", function()
util.toast("Network Time: " .. NETWORK.GET_NETWORK_TIME() ..
"\nNetwork Time(String): " .. NETWORK.GET_TIME_AS_STRING(NETWORK.GET_NETWORK_TIME()) ..
"\nAccurate Network Time: " .. NETWORK.GET_NETWORK_TIME_ACCURATE() ..
"\nCloud Time: " .. NETWORK.GET_CLOUD_TIME_AS_INT())
end)
menu.action(Dev_Options, "Get Interior ID", { "getInteriorId" }, "", function()
if INTERIOR.IS_INTERIOR_SCENE() then
local interior = INTERIOR.GET_INTERIOR_FROM_ENTITY(players.user_ped())
if INTERIOR.IS_VALID_INTERIOR(interior) then
local text = "Interior ID: " .. interior
util.copy_to_clipboard(text, false)
util.toast("Copied!\n" .. text)
end
end
end)
menu.action(Dev_Options, "GET_PICKUP_GENERATION_RANGE_MULTIPLIER", {}, "Default: 1.0", function()
util.toast(OBJECT.GET_PICKUP_GENERATION_RANGE_MULTIPLIER())
end)
menu.click_slider_float(Dev_Options, "SET_PICKUP_GENERATION_RANGE_MULTIPLIER", { "set_pickup_range" }, "",
0, 100000, 100000, 100, function(value)
OBJECT.SET_PICKUP_GENERATION_RANGE_MULTIPLIER(value * 0.01)
end)
local radius_draw_sphere = 10.0
local dev_draw_sphere = menu.slider_float(Dev_Options, "DRAW_MARKER_SPHERE", { "radius_draw_sphere" }, "",
0, 100000, 1000, 100, function(value)
radius_draw_sphere = value * 0.01
end)
menu.on_tick_in_viewport(dev_draw_sphere, function()
if menu.is_focused(dev_draw_sphere) then
local coords = ENTITY.GET_ENTITY_COORDS(players.user_ped())
DRAW_MARKER_SPHERE(coords, radius_draw_sphere)
end
end)
menu.toggle_loop(Dev_Options, "GET_IS_TASK_ACTIVE", { "show_active_task" }, "", function()
for i = 0, 530, 1 do
if TASK.GET_IS_TASK_ACTIVE(players.user_ped(), i) then
util.draw_debug_text("Task Active: " .. tostring(i))
end
end
end)
local eventGroup = 1 -- SCRIPT_EVENT_QUEUE_NETWORK
local eventData = memory.alloc(13 * 8)
menu.toggle_loop(Dev_Options, "Event Network Entity Damage", {}, "", function()
for eventIndex = 0, SCRIPT.GET_NUMBER_OF_EVENTS(eventGroup) - 1 do
local eventType = SCRIPT.GET_EVENT_AT_INDEX(eventGroup, eventIndex)
if eventType == 186 then -- CEventNetworkEntityDamage
if SCRIPT.GET_EVENT_DATA(eventGroup, eventIndex, eventData, 13) then
local Victim = memory.read_int(eventData) -- entity
local Attacker = memory.read_int(eventData + 1 * 8) -- entity
local Damage = memory.read_float(eventData + 2 * 8) -- float
local EnduranceDamage = memory.read_float(eventData + 3 * 8) -- float
local VictimIncapacitated = memory.read_int(eventData + 4 * 8) -- bool
local VictimDestroyed = memory.read_int(eventData + 5 * 8) -- bool
local WeaponHash = memory.read_int(eventData + 6 * 8) -- int
local VictimSpeed = memory.read_float(eventData + 7 * 8) -- float
local AttackerSpeed = memory.read_float(eventData + 8 * 8) -- float
local IsResponsibleForCollision = memory.read_int(eventData + 9 * 8) -- bool
local IsHeadShot = memory.read_int(eventData + 10 * 8) -- bool
local IsWithMeleeWeapon = memory.read_int(eventData + 11 * 8) -- bool
local HitMaterial = memory.read_int(eventData + 12 * 8) -- int
local text = "\nVictim: " .. Victim ..
"\nAttacker: " .. Attacker ..
"\nDamage: " .. Damage ..
"\nEndurance Damage: " .. EnduranceDamage ..
"\nVictim Incapacitated: " .. VictimIncapacitated ..
"\nVictim Destroyed: " .. VictimDestroyed ..
"\nWeapon Hash: " .. WeaponHash ..
"\nVictim Speed: " .. VictimSpeed ..
"\nAttacker Speed: " .. AttackerSpeed ..
"\nIs Responsible For Collision: " .. IsResponsibleForCollision ..
"\nIs Head Shot: " .. IsHeadShot ..
"\nIs With Melee Weapon: " .. IsWithMeleeWeapon ..
"\nHit Material: " .. HitMaterial ..
"\n"
util.toast(text, TOAST_ALL)
end
end
end
end)
menu.toggle_loop(Dev_Options, "Log Content Info", { "log_content_info" }, "", function()
local content_id = NETWORK.UGC_GET_CONTENT_ID(0)
if content_id ~= nil then
local text = "\nContent Name: " .. tostring(NETWORK.UGC_GET_CONTENT_NAME(0)) ..
"\nContent ID: " .. content_id ..
"\nContent Path: " .. tostring(NETWORK.UGC_GET_CONTENT_PATH(0, 0)) ..
"\nRoot Content ID: " .. tostring(NETWORK.UGC_GET_ROOT_CONTENT_ID(0)) ..
"\nUser: " .. tostring(NETWORK.UGC_GET_CONTENT_USER_NAME(0)) ..
" (ID: " .. tostring(NETWORK.UGC_GET_CONTENT_USER_ID(0)) .. ")"
util.toast(text, TOAST_ALL)
end
end)
--------------------
-- 地图标记点
--------------------
local dev_map_blips = menu.list(Dev_Options, "地图标记点", { "dev_map_blips" }, "")
local map_blips = {
menu_list = {},
}
menu.action(dev_map_blips, "获取地图所有标记点", {}, "相同的获取最近的, 由近到远排序", function()
rs_menu.delete_menu_list(map_blips.menu_list)
map_blips.menu_list = {}
local blip_list = {}
for i = 0, 999, 1 do
local blip = HUD.GET_CLOSEST_BLIP_INFO_ID(i)
if HUD.DOES_BLIP_EXIST(blip) then
table.insert(blip_list, blip)
end
end
if next(blip_list) ~= nil then
-- sort
local player_pos = ENTITY.GET_ENTITY_COORDS(players.user_ped())
table.sort(blip_list, function(a, b)
local distance_a = v3.distance(HUD.GET_BLIP_COORDS(a), player_pos)
local distance_b = v3.distance(HUD.GET_BLIP_COORDS(b), player_pos)
return distance_a < distance_b
end)
for _, blip in pairs(blip_list) do
local blip_type = Blip_T.Type[HUD.GET_BLIP_INFO_ID_TYPE(blip)]
-- menu_list
local menu_name = HUD.GET_BLIP_SPRITE(blip) .. ". " .. blip_type
local help_text = "Distance: " .. v3.distance(HUD.GET_BLIP_COORDS(blip), player_pos)
local menu_list = menu.list(dev_map_blips, menu_name, {}, help_text)
table.insert(map_blips.menu_list, menu_list)
-- generate_menu
menu.toggle(menu_list, "Flashs", {}, "", function(toggle)
HUD.SET_BLIP_FLASHES(blip, toggle)
end, HUD.IS_BLIP_FLASHING(blip))
menu.readonly(menu_list, "Colour", HUD.GET_BLIP_COLOUR(blip))
menu.readonly(menu_list, "HUD Colour", HUD.GET_BLIP_HUD_COLOUR(blip))
end
end
end)
menu.action(dev_map_blips, "清空", {}, "", function()
rs_menu.delete_menu_list(map_blips.menu_list)
map_blips.menu_list = {}
end)
menu.divider(dev_map_blips, "列表")
menu.action(Dev_Options, "关闭电脑界面", { "shut_computer" }, "", function()
local script_list = {
"apparcadebusiness",
"apparcadebusinesshub",
"appavengeroperations",
"appbailoffice",
"appbikerbusiness",
"appbunkerbusiness",
"appbusinesshub",
"appcovertops",
"appfixersecurity",
"apphackertruck",
"appimportexport",
"appinternet",
"appsecuroserv",
"appsmuggler",
}
for key, script in pairs(script_list) do
if IS_SCRIPT_RUNNING(script) then
MISC.TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME(script)
end
end
end)