@@ -41,9 +41,12 @@ toggleLockpick = function()
41
41
end
42
42
43
43
if alarmStage .liveCoords and owner then
44
- TriggerServerEvent (' msk_enginetoggle:liveCoords' , owner , NetworkGetNetworkIdFromEntity (vehicle ), GetEntityCoords (vehicle ))
44
+ TriggerServerEvent (' msk_enginetoggle:liveCoords' , owner , VehToNet (vehicle ), GetEntityCoords (vehicle ))
45
45
end
46
46
47
+ local debug = false
48
+ if not debug then return end
49
+
47
50
MSK .LoadAnimDict (animation .dict )
48
51
TaskPlayAnim (playerPed , animation .dict , animation .anim , 8.0 , 1.0 , - 1 , 49 , 0 , false , false , false )
49
52
FreezeEntityPosition (playerPed , true )
226
229
inOneSync = function (netId )
227
230
local vehicle = NetworkDoesNetworkIdExist (netId ) and NetworkGetEntityFromNetworkId (netId )
228
231
229
- if DoesEntityExist (vehicle ) then return {vehicle = vehicle } end
232
+ if DoesEntityExist (vehicle ) then
233
+ return {vehicle = vehicle }
234
+ end
230
235
return false
231
236
end
232
237
@@ -239,51 +244,46 @@ deleteVehicleBlip = function(netId)
239
244
end
240
245
RegisterNetEvent (' msk_enginetoggle:deleteVehicleBlip' , deleteVehicleBlip )
241
246
242
- showVehicleBlip = function (netId , coords )
243
- local OneSync = inOneSync ( netId )
247
+ addVehicleBlip = function (netId , coords )
248
+ local blip = AddBlipForCoord ( coords . x , coords . y , coords . z )
244
249
245
- if not activeBlips [netId ] then
246
- local blip = AddBlipForCoord (coords .x , coords .y , coords .z )
250
+ SetBlipSprite (blip , 326 )
251
+ SetBlipDisplay (blip , 2 )
252
+ SetBlipColour (blip , 1 )
253
+ SetBlipScale (blip , 1.0 )
254
+ SetBlipFlashes (blip , true )
255
+ SetBlipAsShortRange (blip , false )
247
256
248
- SetBlipSprite (blip , 326 )
249
- SetBlipDisplay (blip , 2 )
250
- SetBlipColour (blip , 1 )
251
- SetBlipScale (blip , 1.0 )
252
- SetBlipFlashes (blip , true )
253
- SetBlipAsShortRange (blip , false )
257
+ BeginTextCommandSetBlipName (' STRING' )
258
+ AddTextComponentString (Translation [Config .Locale ][' blip_stolen_vehicle' ])
259
+ EndTextCommandSetBlipName (blip )
254
260
255
- BeginTextCommandSetBlipName (' STRING' )
256
- AddTextComponentString (Translation [Config .Locale ][' blip_stolen_vehicle' ])
257
- EndTextCommandSetBlipName (blip )
261
+ activeBlips [netId ] = {isActive = false , blip = blip }
262
+ end
258
263
259
- activeBlips [netId ] = {
260
- isActive = false ,
261
- blip = blip
262
- }
263
- end
264
+ showVehicleBlip = function (netId , coords )
265
+ if not activeBlips [netId ] then addVehicleBlip (netId , coords ) end
266
+ local OneSync = inOneSync (netId )
264
267
265
- if not OneSync and activeBlips [netId ] then
266
- activeBlips [netId ].isActive = false
267
- ShowHeadingIndicatorOnBlip (activeBlips [netId ].blip , false )
268
- SetBlipCoords (activeBlips [netId ].blip , coords .x , coords .y , coords .z )
269
- elseif OneSync and activeBlips [netId ] and not activeBlips [netId ].isActive then
268
+ if OneSync and activeBlips [netId ] and not activeBlips [netId ].isActive then
270
269
CreateThread (function ()
271
270
activeBlips [netId ].isActive = true
272
271
273
- while activeBlips [netId ] and activeBlips [netId ].isActive do
274
- if DoesEntityExist (OneSync .vehicle ) then
275
- local vehicleCoords = GetEntityCoords (OneSync .vehicle )
276
- local heading = math.ceil (GetEntityHeading (OneSync .vehicle ))
277
-
278
- SetBlipCoords (activeBlips [netId ].blip , vehicleCoords .x , vehicleCoords .y , vehicleCoords .z )
279
- ShowHeadingIndicatorOnBlip (activeBlips [netId ].blip , true )
280
- SetBlipRotation (activeBlips [netId ].blip , heading )
281
- else
282
- deleteVehicleBlip (netId )
283
- break
284
- end
272
+ while activeBlips [netId ] and activeBlips [netId ].isActive and DoesEntityExist (OneSync .vehicle ) do
273
+ local vehicleCoords = GetEntityCoords (OneSync .vehicle )
274
+ local heading = math.ceil (GetEntityHeading (OneSync .vehicle ))
275
+
276
+ SetBlipCoords (activeBlips [netId ].blip , vehicleCoords .x , vehicleCoords .y , vehicleCoords .z )
277
+ ShowHeadingIndicatorOnBlip (activeBlips [netId ].blip , true )
278
+ SetBlipRotation (activeBlips [netId ].blip , heading )
279
+
280
+ Wait (0 )
285
281
end
286
282
end )
283
+ elseif not OneSync and activeBlips [netId ] then
284
+ activeBlips [netId ].isActive = false
285
+ SetBlipCoords (activeBlips [netId ].blip , coords .x , coords .y , coords .z )
286
+ ShowHeadingIndicatorOnBlip (activeBlips [netId ].blip , false )
287
287
end
288
288
289
289
SetTimeout (2500 , function ()
0 commit comments