forked from 0x2XPx/2Take1-script-Archive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshittycrashmethods.lua
404 lines (360 loc) · 14 KB
/
shittycrashmethods.lua
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
local rootPath = utils.get_appdata_path("PopstarDevs", "2Take1Menu")
keypath = rootPath.."\\scripts\\data.txt"
local function writename(name,txt)
local namefile = io.open(txt, "w")
io.output(namefile)
io.write(name..'\n')
io.close()
end
local function request_model(h, t)
if not h then
return
end
if not streaming.has_model_loaded(h) then
streaming.request_model(h)
local time = utils.time_ms() + t
while not streaming.has_model_loaded(h) and time > utils.time_ms() do
system.wait(5)
end
end
return streaming.has_model_loaded(h)
end
local function Cped(type, hash, coords, dir)
request_model(hash, 300)
local ped = ped.create_ped(type, hash, coords, dir, true, false)
streaming.set_model_as_no_longer_needed(hash)
return ped
end
local function spawn_vehicle(hash, coords, dir)
request_model(hash, 1000)
local car = vehicle.create_vehicle(hash, coords, dir, true, false)
streaming.set_model_as_no_longer_needed(hash)
return car
end
local function spawn_obj(hash, coords)
request_model(hash, 1000)
local object = object.create_object(hash, pos, true, false)
streaming.set_model_as_no_longer_needed(hash)
return object
end
local function bianshen (J)
local hash
hash = J
streaming.request_model(hash)
while(not streaming.has_model_loaded(hash))
do
system.wait(0)
end
player.set_player_model(hash)
streaming.set_model_as_no_longer_needed(hash)
return HANDLER_POP
end
local function get_control_of_entity(h, t)
if not h then
return
end
if not network.has_control_of_entity(h) then
network.request_control_of_entity(h)
local time = utils.time_ms() + t
while entity.is_an_entity(h) and not network.has_control_of_entity(h) and time > utils.time_ms() do
system.wait(5)
end
end
return network.has_control_of_entity(h)
end
local invalidobjecthash = {
849958566,
-568220328,
2155335200,
1272323782,
1296557055,
29828513,
2250084685,
2349112599,
1599985244,
3523942264,
3457195100,
3762929870,
1016189997,
861098586,
3245733464,
2494305715,
671173206,
3769155529,
978689073,
100436592,
3107991431,
1327834842,
1327834842,
1239708330,
}
function invalidmodelcrashplayer(pid)
local invalidobj = {}
crashplayerpos = player.get_player_coords(pid)
for i , k in pairs(invalidobjecthash) do
invalidobj[i] = object.create_world_object(k,crashplayerpos, true, false)
system.wait(0)
end
system.wait(100)
for i , k in pairs(invalidobjecthash) do
entity.delete_entity(invalidobj[i])
system.wait(0)
end
end
local attachcarhash = {
887537515,
-845979911,
-1700801569,
223258115,
630371791,
-823509173,
1074326203,
444171386,
}
function attachcrashplayer(data)
local attachcar = {}
crashplayerpos = player.get_player_coords(data)
towtruck = spawn_vehicle(0xe5a2d6c6,crashplayerpos,0)
entity.set_entity_god_mode(towtruck,true)
for i , k in pairs(attachcarhash) do
attachcar[i] = spawn_vehicle(k,crashplayerpos,0)
entity.set_entity_god_mode(attachcar[i],true)
entity.attach_entity_to_entity(attachcar[i],towtruck,0, v3(0,0,0),v3(0,0,0), true, true, false, 0, true)
system.wait(0)
end
system.wait(500)
for i , k in pairs(attachcarhash) do
entity.delete_entity(attachcar[i])
system.wait(0)
end
entity.delete_entity(towtruck)
end
function attachcrashplayerbad(data)
badattachpos = v3(0,0,0)
trailer = spawn_vehicle(-1881846085,badattachpos,0)
pedp = player.get_player_ped(data)
cloneped = ped.clone_ped(pedp)
entity.freeze_entity(trailer, true)
entity.freeze_entity(cloneped, true)
entity.set_entity_god_mode(trailer,true)
entity.set_entity_god_mode(cloneped,true)
entity.attach_entity_to_entity(cloneped,trailer,0, v3(0,0,0),v3(0,0,0), true, true, false, 0, true)
crashplayerpos = player.get_player_coords(data)
entity.set_entity_coords_no_offset(trailer,crashplayerpos)
system.wait(100)
entity.set_entity_coords_no_offset(trailer,badattachpos)
end
function poolcrashplayer(pid)
local Michael = {}
local chernobog = {}
local hunter = {}
local wade = {}
local tracy = {}
chernobogposz = player.get_player_coords(pid)
chernobogposz.z = chernobogposz.z + 1010
for i = 0, 90 do
chernobog[i] = spawn_vehicle(-1006919392,chernobogposz,0)
entity.freeze_entity(chernobog[i], true)
system.wait(0)
end
wadepos = player.get_player_coords(pid)
for i = 0, 85 do
wade[i] = Cped(2,0x0D7114C9,wadepos ,0)
entity.set_entity_god_mode(wade[i],true)
entity.freeze_entity(wade[i], true)
system.wait(0)
end
system.wait(2000)
for i = 0, 90 do
entity.delete_entity(wade[i])
system.wait(0)
end
tracypos = player.get_player_coords(pid)
for i = 0, 85 do
tracy[i] = Cped(2,0x0D7114C9,tracypos ,0)
entity.set_entity_god_mode(tracy[i],true)
entity.freeze_entity(tracy[i], true)
system.wait(0)
end
system.wait(2000)
for i = 0, 90 do
entity.delete_entity(tracy[i])
system.wait(0)
end
for i = 0, 90 do
entity.delete_entity(chernobog[i])
system.wait(0)
end
chernobogpos = player.get_player_coords(pid)
for i = 0, 90 do
chernobog[i] = spawn_vehicle(-1006919392,chernobogpos,0)
entity.freeze_entity(chernobog[i], true)
system.wait(0)
end
system.wait(2000)
for i = 0, 90 do
entity.delete_entity(chernobog[i])
system.wait(0)
end
mikepos = player.get_player_coords(pid)
for i = 0, 85 do
Michael[i] = Cped(2,0x0D7114C9,mikepos ,0)
entity.set_entity_god_mode(Michael[i],true)
ped.set_ped_component_variation(Michael[i], 0, 0,9,0 )
entity.freeze_entity(Michael[i], true)
system.wait(0)
end
system.wait(2000)
for i = 0, 85 do
entity.delete_entity(Michael[i])
system.wait(0)
end
end
objecthash = {
314436594,
352817817,
466911544,
511018606,
519594446,
772023703,
1022953480,
1067874014,
1082797888,
2041665236,
}
function handlercrashplayer(pid)
local spawnobj = {}
local attachcar = {}
pos = player.get_player_coords(pid)
handler = spawn_vehicle(444583674,pos,0)
boneveh = entity.get_entity_bone_index_by_name(handler,"frame_1")
for i , k in pairs(attachcarhash) do
attachcar[i] = spawn_vehicle(k,pos,0)
entity.attach_entity_to_entity(attachcar[i],handler,boneveh, v3(0,0,0),v3(0,0,0), true, true, false, 0, true)
system.wait(0)
end
end
function chernobogcrashplayer(pid)
local chernobog = {}
pos = player.get_player_coords(pid)
chernobogmain = spawn_vehicle(-692292317,pos,0)
for i =0, 90 do
chernobog[i] = spawn_vehicle(-692292317,pos,0)
entity.attach_entity_to_entity(chernobog[i],chernobogmain,0, v3(0,0,0),v3(0,0,0), true, true, false, 0, true)
system.wait(0)
end
system.wait(4000)
for i = 0, 90 do
entity.delete_entity(chernobog[i])
system.wait(0)
end
entity.delete_entity(chernobogmain)
end
function mc()
bianshen(0x705E61F2)
system.wait(100)
ped.set_ped_health(player.get_player_ped(player.player_id()), 0)
system.wait(100)
bianshen(0x9C9EFFD8)
system.wait(100)
ped.set_ped_health(player.get_player_ped(player.player_id()), 0)
system.wait(100)
end
function soundcrashplayer(pid)
local time = utils.time_ms() + 2000
while time > utils.time_ms() do
local netsoundpos = player.get_player_coords(pid)
for i = 1, 10 do
audio.play_sound_from_coord(-1, '5s', netsoundpos, 'MP_MISSION_COUNTDOWN_SOUNDSET', true, 10000, false)
end
system.wait(0)
end
end
function secrashplayer(pid)
script.trigger_script_event(-2113023004, pid, {-1, -1,0,0,-20,1000})
script.trigger_script_event(-1056683619, pid, {-1, -1})
script.trigger_script_event(1757755807, pid, {-1, -1})
script.trigger_script_event(1258808115, pid, {-1, -1})
script.trigger_script_event(-786546101, pid, {-1, -1})
end
function fakecrash(pid)
pedp = player.get_player_ped(pid)
cloneped = ped.clone_ped(pedp)
ped.clear_ped_tasks_immediately(pedp)
local titlle = "scr_martin1"
local hashid = "scr_sol1_fire_trail"
graphics.set_next_ptfx_asset(titlle)
while not graphics.has_named_ptfx_asset_loaded(titlle) do
graphics.request_named_ptfx_asset(titlle)
system.wait(0)
end
graphics.start_networked_ptfx_looped_on_entity(hashid,pedp, v3(0,0,0.0), v3(0, 0, 0),5)
end
playeroption = menu.add_player_feature("Player", "parent", 0, function(k, pid)
end)
aio_crash = menu.add_player_feature("AIO-Crash", "action", playeroption.id, function(k, pid)
mypos = player.get_player_coords(player.player_id())
pedmy = player.get_player_ped(player.player_id())
entity.set_entity_coords_no_offset(pedmy, v3(0,0,4000))
entity.freeze_entity(pedmy, true)
for i = 0 ,1 do
fakecrash(pid)
poolcrashplayer(pid)
invalidmodelcrashplayer(pid)
soundcrashplayer(pid)
attachcrashplayer(pid)
secrashplayer(pid)
end
entity.set_entity_coords_no_offset(pedmy, mypos)
entity.freeze_entity(pedmy, false)
end)
bad_para_crash = menu.add_player_feature("Virgin Crash", "action", playeroption.id, function(k, pid)
pos = player.get_player_coords(pid)
cargobob = spawn_vehicle(0XFCFCB68B,pos,0)
vehicle = spawn_vehicle(0X187D938D,pos,0)
newRope = rope.add_rope(pos,v3(0,0,10),1,1,0,1,1,false,false,false,1.0,false)
rope.attach_entities_to_rope(newRope,cargobob,vehicle,entity.get_entity_coords(cargobob),entity.get_entity_coords(vehicle),2 ,0,0,"Center","Center")
system.wait(100)
end)
bad_para_crash = menu.add_player_feature(":D", "action", playeroption.id, function(k, pid)
pos = player.get_player_coords(pid)
pos.x = pos.x + 2
newRope = rope.add_rope(pos,v3(0,0,10),1,1,0,1,1,false,false,false,1.0,false)
pos = player.get_player_coords(pid)
car = spawn_vehicle(0X187D938D,pos,0)
end)
menu.add_player_feature("math crash" , "action",playeroption.id,function(k,pid)
local pos = player.get_player_coords(pid)
local ppos = player.get_player_coords(pid)
pos.x = pos.x+5
ppos.z = ppos.z+1
pedp=player.get_player_ped(pid)
cargobob = spawn_vehicle( 2132890591,pos,0)
kur =Cped(26,2727244247,ppos,0)
entity.set_entity_god_mode(kur,true)
newRope = rope.add_rope(pos,v3(0,0,0),1,1,0.0000000000000000000000000000000000001,1,1,true,true,true,1.0,true)
rope.attach_entities_to_rope(newRope,cargobob,kur,entity.get_entity_coords(cargobob),entity.get_entity_coords(kur),2 ,0,0,"Center","Center")
system.wait(100)
end)
menu.add_player_feature("SE crash" , "action",playeroption.id,function(k,pid)
script.trigger_script_event(-393294520, pid, {pid, math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647)})
script.trigger_script_event(-1386010354, pid, {pid, math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647)})
script.trigger_script_event(962740265, pid, {pid, math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647), math.random(-2147483647, 2147483647)})
end)
menu.add_feature("Math Crash" , "action", crashsession, function(k)
mypos = player.get_player_coords(player.player_id())
mypos.x = mypos.x+10
carc = spawn_vehicle(2598821281,mypos,0)
pedc =Cped(26,2597531625,mypos,0)
--entity.set_entity_god_mode(carc, true)
--entity.set_entity_god_mode(pedc, true)
--entity.set_entity_visible(carc, false)
--entity.set_entity_visible(pedc, false)
ropec = rope.add_rope(mypos,v3(0,0,0),1,1,0.00300000000000000000000000000000000000000000000001,1,1,true,true,true,1.0,true)
rope.attach_entities_to_rope(ropec,carc,pedc,entity.get_entity_coords(carc),entity.get_entity_coords(pedc),2,0,0,"Center","Center")
system.wait(2500)
rope.delete_rope(ropec)
entity.delete_entity(carc)
entity.delete_entity(pedc)
menu.notify("La session a bien reçu le crash.", "Math Crash", 10, 0xff0000ff)
end)