Skip to content

Commit 279ffad

Browse files
committed
Update v4.2.3
1 parent 833ccc2 commit 279ffad

File tree

9 files changed

+31
-17
lines changed

9 files changed

+31
-17
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.2.2
1+
4.2.3

client/hotwire.lua

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ local activeBlips = {}
235235
deleteVehicleBlip = function(netId)
236236
if not activeBlips[netId] then return end
237237
RemoveBlip(activeBlips[netId].blip)
238+
activeBlips[netId] = nil
238239
end
239240
RegisterNetEvent('msk_enginetoggle:deleteVehicleBlip', deleteVehicleBlip)
240241

@@ -265,22 +266,28 @@ showVehicleBlip = function(netId, coords)
265266
activeBlips[netId].isActive = false
266267
ShowHeadingIndicatorOnBlip(activeBlips[netId].blip, false)
267268
SetBlipCoords(activeBlips[netId].blip, coords.x, coords.y, coords.z)
268-
elseif OneSync and not activeBlips[netId].isActive then
269+
elseif OneSync and activeBlips[netId] and not activeBlips[netId].isActive then
269270
CreateThread(function()
270271
activeBlips[netId].isActive = true
271272

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)
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
279285
end
280286
end)
281287
end
282288

283289
SetTimeout(2500, function()
290+
if not activeBlips[netId] then return end
284291
showVehicleBlip(netId, coords)
285292
end)
286293
end

client/main.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,6 @@ disableDrive = function()
291291
end
292292

293293
logging = function(code, ...)
294-
if not Config.Debug then return end
295-
MSK.Logging(code, ...)
294+
if code == 'debug' and not Config.Debug then return end
295+
MSK.Logging(code, ...)
296296
end

client/vehiclekeys.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ getIsKeyOwner = function(vehicle)
5858
isKeyOwner = exports["vehicle_keys"]:doesPlayerOwnPlate(plate)
5959
elseif Config.VehicleKeys.script == 'wasabi_carlock' and (GetResourceState("wasabi_carlock") == "started") then
6060
isKeyOwner = exports.wasabi_carlock:HasKey(plate)
61+
elseif Config.VehicleKeys.script == 'qs-vehiclekeys' and (GetResourceState("qs-vehiclekeys") == "started") then
62+
isKeyOwner = exports['qs-vehiclekeys']:GetKey(plate)
6163
else
6264
-- Add your own code here
6365
end

config.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Config.EngineFromSecondSeat = false
4848
Config.VehicleKeys = {
4949
enable = true, -- Set true to enable this feature
5050

51-
-- Supported Scripts: 'msk_vehiclekeys', 'VehicleKeyChain', 'vehicle_keys', 'okokGarage', 'wasabi_carlock'
51+
-- Supported Scripts: 'msk_vehiclekeys', 'VehicleKeyChain', 'vehicle_keys', 'okokGarage', 'wasabi_carlock', 'qs-vehiclekeys'
5252
script = 'msk_vehiclekeys',
5353

5454
-- This is for inventories with metadata like ox_inventory

fxmanifest.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ games { 'gta5' }
44
author 'Musiker15 - MSK Scripts'
55
name 'msk_enginetoggle'
66
description 'EngineToggle for Vehicles'
7-
version '4.2.2'
7+
version '4.2.3'
88

99
lua54 'yes'
1010

server/hotwire.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ RegisterNetEvent('msk_enginetoggle:saveAlarmStage', function(plate, stage)
9999

100100
local result = MySQL.query.await(('SELECT * FROM %s WHERE %s = @owner AND plate = @plate'):format(VEHICLE_TABLE_NAME, OWNER_COLUMN_NAME), {
101101
['@owner'] = identifier,
102-
['@plate'] = trim(plate)
102+
['@plate'] = MSK.Trim(plate, true)
103103
})
104104

105105
if result and result[1] and result[1][OWNER_COLUMN_NAME] == identifier then
106106
MySQL.update(('UPDATE %s SET alarmStage = @alarmStage WHERE %s = @owner AND plate = @plate'):format(VEHICLE_TABLE_NAME, OWNER_COLUMN_NAME), {
107107
['@alarmStage'] = stage,
108108
['@owner'] = identifier,
109-
['@plate'] = trim(plate),
109+
['@plate'] = MSK.Trim(plate, true),
110110
})
111111
else
112112
Config.Notification(playerId, Translation[Config.Locale]['not_vehicle_owner'], 'error')

server/main.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,9 @@ MSK.Register('msk_enginetoggle:getInventory', function(source, inv)
140140

141141
local invName = ('content-%s'):format(identifier):gsub(':', '')
142142
return exports['core_inventory']:getInventory(invName)
143-
end)
143+
end)
144+
145+
logging = function(code, ...)
146+
if code == 'debug' and not Config.Debug then return end
147+
MSK.Logging(code, ...)
148+
end

server/versionchecker.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ local GITHUB_URL = "https://api.github.com/repos/%s/%s/releases/latest"
77
local DOWNLOAD_URL = "https://github.com/%s/%s/releases/tag/v%s"
88

99
local RENAME_WARNING = NAME_COLORED .. "^3 [WARNING] This resource should not be renamed! This can lead to errors. Please rename it to^0 %s"
10-
local CHECK_FAILED = NAME_COLORED .. "^1 [ERROR] Version Check failed! Http Error: %s^0\n^3Please update to the latest version.^0"
10+
local CHECK_FAILED = NAME_COLORED .. "^1 [ERROR] Version Check failed! Http Error: %s ^3Please update to the latest version.^0"
1111
local BETA_VERSION = NAME_COLORED .. "^3 [WARNING] Beta version detected^0 - ^5Current Version:^0 %s - ^5Latest Version:^0 %s"
1212
local UP_TO_DATE = NAME_COLORED .. "^2 ✓ Resource is Up to Date^0 - ^5Current Version:^2 %s ^0"
1313
local NEW_VERSION = NAME_COLORED .. "^3 [Update Available] ^5Current Version:^0 %s - ^5Latest Version:^0 %s\n" .. NAME_COLORED .. "^5 Download:^4 %s ^0"

0 commit comments

Comments
 (0)