mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-17 05:56:01 +01:00
fix(vehicle): removing old keys & check for engine keys
This commit is contained in:
@@ -372,7 +372,7 @@ local function hasVehicleKeys(veh, checkEngine)
|
|||||||
local state = Entity(veh).state
|
local state = Entity(veh).state
|
||||||
if Config.ox_inventory and Config.useInventoryForKeys then
|
if Config.ox_inventory and Config.useInventoryForKeys then
|
||||||
local metadata = {
|
local metadata = {
|
||||||
vehPlate = GetVehicleNumberPlateText(veh),
|
vehId = state.id,
|
||||||
keyEnabled = true
|
keyEnabled = true
|
||||||
}
|
}
|
||||||
local hasKey = exports.ox_inventory:GetItemCount("keys", metadata) > 0
|
local hasKey = exports.ox_inventory:GetItemCount("keys", metadata) > 0
|
||||||
|
|||||||
@@ -196,8 +196,7 @@ function NDCore.giveVehicleAccess(source, vehicle, access, info)
|
|||||||
local model = info?.model or GetEntityModel(vehicle)
|
local model = info?.model or GetEntityModel(vehicle)
|
||||||
local modelName = info?.modelName or model and lib.callback.await("ND_Vehicles:getVehicleModelMakeLabel", source, model) or ""
|
local modelName = info?.modelName or model and lib.callback.await("ND_Vehicles:getVehicleModelMakeLabel", source, model) or ""
|
||||||
local hasKey = ox_inventory:GetSlotIdWithItem(source, "keys", {
|
local hasKey = ox_inventory:GetSlotIdWithItem(source, "keys", {
|
||||||
vehId = vehicleId,
|
vehId = vehicleId
|
||||||
vehNetId = netId
|
|
||||||
})
|
})
|
||||||
|
|
||||||
if access and not hasKey then
|
if access and not hasKey then
|
||||||
|
|||||||
Reference in New Issue
Block a user