-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.lua
More file actions
772 lines (642 loc) · 24.6 KB
/
client.lua
File metadata and controls
772 lines (642 loc) · 24.6 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
ESX = exports["es_extended"]:getSharedObject()
verifiedPlates = {}
abandonedVehicles = {}
trackedNPCVehicles = {}
lockpickingVehicle = false
local lastLockpickCheck = 0
local hasLockpickCache = false
local rentalPlatesCache = {}
local lastRentalCheck = 0
local trackedMotorcycles = {}
local deadNPCVehicles = {}
local deadNPCUnlockChance = 30
local LOCKPICK_DURATION = 3500
local SPECIAL_MOTORCYCLE_HANDLING = true
local LOCKPICK_ANIM = {
dict = 'missheistfbisetup1',
anim = 'hassle_intro_loop_f'
}
local ALERT_BLIP = {
sprite = 161,
color = 1,
scale = 0.8,
duration = 60,
flash = true
}
function markVehicleUnlockedOnServer(vehicle, vehicleId)
local netId = NetworkGetNetworkIdFromEntity(vehicle)
if netId and netId ~= 0 then
TriggerServerEvent('vehicle_lockpick:markVehicleUnlocked', netId, vehicleId)
end
end
RegisterNetEvent('vehicle_lockpick:syncUnlockedVehicle')
AddEventHandler('vehicle_lockpick:syncUnlockedVehicle', function(netId, vehicleId)
abandonedVehicles[vehicleId] = true
local vehicle = NetworkGetEntityFromNetworkId(netId)
if DoesEntityExist(vehicle) then
unlockVehicle(vehicle)
end
end)
function isVehicleBlacklisted(vehicle)
if not DoesEntityExist(vehicle) then return false end
if SPECIAL_MOTORCYCLE_HANDLING and shouldMotorcycleBeUnlocked(vehicle) then
return true
end
local category = GetVehicleClass(vehicle)
if Config.BlacklistedCategories and Config.BlacklistedCategories[category] then
return true
end
local modelName = GetDisplayNameFromVehicleModel(GetEntityModel(vehicle)):lower()
if Config.BlacklistedModels[modelName] then
return true
end
local plate = GetVehicleNumberPlateText(vehicle)
if plate then
plate = string.gsub(plate, "%s+", "")
for blacklistedPlate, _ in pairs(Config.BlacklistedPlates) do
if string.find(plate:upper(), blacklistedPlate:upper()) then
return true
end
end
end
return false
end
function shouldMotorcycleBeUnlocked(vehicle)
local category = GetVehicleClass(vehicle)
if category ~= 8 then
return false
end
local vehicleId = getVehicleIdentifier(vehicle)
if trackedMotorcycles[vehicleId] == true and not isVehicleOccupiedByNPC(vehicle) then
abandonedVehicles[vehicleId] = true
return true
end
return isVehicleOccupiedByNPC(vehicle)
end
function isPlayerOwnedVehicle(vehicle)
local plate = GetVehicleNumberPlateText(vehicle)
if plate then
plate = string.gsub(plate, "^%s*(.-)%s*$", "%1")
if verifiedPlates[plate] ~= nil then
return verifiedPlates[plate]
end
local result = nil
ESX.TriggerServerCallback('vehicle_restriction:isPlayerOwnedVehicle', function(isOwned)
result = isOwned
verifiedPlates[plate] = isOwned
end, plate)
local timeout = 50
while result == nil and timeout > 0 do
Wait(10)
timeout = timeout - 1
end
return result or false
end
return false
end
function isVehicleOccupiedByNPC(vehicle)
for seat = -1, 6 do
local ped = GetPedInVehicleSeat(vehicle, seat)
if ped ~= 0 and not IsPedAPlayer(ped) and not IsPedDeadOrDying(ped) then
return true
end
end
return false
end
function hasDeadNPCInVehicle(vehicle)
for seat = -1, 6 do
local ped = GetPedInVehicleSeat(vehicle, seat)
if ped ~= 0 and not IsPedAPlayer(ped) and IsPedDeadOrDying(ped) then
return true
end
end
return false
end
function isVehicleAbandoned(vehicleId)
return abandonedVehicles and abandonedVehicles[vehicleId] == true
end
function isAnyVehicleDoorOpen(vehicle)
for i = 0, 5 do
if DoesVehicleHaveDoor(vehicle, i) and GetVehicleDoorAngleRatio(vehicle, i) > 0.0 then
return true
end
end
return false
end
function lockVehicle(vehicle)
SetVehicleDoorsLocked(vehicle, 2)
end
function unlockVehicle(vehicle)
SetVehicleDoorsLocked(vehicle, 0)
end
function getVehicleIdentifier(vehicle)
local plate = GetVehicleNumberPlateText(vehicle) or ""
local model = GetEntityModel(vehicle) or 0
return plate .. "_" .. model
end
function hasLockpick()
local currentTime = GetGameTimer()
if currentTime - lastLockpickCheck > 3000 then
hasLockpickCache = exports.ox_inventory:Search('count', Config.LockpickItem) > 0
lastLockpickCheck = currentTime
end
return hasLockpickCache
end
function stopLockpickAnimation()
local playerPed = PlayerPedId()
ClearPedTasks(playerPed)
end
function GetVehicleInDirection(coordFrom, coordTo)
local rayHandle = StartExpensiveSynchronousShapeTestLosProbe(coordFrom.x, coordFrom.y, coordFrom.z, coordTo.x, coordTo.y, coordTo.z, 10, PlayerPedId(), 0)
local _, _, _, _, vehicle = GetShapeTestResult(rayHandle)
return vehicle
end
function isVehicleIgnored(vehicle)
if not DoesEntityExist(vehicle) then return false end
local modelName = GetDisplayNameFromVehicleModel(GetEntityModel(vehicle)):lower()
if Config.IgnoredModels[modelName] then
return true
end
local plate = GetVehicleNumberPlateText(vehicle)
if plate then
plate = string.gsub(plate, "%s+", "")
for ignoredPlate, _ in pairs(Config.IgnoredPlates) do
if string.find(plate:upper(), ignoredPlate:upper()) then
return true
end
end
end
return false
end
function makePedsWalkAway(coords, radius)
local peds = GetGamePool('CPed')
for _, ped in pairs(peds) do
if DoesEntityExist(ped) and not IsPedAPlayer(ped) and not IsPedInAnyVehicle(ped, true) then
local pedCoords = GetEntityCoords(ped)
local distance = #(coords - pedCoords)
if distance <= radius then
if not IsPedInMeleeCombat(ped) and not IsPedFleeing(ped) and not IsPedDeadOrDying(ped) then
local awayVector = vector3(
pedCoords.x - coords.x,
pedCoords.y - coords.y,
0
)
local length = #awayVector
if length > 0 then
awayVector = vector3(
awayVector.x / length * 40.0,
awayVector.y / length * 40.0,
0
)
else
local randomAngle = math.random() * 2 * math.pi
awayVector = vector3(
math.cos(randomAngle) * 40.0,
math.sin(randomAngle) * 40.0,
0
)
end
local destCoords = vector3(
pedCoords.x + awayVector.x,
pedCoords.y + awayVector.y,
pedCoords.z
)
ClearPedTasksImmediately(ped)
SetPedMoveRateOverride(ped, 0.8 + (math.random() * 0.9))
TaskGoToCoordAnyMeans(ped, destCoords.x, destCoords.y, destCoords.z, 1.0, 0, false, 0, 0)
end
end
end
end
end
function lockpickVehicle(vehicle)
if lockpickingVehicle then
return
end
if not hasLockpick() then
lib.notify({
title = 'Information',
description = Config.Notifications.NoLockpick,
type = 'error'
})
return
end
if isPlayerOwnedVehicle(vehicle) then
return
end
if isVehicleBlacklisted(vehicle) then
lib.notify({
title = 'Information',
description = Config.Notifications.VehicleAlreadyUnlocked,
type = 'error'
})
return
end
if isVehicleIgnored(vehicle) then
lib.notify({
title = 'Information',
description = Config.Notifications.CannotLockpick,
type = 'error'
})
return
end
if isRentalVehicle(vehicle) then
lib.notify({
title = 'Information',
description = Config.Notifications.RentalVehicle,
type = 'error'
})
return
end
if isVehicleOccupiedByNPC(vehicle) then
lib.notify({
title = 'Information',
description = Config.Notifications.NPCInVehicle,
type = 'error'
})
return
end
local lockStatus = GetVehicleDoorLockStatus(vehicle)
if lockStatus == 0 or lockStatus == 1 or isAnyVehicleDoorOpen(vehicle) then
lib.notify({
title = 'Information',
description = Config.Notifications.VehicleAlreadyUnlocked,
type = 'info'
})
return
end
local vehicleId = getVehicleIdentifier(vehicle)
if isVehicleAbandoned(vehicleId) then
lib.notify({
title = 'Information',
description = Config.Notifications.VehicleAlreadyUnlocked,
type = 'info'
})
return
end
lockpickingVehicle = true
local playerPed = PlayerPedId()
local hasWeapon = HasPedGotWeapon(playerPed, GetSelectedPedWeapon(playerPed), false)
local weaponHash = GetSelectedPedWeapon(playerPed)
if hasWeapon and weaponHash ~= GetHashKey('WEAPON_UNARMED') then
local vehicleCoords = GetEntityCoords(vehicle)
local playerCoords = GetEntityCoords(playerPed)
local currentHeading = GetEntityHeading(playerPed)
local targetHeading = GetHeadingFromVector_2d(vehicleCoords.x - playerCoords.x, vehicleCoords.y - playerCoords.y)
local headingDiff = (((targetHeading - currentHeading) + 180) % 360) - 180
if headingDiff > 180 then headingDiff = headingDiff - 360 end
if headingDiff < -180 then headingDiff = headingDiff + 360 end
if headingDiff > 120 then headingDiff = 120 end
if headingDiff < -120 then headingDiff = -120 end
local newHeading = (currentHeading + headingDiff) % 360
TaskAchieveHeading(playerPed, newHeading, 750)
Citizen.Wait(750)
local dict = "reaction@intimidation@1h"
local anim = "outro"
RequestAnimDict(dict)
while not HasAnimDictLoaded(dict) do
Citizen.Wait(10)
end
TaskPlayAnim(playerPed, dict, anim, 8.0, 8.0, 1500, 50, 0, false, false, false)
Citizen.Wait(1200)
RemoveAllPedWeapons(playerPed, true)
else
local vehicleCoords = GetEntityCoords(vehicle)
local playerCoords = GetEntityCoords(playerPed)
local currentHeading = GetEntityHeading(playerPed)
local targetHeading = GetHeadingFromVector_2d(vehicleCoords.x - playerCoords.x, vehicleCoords.y - playerCoords.y)
local headingDiff = (((targetHeading - currentHeading) + 180) % 360) - 180
if headingDiff > 180 then headingDiff = headingDiff - 360 end
if headingDiff < -180 then headingDiff = headingDiff + 360 end
if headingDiff > 120 then headingDiff = 120 end
if headingDiff < -120 then headingDiff = -120 end
local newHeading = (currentHeading + headingDiff) % 360
TaskAchieveHeading(playerPed, newHeading, 750)
Citizen.Wait(750)
end
local lockpickDict = LOCKPICK_ANIM.dict
local lockpickAnim = LOCKPICK_ANIM.anim
RequestAnimDict(lockpickDict)
while not HasAnimDictLoaded(lockpickDict) do
Citizen.Wait(10)
end
TriggerServerEvent('sounds:playSource', 'lockpick', 0.1)
local playerCoords = GetEntityCoords(playerPed)
makePedsWalkAway(playerCoords, 50.0)
TaskPlayAnim(playerPed, lockpickDict, lockpickAnim, 8.0, 8.0, -1, 16, 0, false, false, false)
local lockpickStartTime = GetGameTimer()
local canBeCancelled = true
Citizen.CreateThread(function()
while GetGameTimer() - lockpickStartTime < LOCKPICK_DURATION and canBeCancelled do
if IsControlJustPressed(0, 73) then
canBeCancelled = false
stopLockpickAnimation()
lib.notify({
title = 'Information',
description = 'Crochetage annulé',
type = 'info'
})
lockpickingVehicle = false
return
end
Citizen.Wait(1)
end
end)
Citizen.Wait(LOCKPICK_DURATION)
if not canBeCancelled then
return
end
local success = math.random(100) <= Config.LockpickSuccessChance
local lockpickBreaks = math.random(100) <= Config.LockpickBreakChance
stopLockpickAnimation()
if success then
unlockVehicle(vehicle)
abandonedVehicles[vehicleId] = true
markVehicleUnlockedOnServer(vehicle, vehicleId)
lib.notify({
title = 'Succès',
description = Config.Notifications.LockpickSuccess,
type = 'success'
})
else
lib.notify({
title = 'Echec',
description = Config.Notifications.LockpickFailed,
type = 'error'
})
if math.random(100) <= Config.PoliceAlertChance then
local alertCoords = GetEntityCoords(playerPed)
alertPolice(alertCoords)
end
end
if lockpickBreaks then
TriggerServerEvent('vehicle_lockpick:removeLockpick')
lib.notify({
title = 'Information',
description = Config.Notifications.LockpickBroken,
type = 'warning'
})
hasLockpickCache = false
lastLockpickCheck = GetGameTimer()
end
lockpickingVehicle = false
end
Citizen.CreateThread(function()
if not verifiedPlates then verifiedPlates = {} end
if not abandonedVehicles then abandonedVehicles = {} end
if not trackedNPCVehicles then trackedNPCVehicles = {} end
end)
Citizen.CreateThread(function()
Citizen.Wait(1000)
while true do
Citizen.Wait(500)
local playerPed = PlayerPedId()
local pos = GetEntityCoords(playerPed)
local radius = 100.0
local vehicles = GetGamePool('CVehicle')
for k, vehicle in pairs(vehicles) do
local distance = #(pos - GetEntityCoords(vehicle))
if distance < radius and DoesEntityExist(vehicle) then
local vehicleId = getVehicleIdentifier(vehicle)
local isBlacklisted = isVehicleBlacklisted(vehicle)
local isMotorcycle = (GetVehicleClass(vehicle) == 8)
if isVehicleIgnored(vehicle) then
elseif isRentalVehicle(vehicle) then
elseif not isPlayerOwnedVehicle(vehicle) then
if isBlacklisted then
local lockStatus = GetVehicleDoorLockStatus(vehicle)
if lockStatus > 1 then
unlockVehicle(vehicle)
end
elseif isVehicleAbandoned(vehicleId) or isAnyVehicleDoorOpen(vehicle) then
unlockVehicle(vehicle)
else
local isOccupied = isVehicleOccupiedByNPC(vehicle)
local hasDeadNPC = hasDeadNPCInVehicle(vehicle)
local wasPlayerDriving = false
local player = PlayerId()
if GetVehiclePedIsIn(GetPlayerPed(player), true) == vehicle then
wasPlayerDriving = true
unlockVehicle(vehicle)
abandonedVehicles[vehicleId] = true
else
if hasDeadNPC and not deadNPCVehicles[vehicleId] then
local unlockChance = math.random(100)
if unlockChance <= Config.DeadNPCUnlockChance then
unlockVehicle(vehicle)
abandonedVehicles[vehicleId] = true
deadNPCVehicles[vehicleId] = "unlocked"
else
lockVehicle(vehicle)
deadNPCVehicles[vehicleId] = "locked"
end
elseif deadNPCVehicles[vehicleId] == "unlocked" then
unlockVehicle(vehicle)
elseif deadNPCVehicles[vehicleId] == "locked" then
lockVehicle(vehicle)
else
if isMotorcycle then
if not isOccupied then
unlockVehicle(vehicle)
abandonedVehicles[vehicleId] = true
else
unlockVehicle(vehicle)
end
trackedMotorcycles[vehicleId] = isOccupied
else
if trackedNPCVehicles[vehicleId] and trackedNPCVehicles[vehicleId] == true and not isOccupied then
unlockVehicle(vehicle)
abandonedVehicles[vehicleId] = true
elseif not isVehicleAbandoned(vehicleId) then
lockVehicle(vehicle)
end
if not wasPlayerDriving then
trackedNPCVehicles[vehicleId] = isOccupied
end
end
end
end
if not wasPlayerDriving and not isMotorcycle and not hasDeadNPC then
trackedNPCVehicles[vehicleId] = isOccupied
end
end
end
end
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(300000)
verifiedPlates = {}
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(600000)
local countTracking = 0
local newTracking = {}
for k, v in pairs(trackedNPCVehicles) do
countTracking = countTracking + 1
if countTracking < 1000 then
newTracking[k] = v
end
end
trackedNPCVehicles = newTracking
local countMotorcycles = 0
local newMotorcycleTracking = {}
for k, v in pairs(trackedMotorcycles) do
countMotorcycles = countMotorcycles + 1
if countMotorcycles < 500 then
newMotorcycleTracking[k] = v
end
end
trackedMotorcycles = newMotorcycleTracking
local countDeadNPC = 0
local newDeadNPCVehicles = {}
for k, v in pairs(deadNPCVehicles) do
countDeadNPC = countDeadNPC + 1
if countDeadNPC < 500 then
newDeadNPCVehicles[k] = v
end
end
deadNPCVehicles = newDeadNPCVehicles
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(1000)
local playerPed = PlayerPedId()
if IsPedInAnyVehicle(playerPed, false) then
local vehicle = GetVehiclePedIsIn(playerPed, false)
if DoesEntityExist(vehicle) and not isPlayerOwnedVehicle(vehicle) then
local vehicleId = getVehicleIdentifier(vehicle)
if not isVehicleBlacklisted(vehicle) then
abandonedVehicles[vehicleId] = true
end
end
end
end
end)
Citizen.CreateThread(function()
Citizen.Wait(5000)
ESX.TriggerServerCallback('vehicle_lockpick:getUnlockedVehicles', function(unlockedVehiclesList)
if unlockedVehiclesList then
local count = 0
for vehicleId, _ in pairs(unlockedVehiclesList) do
abandonedVehicles[vehicleId] = true
count = count + 1
end
end
end)
end)
table.count = function(tbl)
local count = 0
for _ in pairs(tbl) do
count = count + 1
end
return count
end
Citizen.CreateThread(function()
while true do
Citizen.Wait(1000)
local playerPed = PlayerPedId()
if IsPedInAnyVehicle(playerPed, false) then
local vehicle = GetVehiclePedIsIn(playerPed, false)
if DoesEntityExist(vehicle) and isRentalVehicle(vehicle) then
SetVehicleDoorsLocked(vehicle, 1)
SetVehicleDoorsLockedForAllPlayers(vehicle, false)
SetVehicleEngineOn(vehicle, true, true, false)
end
end
end
end)
function isRentalVehicle(vehicle)
if not DoesEntityExist(vehicle) then return false end
local plate = GetVehicleNumberPlateText(vehicle)
if not plate then return false end
plate = string.gsub(plate, "^%s*(.-)%s*$", "%1")
if rentalPlatesCache[plate] ~= nil then
return rentalPlatesCache[plate]
end
for rentalPlate, _ in pairs(Config.RentalPlates) do
if string.find(plate:upper(), rentalPlate:upper()) then
rentalPlatesCache[plate] = true
return true
end
end
rentalPlatesCache[plate] = false
return false
end
Citizen.CreateThread(function()
Citizen.Wait(500)
exports.ox_target:addGlobalVehicle({
{
name = 'vehicle_lockpick',
icon = 'fa-solid fa-unlock',
label = 'Crocheter',
distance = 1.0,
canInteract = function(entity, distance, coords, name)
if not DoesEntityExist(entity) then
return false
end
if not hasLockpick() then
return false
end
if isPlayerOwnedVehicle(entity) then
return false
end
if isVehicleBlacklisted(entity) then
return false
end
if isVehicleIgnored(entity) then
return false
end
if isRentalVehicle(entity) then
return false
end
if isVehicleOccupiedByNPC(entity) then
return false
end
local lockStatus = GetVehicleDoorLockStatus(entity)
if lockStatus == 0 or lockStatus == 1 or isAnyVehicleDoorOpen(entity) then
return false
end
local vehicleId = getVehicleIdentifier(entity)
if isVehicleAbandoned(vehicleId) then
return false
end
return true
end,
onSelect = function(data)
lockpickVehicle(data.entity)
end
}
})
end)
function alertPolice(coords)
local streetName, crossingRoad = GetStreetNameAtCoord(coords.x, coords.y, coords.z)
local street = GetStreetNameFromHashKey(streetName)
if crossingRoad and crossingRoad ~= 0 then
street = street .. " / " .. GetStreetNameFromHashKey(crossingRoad)
end
TriggerServerEvent('vehicle_lockpick:alertPolice', coords, street)
end
RegisterNetEvent('vehicle_lockpick:createBlip')
AddEventHandler('vehicle_lockpick:createBlip', function(coords)
local blip = AddBlipForCoord(coords.x, coords.y, coords.z)
SetBlipSprite(blip, ALERT_BLIP.sprite)
SetBlipColour(blip, ALERT_BLIP.color)
SetBlipScale(blip, ALERT_BLIP.scale)
if ALERT_BLIP.flash then
SetBlipFlashes(blip, true)
end
BeginTextCommandSetBlipName("STRING")
AddTextComponentString("Tentative de vol")
EndTextCommandSetBlipName(blip)
Citizen.SetTimeout(ALERT_BLIP.duration * 1000, function()
if DoesBlipExist(blip) then
RemoveBlip(blip)
end
end)
end)