@@ -43,7 +43,7 @@ toggleLockpick = function()
43
43
44
44
if IsPedInAnyVehicle (playerPed , false ) then return end
45
45
if not IsAnyVehicleNearPoint (coords .x , coords .y , coords .z , 5.0 ) then return end
46
-
46
+
47
47
local vehicle = GetClosestVehicle (coords .x , coords .y , coords .z , 3.0 , 0 , 71 )
48
48
if not DoesEntityExist (vehicle ) then return end
49
49
local plate = GetVehicleNumberPlateText (vehicle )
@@ -57,11 +57,15 @@ toggleLockpick = function()
57
57
elseif Config .Framework == ' QBCore' then
58
58
QBCore .Functions .TriggerCallback (' msk_enginetoggle:getAlarmStage' , function (owner , alarmStage )
59
59
p :resolve ({owner , alarmStage })
60
- end )
60
+ end , plate )
61
61
else
62
62
-- Add your own code here
63
63
end
64
64
65
+ SetTimeout (5000 , function ()
66
+ p :resolve ({nil , ' stage_1' })
67
+ end )
68
+
65
69
local cbResult = Citizen .Await (p )
66
70
local owner , stage = table.unpack (cbResult )
67
71
local alarmStage = Config .SafetyStages [stage ]
@@ -71,15 +75,15 @@ toggleLockpick = function()
71
75
StartVehicleAlarm (vehicle )
72
76
end
73
77
74
- if alarmStage .ownerAlert then
78
+ if alarmStage .ownerAlert and owner then
75
79
TriggerServerEvent (' msk_enginetoggle:ownerAlert' , GetEntityCoords (vehicle ), owner )
76
80
end
77
81
78
82
if alarmStage .policeAlert then
79
83
TriggerServerEvent (' msk_enginetoggle:policeAlert' , GetEntityCoords (vehicle ))
80
84
end
81
85
82
- if alarmStage .liveCoords then
86
+ if alarmStage .liveCoords and owner then
83
87
TriggerServerEvent (' msk_enginetoggle:liveCoords' , owner , NetworkGetNetworkIdFromEntity (vehicle ), GetEntityCoords (vehicle ))
84
88
end
85
89
@@ -169,6 +173,7 @@ toggleLockpick = function()
169
173
if Config .VehicleKeys .enable and GetResourceState (Config .VehicleKeys .script ) == " started" then
170
174
TriggerServerEvent (' msk_enginetoggle:addTempKey' , plate )
171
175
end
176
+ needToHotwire = false
172
177
Config .Notification (nil , Translation [Config .Locale ][' hotwiring_foundkey' ], ' success' )
173
178
else
174
179
Config .Notification (nil , Translation [Config .Locale ][' hotwiring_notfoundkey' ], ' error' )
0 commit comments