diff --git a/client/main.lua b/client/main.lua index 832c7d3..e34a8f8 100644 --- a/client/main.lua +++ b/client/main.lua @@ -418,9 +418,6 @@ end qbx.entityStateHandler('doorslockstate', function(entity, _, value) if entity == 0 then return end - if getIsVehicleShared(entity) then - value = 1 - end SetVehicleDoorsLocked(entity, value) end) diff --git a/server/main.lua b/server/main.lua index 4221b67..348a491 100644 --- a/server/main.lua +++ b/server/main.lua @@ -6,6 +6,7 @@ local addPlayer = functions.addPlayer local removePlayer = functions.removePlayer local getIsVehicleAlwaysUnlocked = sharedFunctions.getIsVehicleAlwaysUnlocked local getIsVehicleInitiallyLocked = sharedFunctions.getIsVehicleInitiallyLocked +local getIsVehicleShared = sharedFunctions.getIsVehicleShared ---@enum EntityType local EntityType = { @@ -39,6 +40,7 @@ end) RegisterNetEvent('qb-vehiclekeys:server:setVehLockState', function(vehNetId, state) local vehicleEntity = NetworkGetEntityFromNetworkId(vehNetId) if type(state) ~= 'number' or not DoesEntityExist(vehicleEntity) then return end + if getIsVehicleAlwaysUnlocked(vehicleEntity) or getIsVehicleShared(vehicleEntity) then return end Entity(vehicleEntity).state:set('doorslockstate', state, true) end)