This repository has been archived by the owner on Mar 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Brutan_v9.lua
3188 lines (2851 loc) · 149 KB
/
Brutan_v9.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
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
Cience = { }
Cience.debug = false
local Enabled = true
local logged = false
local pass = "BRUTAN"
local currentMenuX = 1
local selectedMenuX = 1
local currentMenuY = 1
local selectedMenuY = 1
local menuX = { 0.025, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.75 }
local menuY = { 0.025, 0.1, 0.2, 0.3, 0.425 }
local discordPresence = true
local SelectedPlayer
local bullets = { "WEAPON_FLAREGUN", "WEAPON_FIREWORK", "WEAPON_RPG", "WEAPON_PIPEBOMB", "WEAPON_RAILGUN", "WEAPON_SMOKEGRENADE", "VEHICLE_WEAPON_PLAYER_LASER", "VEHICLE_WEAPON_TANK" }
local peds = { "a_c_boar", "a_c_killerwhale", "a_c_sharktiger", "csb_stripper_01" }
local vehicles = { "Freight", "Rhino", "Futo", "Vigilante", "Monster", "Panto", "Bus", "Dump", "CargoPlane" }
local vehicleSpeed = { 1.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0, 120.0, 130.0, 140.0, 150.0 }
local currentVehicle = 1
local selectedVehicle = 1
local currentVehicleSpeed = 16
local selectedVehicleSpeed = 16
local currentBone = 1
local selectedBone = 1
local currentDamage = 1
local selectedDamage = 1
local currentPed = 1
local selectedPed = 1
local currentBullet = 1
local selectedBullet = 1
local menus = { }
local keys = { up = 172, down = 173, left = 174, right = 175, select = 215, back = 194 }
local optionCount = 0
local currentKey = nil
local currentMenu = nil
local titleHeight = 0.11
local titleYOffset = 0.03
local titleScale = 1.0
local buttonHeight = 0.038
local buttonFont = 0
local buttonScale = 0.365
local buttonTextXOffset = 0.005
local buttonTextYOffset = 0.005
function math.round(num, numDecimalPlaces)
return tonumber(string.format("%." .. (numDecimalPlaces or 0) .. "f", num))
end
local function RGBRainbow(frequency)
local result = {}
local curtime = GetGameTimer() / 1000
result.r = math.floor(math.sin(curtime * frequency + 0) * 127 + 128)
result.g = math.floor(math.sin(curtime * frequency + 2) * 127 + 128)
result.b = math.floor(math.sin(curtime * frequency + 4) * 127 + 128)
return result
end
local allWeapons = {
"WEAPON_KNIFE",
"WEAPON_KNUCKLE",
"WEAPON_NIGHTSTICK",
"WEAPON_HAMMER",
"WEAPON_BAT",
"WEAPON_GOLFCLUB",
"WEAPON_CROWBAR",
"WEAPON_BOTTLE",
"WEAPON_DAGGER",
"WEAPON_HATCHET",
"WEAPON_MACHETE",
"WEAPON_FLASHLIGHT",
"WEAPON_SWITCHBLADE",
"WEAPON_PISTOL",
"WEAPON_PISTOL_MK2",
"WEAPON_COMBATPISTOL",
"WEAPON_APPISTOL",
"WEAPON_PISTOL50",
"WEAPON_SNSPISTOL",
"WEAPON_HEAVYPISTOL",
"WEAPON_VINTAGEPISTOL",
"WEAPON_STUNGUN",
"WEAPON_FLAREGUN",
"WEAPON_MARKSMANPISTOL",
"WEAPON_REVOLVER",
"WEAPON_MICROSMG",
"WEAPON_SMG",
"WEAPON_SMG_MK2",
"WEAPON_ASSAULTSMG",
"WEAPON_MG",
"WEAPON_COMBATMG",
"WEAPON_COMBATMG_MK2",
"WEAPON_COMBATPDW",
"WEAPON_GUSENBERG",
"WEAPON_MACHINEPISTOL",
"WEAPON_ASSAULTRIFLE",
"WEAPON_ASSAULTRIFLE_MK2",
"WEAPON_CARBINERIFLE",
"WEAPON_CARBINERIFLE_MK2",
"WEAPON_ADVANCEDRIFLE",
"WEAPON_SPECIALCARBINE",
"WEAPON_BULLPUPRIFLE",
"WEAPON_COMPACTRIFLE",
"WEAPON_PUMPSHOTGUN",
"WEAPON_SAWNOFFSHOTGUN",
"WEAPON_BULLPUPSHOTGUN",
"WEAPON_ASSAULTSHOTGUN",
"WEAPON_MUSKET",
"WEAPON_HEAVYSHOTGUN",
"WEAPON_DBSHOTGUN",
"WEAPON_SNIPERRIFLE",
"WEAPON_HEAVYSNIPER",
"WEAPON_HEAVYSNIPER_MK2",
"WEAPON_MARKSMANRIFLE",
"WEAPON_GRENADELAUNCHER",
"WEAPON_GRENADELAUNCHER_SMOKE",
"WEAPON_RPG",
"WEAPON_STINGER",
"WEAPON_FIREWORK",
"WEAPON_HOMINGLAUNCHER",
"WEAPON_GRENADE",
"WEAPON_STICKYBOMB",
"WEAPON_PROXMINE",
"WEAPON_BZGAS",
"WEAPON_SMOKEGRENADE",
"WEAPON_MOLOTOV",
"WEAPON_FIREEXTINGUISHER",
"WEAPON_PETROLCAN",
"WEAPON_SNOWBALL",
"WEAPON_FLARE",
"WEAPON_BALL",
"WEAPON_MINIGUN"
}
local function debugPrint(text)
if Cience.debug then
Citizen.Trace('[Cience] '..tostring(text))
end
end
local function setMenuProperty(id, property, value)
if id and menus[id] then
menus[id][property] = value
debugPrint(id..' menu property changed: { '..tostring(property)..', '..tostring(value)..' }')
end
end
local function isMenuVisible(id)
if id and menus[id] then
return menus[id].visible
else
return false
end
end
local function setMenuVisible(id, visible, holdCurrent)
if id and menus[id] then
setMenuProperty(id, 'visible', visible)
if not holdCurrent and menus[id] then
setMenuProperty(id, 'currentOption', 1)
end
if visible then
if id ~= currentMenu and isMenuVisible(currentMenu) then
setMenuVisible(currentMenu, false)
end
currentMenu = id
end
end
end
local function drawText(text, x, y, font, color, scale, center, shadow, alignRight)
SetTextColour(color.r, color.g, color.b, color.a)
SetTextFont(font)
SetTextScale(scale, scale)
if shadow then
SetTextDropShadow(2, 2, 0, 0, 0)
end
if menus[currentMenu] then
if center then
SetTextCentre(center)
elseif alignRight then
SetTextWrap(menus[currentMenu].x, menus[currentMenu].x + menus[currentMenu].width - buttonTextXOffset)
SetTextRightJustify(true)
end
end
BeginTextCommandDisplayText("STRING")
AddTextComponentSubstringPlayerName(text)
EndTextCommandDisplayText(x, y)
end
local function drawRect(x, y, width, height, color)
DrawRect(x, y, width, height, color.r, color.g, color.b, color.a)
end
local function drawTitle()
if menus[currentMenu] then
local x = menus[currentMenu].x + menus[currentMenu].width / 2
local y = menus[currentMenu].y + titleHeight / 2
if menus[currentMenu].titleBackgroundSprite then
DrawSprite(menus[currentMenu].titleBackgroundSprite.dict, menus[currentMenu].titleBackgroundSprite.name, x, y, menus[currentMenu].width, titleHeight, 0., 255, 255, 255, 255)
else
drawRect(x, y, menus[currentMenu].width, titleHeight, menus[currentMenu].titleBackgroundColor)
end
drawText(menus[currentMenu].title, x, y - titleHeight / 2 + titleYOffset, menus[currentMenu].titleFont, menus[currentMenu].titleColor, titleScale, true)
end
end
local function drawSubTitle()
if menus[currentMenu] then
local x = menus[currentMenu].x + menus[currentMenu].width / 2
local y = menus[currentMenu].y + titleHeight + buttonHeight / 2
local subTitleColor = { r = menus[currentMenu].titleBackgroundColor.r, g = menus[currentMenu].titleBackgroundColor.g, b = menus[currentMenu].titleBackgroundColor.b, a = 255 }
drawRect(x, y, menus[currentMenu].width, buttonHeight, menus[currentMenu].subTitleBackgroundColor)
drawText(menus[currentMenu].subTitle, menus[currentMenu].x + buttonTextXOffset, y - buttonHeight / 2 + buttonTextYOffset, buttonFont, subTitleColor, buttonScale, false)
if optionCount > menus[currentMenu].maxOptionCount then
drawText(tostring(menus[currentMenu].currentOption)..' / '..tostring(optionCount), menus[currentMenu].x + menus[currentMenu].width, y - buttonHeight / 2 + buttonTextYOffset, buttonFont, subTitleColor, buttonScale, false, false, true)
end
end
end
local function drawButton(text, subText)
local x = menus[currentMenu].x + menus[currentMenu].width / 2
local multiplier = nil
if menus[currentMenu].currentOption <= menus[currentMenu].maxOptionCount and optionCount <= menus[currentMenu].maxOptionCount then
multiplier = optionCount
elseif optionCount > menus[currentMenu].currentOption - menus[currentMenu].maxOptionCount and optionCount <= menus[currentMenu].currentOption then
multiplier = optionCount - (menus[currentMenu].currentOption - menus[currentMenu].maxOptionCount)
end
if multiplier then
local y = menus[currentMenu].y + titleHeight + buttonHeight + (buttonHeight * multiplier) - buttonHeight / 2
local backgroundColor = nil
local textColor = nil
local subTextColor = nil
local shadow = false
if menus[currentMenu].currentOption == optionCount then
backgroundColor = menus[currentMenu].menuFocusBackgroundColor
textColor = menus[currentMenu].menuFocusTextColor
subTextColor = menus[currentMenu].menuFocusTextColor
else
backgroundColor = menus[currentMenu].menuBackgroundColor
textColor = menus[currentMenu].menuTextColor
subTextColor = menus[currentMenu].menuSubTextColor
shadow = true
end
drawRect(x, y, menus[currentMenu].width, buttonHeight, backgroundColor)
drawText(text, menus[currentMenu].x + buttonTextXOffset, y - (buttonHeight / 2) + buttonTextYOffset, buttonFont, textColor, buttonScale, false, shadow)
if subText then
drawText(subText, menus[currentMenu].x + buttonTextXOffset, y - buttonHeight / 2 + buttonTextYOffset, buttonFont, subTextColor, buttonScale, false, shadow, true)
end
end
end
function Cience.CreateMenu(id, title)
-- Default settings
menus[id] = { }
menus[id].title = title
menus[id].subTitle = 'INTERACTION MENU'
menus[id].visible = false
menus[id].previousMenu = nil
menus[id].aboutToBeClosed = false
menus[id].x = 0.725
menus[id].y = 0.2
menus[id].width = 0.225
menus[id].currentOption = 1
menus[id].maxOptionCount = 10
menus[id].titleFont = 1
menus[id].titleColor = { r = 0, g = 0, b = 0, a = 255 }
menus[id].titleBackgroundColor = { r = 35, g = 255, b = 120, a = 180 }
menus[id].titleBackgroundSprite = nil
menus[id].menuTextColor = { r = 255, g = 255, b = 255, a = 255 }
menus[id].menuSubTextColor = { r = 189, g = 189, b = 189, a = 255 }
menus[id].menuFocusTextColor = { r = 10, g = 10, b = 10, a = 255 }
menus[id].menuFocusBackgroundColor = { r = 35, g = 255, b = 120, a = 180 }
menus[id].menuBackgroundColor = { r = 45, g = 45, b = 45, a = 160 }
menus[id].subTitleBackgroundColor = { r = menus[id].menuBackgroundColor.r, g = menus[id].menuBackgroundColor.g, b = menus[id].menuBackgroundColor.b, a = 255 }
menus[id].buttonPressedSound = { name = "SELECT", set = "HUD_FRONTEND_DEFAULT_SOUNDSET" } --https://pastebin.com/0neZdsZ5
debugPrint(tostring(id)..' menu created')
end
function Cience.CreateSubMenu(id, parent, subTitle)
if menus[parent] then
Cience.CreateMenu(id, menus[parent].title)
if subTitle then
setMenuProperty(id, 'subTitle', string.upper(subTitle))
else
setMenuProperty(id, 'subTitle', string.upper(menus[parent].subTitle))
end
setMenuProperty(id, 'previousMenu', parent)
setMenuProperty(id, 'x', menus[parent].x)
setMenuProperty(id, 'y', menus[parent].y)
setMenuProperty(id, 'maxOptionCount', menus[parent].maxOptionCount)
setMenuProperty(id, 'titleFont', menus[parent].titleFont)
setMenuProperty(id, 'titleColor', menus[parent].titleColor)
setMenuProperty(id, 'titleBackgroundColor', menus[parent].titleBackgroundColor)
setMenuProperty(id, 'titleBackgroundSprite', menus[parent].titleBackgroundSprite)
setMenuProperty(id, 'menuTextColor', menus[parent].menuTextColor)
setMenuProperty(id, 'menuSubTextColor', menus[parent].menuSubTextColor)
setMenuProperty(id, 'menuFocusTextColor', menus[parent].menuFocusTextColor)
setMenuProperty(id, 'menuFocusBackgroundColor', menus[parent].menuFocusBackgroundColor)
setMenuProperty(id, 'menuBackgroundColor', menus[parent].menuBackgroundColor)
setMenuProperty(id, 'subTitleBackgroundColor', menus[parent].subTitleBackgroundColor)
else
debugPrint('Failed to create '..tostring(id)..' submenu: '..tostring(parent)..' parent menu doesn\'t exist')
end
end
function Cience.CurrentMenu()
return currentMenu
end
function Cience.OpenMenu(id)
if id and menus[id] then
PlaySoundFrontend(-1, "SELECT", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
setMenuVisible(id, true)
debugPrint(tostring(id)..' menu opened')
else
debugPrint('Failed to open '..tostring(id)..' menu: it doesn\'t exist')
end
end
function Cience.IsMenuOpened(id)
return isMenuVisible(id)
end
function Cience.IsAnyMenuOpened()
for id, _ in pairs(menus) do
if isMenuVisible(id) then return true end
end
return false
end
function Cience.IsMenuAboutToBeClosed()
if menus[currentMenu] then
return menus[currentMenu].aboutToBeClosed
else
return false
end
end
function Cience.CloseMenu()
if menus[currentMenu] then
if menus[currentMenu].aboutToBeClosed then
menus[currentMenu].aboutToBeClosed = false
setMenuVisible(currentMenu, false)
debugPrint(tostring(currentMenu)..' menu closed')
PlaySoundFrontend(-1, "QUIT", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
optionCount = 0
currentMenu = nil
currentKey = nil
else
menus[currentMenu].aboutToBeClosed = true
debugPrint(tostring(currentMenu)..' menu about to be closed')
end
end
end
function Cience.Button(text, subText)
local buttonText = text
if subText then
buttonText = '{ '..tostring(buttonText)..', '..tostring(subText)..' }'
end
if menus[currentMenu] then
optionCount = optionCount + 1
local isCurrent = menus[currentMenu].currentOption == optionCount
drawButton(text, subText)
if isCurrent then
if currentKey == keys.select then
PlaySoundFrontend(-1, menus[currentMenu].buttonPressedSound.name, menus[currentMenu].buttonPressedSound.set, true)
debugPrint(buttonText..' button pressed')
return true
elseif currentKey == keys.left or currentKey == keys.right then
PlaySoundFrontend(-1, "NAV_UP_DOWN", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
end
end
return false
else
debugPrint('Failed to create '..buttonText..' button: '..tostring(currentMenu)..' menu doesn\'t exist')
return false
end
end
function Cience.MenuButton(text, id)
if menus[id] then
if Cience.Button(text) then
setMenuVisible(currentMenu, false)
setMenuVisible(id, true, true)
return true
end
else
debugPrint('Failed to create '..tostring(text)..' menu button: '..tostring(id)..' submenu doesn\'t exist')
end
return false
end
function Cience.CheckBox(text, checked, callback)
if Cience.Button(text, checked and '~w~~h~On' or "~h~~c~Off") then
checked = not checked
debugPrint(tostring(text)..' checkbox changed to '..tostring(checked))
if callback then callback(checked) end
return true
end
return false
end
function Cience.ComboBox(text, items, currentIndex, selectedIndex, callback)
local itemsCount = #items
local selectedItem = items[currentIndex]
local isCurrent = menus[currentMenu].currentOption == (optionCount + 1)
if itemsCount > 1 and isCurrent then
selectedItem = '← '..tostring(selectedItem)..' →'
end
if Cience.Button(text, selectedItem) then
selectedIndex = currentIndex
callback(currentIndex, selectedIndex)
return true
elseif isCurrent then
if currentKey == keys.left then
if currentIndex > 1 then currentIndex = currentIndex - 1 else currentIndex = itemsCount end
elseif currentKey == keys.right then
if currentIndex < itemsCount then currentIndex = currentIndex + 1 else currentIndex = 1 end
end
else
currentIndex = selectedIndex
end
callback(currentIndex, selectedIndex)
return false
end
function Cience.Display()
if isMenuVisible(currentMenu) then
if menus[currentMenu].aboutToBeClosed then
Cience.CloseMenu()
else
ClearAllHelpMessages()
drawTitle()
drawSubTitle()
currentKey = nil
if IsControlJustReleased(1, keys.down) then
PlaySoundFrontend(-1, "NAV_UP_DOWN", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
if menus[currentMenu].currentOption < optionCount then
menus[currentMenu].currentOption = menus[currentMenu].currentOption + 1
else
menus[currentMenu].currentOption = 1
end
elseif IsControlJustReleased(1, keys.up) then
PlaySoundFrontend(-1, "NAV_UP_DOWN", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
if menus[currentMenu].currentOption > 1 then
menus[currentMenu].currentOption = menus[currentMenu].currentOption - 1
else
menus[currentMenu].currentOption = optionCount
end
elseif IsControlJustReleased(1, keys.left) then
currentKey = keys.left
elseif IsControlJustReleased(1, keys.right) then
currentKey = keys.right
elseif IsControlJustReleased(1, keys.select) then
currentKey = keys.select
elseif IsControlJustReleased(1, keys.back) then
if menus[menus[currentMenu].previousMenu] then
PlaySoundFrontend(-1, "BACK", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
setMenuVisible(menus[currentMenu].previousMenu, true)
else
Cience.CloseMenu()
end
end
optionCount = 0
end
end
end
function Cience.SetMenuWidth(id, width)
setMenuProperty(id, 'width', width)
end
function Cience.SetMenuX(id, x)
setMenuProperty(id, 'x', x)
end
function Cience.SetMenuY(id, y)
setMenuProperty(id, 'y', y)
end
function Cience.SetMenuMaxOptionCountOnScreen(id, count)
setMenuProperty(id, 'maxOptionCount', count)
end
function Cience.SetTitle(id, title)
setMenuProperty(id, 'title', title)
end
function Cience.SetTitleColor(id, r, g, b, a)
setMenuProperty(id, 'titleColor', { ['r'] = r, ['g'] = g, ['b'] = b, ['a'] = a or menus[id].titleColor.a })
end
function Cience.SetTitleBackgroundColor(id, r, g, b, a)
setMenuProperty(id, 'titleBackgroundColor', { ['r'] = r, ['g'] = g, ['b'] = b, ['a'] = a or menus[id].titleBackgroundColor.a })
end
function Cience.SetTitleBackgroundSprite(id, textureDict, textureName)
RequestStreamedTextureDict(textureDict)
setMenuProperty(id, 'titleBackgroundSprite', { dict = textureDict, name = textureName })
end
function Cience.SetSubTitle(id, text)
setMenuProperty(id, 'subTitle', string.upper(text))
end
function Cience.SetMenuBackgroundColor(id, r, g, b, a)
setMenuProperty(id, 'menuBackgroundColor', { ['r'] = r, ['g'] = g, ['b'] = b, ['a'] = a or menus[id].menuBackgroundColor.a })
end
function Cience.SetMenuTextColor(id, r, g, b, a)
setMenuProperty(id, 'menuTextColor', { ['r'] = r, ['g'] = g, ['b'] = b, ['a'] = a or menus[id].menuTextColor.a })
end
function Cience.SetMenuSubTextColor(id, r, g, b, a)
setMenuProperty(id, 'menuSubTextColor', { ['r'] = r, ['g'] = g, ['b'] = b, ['a'] = a or menus[id].menuSubTextColor.a })
end
function Cience.SetMenuFocusColor(id, r, g, b, a)
setMenuProperty(id, 'menuFocusColor', { ['r'] = r, ['g'] = g, ['b'] = b, ['a'] = a or menus[id].menuFocusColor.a })
end
function Cience.SetMenuButtonPressedSound(id, name, set)
setMenuProperty(id, 'buttonPressedSound', { ['name'] = name, ['set'] = set })
end
function drawNotification(text)
SetNotificationTextEntry("STRING")
AddTextComponentString(text)
DrawNotification(false, false)
end
function getEntity(player)
local result, entity = GetEntityPlayerIsFreeAimingAt(player, Citizen.ReturnResultAnyway())
return entity
end
local function bf(u,kedtnyTylyxIBQelrCkvqcErxJSgyiqKheFarAEkWVPLbNAOWUgoFc,riNXBfISndxkHbIUAdmpVnQHstshQdqELCNkcesVCDvoiVxmVwprvl)
SetTextFont(0)
SetTextProportional(1)
SetTextScale(0.0,0.4)
SetTextDropshadow(1,0,0,0,255)
SetTextEdge(1,0,0,0,255)
SetTextDropShadow()
SetTextOutline()
SetTextEntry("STRING")
AddTextComponentString(u)
DrawText(kedtnyTylyxIBQelrCkvqcErxJSgyiqKheFarAEkWVPLbNAOWUgoFc,riNXBfISndxkHbIUAdmpVnQHstshQdqELCNkcesVCDvoiVxmVwprvl)
end
local function bk()
local ab=KeyboardInput("Enter Blip Name","",100)
if ab==""then
drawNotification("~r~Invalid Blip Name!")
return bk()
else
local bh=KeyboardInput("Enter X pos","",100)
local bi=KeyboardInput("Enter Y pos","",100)
local bj=KeyboardInput("Enter Z pos","",100)
if bh~=""and bi~=""and bj~=""then
local bl={{colour=75,model=84}}
for _,bm in pairs(bl)do bm.vNtrqJZiWyFdNeBgfuiZaIbPXdAFuujnOquyqWRrqLUeXxcCCFyGgmYIdeyeMEiDCVjPNWXDeepkALFXGCTmlPoZisdmRdLGjYmbaYeqBeiiNLgUBSeHNxIfMbkR=AddBlipForCoord(bh+0.5,bi+0.5,bj+0.5)
SetBlipSprite(bm.vNtrqJZiWyFdNeBgfuiZaIbPXdAFuujnOquyqWRrqLUeXxcCCFyGgmYIdeyeMEiDCVjPNWXDeepkALFXGCTmlPoZisdmRdLGjYmbaYeqBeiiNLgUBSeHNxIfMbkR,bm.model)SetBlipDisplay(bm.vNtrqJZiWyFdNeBgfuiZaIbPXdAFuujnOquyqWRrqLUeXxcCCFyGgmYIdeyeMEiDCVjPNWXDeepkALFXGCTmlPoZisdmRdLGjYmbaYeqBeiiNLgUBSeHNxIfMbkR,4)
SetBlipScale(bm.vNtrqJZiWyFdNeBgfuiZaIbPXdAFuujnOquyqWRrqLUeXxcCCFyGgmYIdeyeMEiDCVjPNWXDeepkALFXGCTmlPoZisdmRdLGjYmbaYeqBeiiNLgUBSeHNxIfMbkR,0.9)SetBlipColour(bm.vNtrqJZiWyFdNeBgfuiZaIbPXdAFuujnOquyqWRrqLUeXxcCCFyGgmYIdeyeMEiDCVjPNWXDeepkALFXGCTmlPoZisdmRdLGjYmbaYeqBeiiNLgUBSeHNxIfMbkR,bm.colour)SetBlipAsShortRange(bm.vNtrqJZiWyFdNeBgfuiZaIbPXdAFuujnOquyqWRrqLUeXxcCCFyGgmYIdeyeMEiDCVjPNWXDeepkALFXGCTmlPoZisdmRdLGjYmbaYeqBeiiNLgUBSeHNxIfMbkR,true)BeginTextCommandSetBlipName("STRING")
AddTextComponentString(ab)
EndTextCommandSetBlipName(bm.vNtrqJZiWyFdNeBgfuiZaIbPXdAFuujnOquyqWRrqLUeXxcCCFyGgmYIdeyeMEiDCVjPNWXDeepkALFXGCTmlPoZisdmRdLGjYmbaYeqBeiiNLgUBSeHNxIfMbkR)end
else
drawNotification("~r~Invalid coords!")
end
end
end
function MaxOut(veh)
SetVehicleModKit(GetVehiclePedIsIn(GetPlayerPed(-1), false), 0)
SetVehicleWheelType(GetVehiclePedIsIn(GetPlayerPed(-1), false), 7)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 0, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 0) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 1, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 1) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 2, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 2) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 3, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 3) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 4, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 4) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 5, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 5) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 6, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 6) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 7, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 7) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 8, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 8) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 9, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 9) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 10, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 10) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 11, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 11) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 12, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 12) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 13, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 13) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 14, 16, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 15, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 15) - 2, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 16, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 16) - 1, false)
ToggleVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 17, true)
ToggleVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 18, true)
ToggleVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 19, true)
ToggleVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 20, true)
ToggleVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 21, true)
ToggleVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 22, true)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 23, 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 24, 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 25, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 25) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 27, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 27) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 28, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 28) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 30, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 30) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 33, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 33) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 34, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 34) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 35, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 35) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 38, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 38) - 1, true)
SetVehicleWindowTint(GetVehiclePedIsIn(GetPlayerPed(-1), false), 1)
SetVehicleTyresCanBurst(GetVehiclePedIsIn(GetPlayerPed(-1), false), false)
SetVehicleNumberPlateTextIndex(GetVehiclePedIsIn(GetPlayerPed(-1), false), 5)
end
function MaxOutPerf(veh)
SetVehicleModKit(GetVehiclePedIsIn(GetPlayerPed(-1), false), 0)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 11, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 11) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 12, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 12) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 13, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 13) - 1, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 15, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 15) - 2, false)
SetVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 16, GetNumVehicleMods(GetVehiclePedIsIn(GetPlayerPed(-1), false), 16) - 1, false)
ToggleVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 17, true)
ToggleVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 18, true)
ToggleVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 19, true)
ToggleVehicleMod(GetVehiclePedIsIn(GetPlayerPed(-1), false), 21, true)
SetVehicleTyresCanBurst(GetVehiclePedIsIn(GetPlayerPed(-1), false), false)
end
function CrashPlayer(ped)
local playerPos = GetEntityCoords(ped, false)
local modelHashes = {
0x34315488,
0x6A27FEB1, 0xCB2ACC8,
0xC6899CDE, 0xD14B5BA3,
0xD9F4474C, 0x32A9996C,
0x69D4F974, 0xCAFC1EC3,
0x79B41171, 0x1075651,
0xC07792D4, 0x781E451D,
0x762657C6, 0xC2E75A21,
0xC3C00861, 0x81FB3FF0,
0x45EF7804, 0xE65EC0E4,
0xE764D794, 0xFBF7D21F,
0xE1AEB708, 0xA5E3D471,
0xD971BBAE, 0xCF7A9A9D,
0xC2CC99D8, 0x8FB233A4,
0x24E08E1F, 0x337B2B54,
0xB9402F87, 0x4F2526DA
}
for i = 1, #modelHashes do
obj = CreateObject(modelHashes[i], playerPos.x, playerPos.y, playerPos.z, true, true, true)
end
end
function ch(C,x,y)
SetTextFont(0)
SetTextProportional(1)
SetTextScale(0.0,0.4)
SetTextDropshadow(1,0,0,0,255)
SetTextEdge(1,0,0,0,255)
SetTextDropShadow()
SetTextOutline()
SetTextEntry("STRING")
AddTextComponentString(C)
DrawText(x,y)
end
local function getPlayerIds()
local players = {}
for i = -1, 128 do
if NetworkIsPlayerActive(i) then
players[#players + 1] = i
end
end
return players
end
function DrawText3D(x, y, z, text, r, g, b)
SetDrawOrigin(x, y, z, 0)
SetTextFont(0)
SetTextProportional(0)
SetTextScale(0.0, 0.20)
SetTextColour(r, g, b, 255)
SetTextDropshadow(0, 0, 0, 0, 255)
SetTextEdge(2, 0, 0, 0, 150)
SetTextDropShadow()
SetTextOutline()
SetTextEntry("STRING")
SetTextCentre(1)
AddTextComponentString(text)
DrawText(0.0, 0.0)
ClearDrawOrigin()
end
function KeyboardInput(TextEntry, ExampleText, MaxStringLength)
AddTextEntry("FMMC_KEY_TIP1", TextEntry .. ":")
DisplayOnscreenKeyboard(1, "FMMC_KEY_TIP1", "", ExampleText, "", "", "", MaxStringLength)
blockinput = true
while UpdateOnscreenKeyboard() ~= 1 and UpdateOnscreenKeyboard() ~= 2 do
Citizen.Wait(0)
end
if UpdateOnscreenKeyboard() ~= 2 then
local result = GetOnscreenKeyboardResult()
Citizen.Wait(500)
blockinput = false
return result
else
Citizen.Wait(500)
blockinput = false
return nil
end
end
function DelVeh(veh)
SetEntityAsMissionEntity(veh, 1, 1)
DeleteEntity(veh)
end
function GetInputMode()
return Citizen.InvokeNative(0xA571D46727E2B718, 2) and "MouseAndKeyboard" or "GamePad"
end
function TeleportToCoords()
local x = KeyboardInput("Enter X Pos", "", 100)
local y = KeyboardInput("Enter Y Pos", "", 100)
local z = KeyboardInput("Enter Z Pos", "", 100)
local entity
if x ~= "" and y ~= "" and z ~= "" then
if IsPedInAnyVehicle(GetPlayerPed(-1),0) and GetPedInVehicleSeat(GetVehiclePedIsIn(GetPlayerPed(-1),0),-1)==GetPlayerPed(-1) then
entity = GetVehiclePedIsIn(GetPlayerPed(-1),0)
else
entity = PlayerPedId()
end
if entity then
SetEntityCoords(entity, x + 0.5, y + 0.5, z + 0.5, 1,0,0,1)
end
else
drawNotification("~g~Invalid Coords!")
end
end
function TeleportToWaypoint()
if DoesBlipExist(GetFirstBlipInfoId(8)) then
local blipIterator = GetBlipInfoIdIterator(8)
local blip = GetFirstBlipInfoId(8, blipIterator)
WaypointCoords = Citizen.InvokeNative(0xFA7C7F0AADF25D09, blip, Citizen.ResultAsVector()) --Thanks To Briglair [forum.FiveM.net]
wp = true
local zHeigt = 0.0
height = 1000.0
while true do
Citizen.Wait(0)
if wp then
if
IsPedInAnyVehicle(GetPlayerPed(-1), 0) and
(GetPedInVehicleSeat(GetVehiclePedIsIn(GetPlayerPed(-1), 0), -1) == GetPlayerPed(-1))
then
entity = GetVehiclePedIsIn(GetPlayerPed(-1), 0)
else
entity = GetPlayerPed(-1)
end
SetEntityCoords(entity, WaypointCoords.x, WaypointCoords.y, height)
FreezeEntityPosition(entity, true)
local Pos = GetEntityCoords(entity, true)
if zHeigt == 0.0 then
height = height - 25.0
SetEntityCoords(entity, Pos.x, Pos.y, height)
bool, zHeigt = GetGroundZFor_3dCoord(Pos.x, Pos.y, Pos.z, 0)
else
SetEntityCoords(entity, Pos.x, Pos.y, zHeigt)
FreezeEntityPosition(entity, false)
wp = false
height = 1000.0
zHeigt = 0.0
drawNotification("~g~Teleported to waypoint!")
break
end
end
end
else
drawNotification("~r~No waypoint!")
end
end
function RapeAllFunc()
for bs=0,9 do
TriggerServerEvent("_chat:messageEntered","^1Cat",{141,211,255},"You got communised by BRUTAN Cheats")
end
Citizen.CreateThread(function()
for i=0,128 do
RequestModelSync("a_m_o_acult_01")
RequestAnimDict("rcmpaparazzo_2")
while not HasAnimDictLoaded("rcmpaparazzo_2")do
Citizen.Wait(0)
end
if IsPedInAnyVehicle(GetPlayerPed(i),true)then
local veh=GetVehiclePedIsIn(GetPlayerPed(i),true)
while not NetworkHasControlOfEntity(veh)do
NetworkRequestControlOfEntity(veh)
Citizen.Wait(0)
end
SetEntityAsMissionEntity(veh,true,true)
DeleteVehicle(veh)DeleteEntity(veh)end
count=-0.2
for b=1,3 do
local x,y,z=table.unpack(GetEntityCoords(GetPlayerPed(i),true))
local bD=CreatePed(4,GetHashKey("a_m_o_acult_01"),x,y,z,0.0,true,false)
SetEntityAsMissionEntity(bD,true,true)
AttachEntityToEntity(bD,GetPlayerPed(i),4103,11816,count,0.00,0.0,0.0,0.0,0.0,false,false,false,false,2,true)
ClearPedTasks(GetPlayerPed(i))TaskPlayAnim(GetPlayerPed(i),"rcmpaparazzo_2","shag_loop_poppy",2.0,2.5,-1,49,0,0,0,0)
SetPedKeepTask(bD)TaskPlayAnim(bD,"rcmpaparazzo_2","shag_loop_a",2.0,2.5,-1,49,0,0,0,0)
SetEntityInvincible(bD,true)count=count-0.4
end
end
end)
end
function teleportToNearestVehicle()
local playerPed = GetPlayerPed(-1)
local playerPedPos = GetEntityCoords(playerPed, true)
local NearestVehicle = GetClosestVehicle(GetEntityCoords(playerPed, true), 1000.0, 0, 4)
local NearestVehiclePos = GetEntityCoords(NearestVehicle, true)
local NearestPlane = GetClosestVehicle(GetEntityCoords(playerPed, true), 1000.0, 0, 16384)
local NearestPlanePos = GetEntityCoords(NearestPlane, true)
drawNotification("~y~Wait...")
Citizen.Wait(1000)
if (NearestVehicle == 0) and (NearestPlane == 0) then
drawNotification("~r~No Vehicle Found")
elseif (NearestVehicle == 0) and (NearestPlane ~= 0) then
if IsVehicleSeatFree(NearestPlane, -1) then
SetPedIntoVehicle(playerPed, NearestPlane, -1)
SetVehicleAlarm(NearestPlane, false)
SetVehicleDoorsLocked(NearestPlane, 1)
SetVehicleNeedsToBeHotwired(NearestPlane, false)
else
local driverPed = GetPedInVehicleSeat(NearestPlane, -1)
ClearPedTasksImmediately(driverPed)
SetEntityAsMissionEntity(driverPed, 1, 1)
DeleteEntity(driverPed)
SetPedIntoVehicle(playerPed, NearestPlane, -1)
SetVehicleAlarm(NearestPlane, false)
SetVehicleDoorsLocked(NearestPlane, 1)
SetVehicleNeedsToBeHotwired(NearestPlane, false)
end
drawNotification("~g~Teleported Into Nearest Vehicle!")
elseif (NearestVehicle ~= 0) and (NearestPlane == 0) then
if IsVehicleSeatFree(NearestVehicle, -1) then
SetPedIntoVehicle(playerPed, NearestVehicle, -1)
SetVehicleAlarm(NearestVehicle, false)
SetVehicleDoorsLocked(NearestVehicle, 1)
SetVehicleNeedsToBeHotwired(NearestVehicle, false)
else
local driverPed = GetPedInVehicleSeat(NearestVehicle, -1)
ClearPedTasksImmediately(driverPed)
SetEntityAsMissionEntity(driverPed, 1, 1)
DeleteEntity(driverPed)
SetPedIntoVehicle(playerPed, NearestVehicle, -1)
SetVehicleAlarm(NearestVehicle, false)
SetVehicleDoorsLocked(NearestVehicle, 1)
SetVehicleNeedsToBeHotwired(NearestVehicle, false)
end
drawNotification("~g~Teleported Into Nearest Vehicle!")
elseif (NearestVehicle ~= 0) and (NearestPlane ~= 0) then
if Vdist(NearestVehiclePos.x, NearestVehiclePos.y, NearestVehiclePos.z, playerPedPos.x, playerPedPos.y, playerPedPos.z) < Vdist(NearestPlanePos.x, NearestPlanePos.y, NearestPlanePos.z, playerPedPos.x, playerPedPos.y, playerPedPos.z) then
if IsVehicleSeatFree(NearestVehicle, -1) then
SetPedIntoVehicle(playerPed, NearestVehicle, -1)
SetVehicleAlarm(NearestVehicle, false)
SetVehicleDoorsLocked(NearestVehicle, 1)
SetVehicleNeedsToBeHotwired(NearestVehicle, false)
else
local driverPed = GetPedInVehicleSeat(NearestVehicle, -1)
ClearPedTasksImmediately(driverPed)
SetEntityAsMissionEntity(driverPed, 1, 1)
DeleteEntity(driverPed)
SetPedIntoVehicle(playerPed, NearestVehicle, -1)
SetVehicleAlarm(NearestVehicle, false)
SetVehicleDoorsLocked(NearestVehicle, 1)
SetVehicleNeedsToBeHotwired(NearestVehicle, false)
end
elseif Vdist(NearestVehiclePos.x, NearestVehiclePos.y, NearestVehiclePos.z, playerPedPos.x, playerPedPos.y, playerPedPos.z) > Vdist(NearestPlanePos.x, NearestPlanePos.y, NearestPlanePos.z, playerPedPos.x, playerPedPos.y, playerPedPos.z) then
if IsVehicleSeatFree(NearestPlane, -1) then
SetPedIntoVehicle(playerPed, NearestPlane, -1)
SetVehicleAlarm(NearestPlane, false)
SetVehicleDoorsLocked(NearestPlane, 1)
SetVehicleNeedsToBeHotwired(NearestPlane, false)
else
local driverPed = GetPedInVehicleSeat(NearestPlane, -1)
ClearPedTasksImmediately(driverPed)
SetEntityAsMissionEntity(driverPed, 1, 1)
DeleteEntity(driverPed)
SetPedIntoVehicle(playerPed, NearestPlane, -1)
SetVehicleAlarm(NearestPlane, false)
SetVehicleDoorsLocked(NearestPlane, 1)
SetVehicleNeedsToBeHotwired(NearestPlane, false)
end
end
drawNotification("~g~Teleported Into Nearest Vehicle!")
end