diff --git a/modules/vehicleKey/F_RealCarKeysSystem/client/client.lua b/modules/vehicleKey/F_RealCarKeysSystem/client/client.lua index e7f4001..cbc4c75 100644 --- a/modules/vehicleKey/F_RealCarKeysSystem/client/client.lua +++ b/modules/vehicleKey/F_RealCarKeysSystem/client/client.lua @@ -1,10 +1,12 @@ if GetResourceState('F_RealCarKeysSystem') ~= 'started' or (BridgeClientConfig.VehicleKey ~= "F_RealCarKeysSystem" and BridgeClientConfig.VehicleKey ~= "auto") then return end + VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) + if not plate then return false end TriggerServerEvent('F_RealCarKeysSystem:generateVehicleKeys', plate) end VehicleKey.RemoveKeys = function(vehicle, plate) - return + return true end diff --git a/modules/vehicleKey/MrNewbVehicleKeys/client/client.lua b/modules/vehicleKey/MrNewbVehicleKeys/client/client.lua index 2118527..259df39 100644 --- a/modules/vehicleKey/MrNewbVehicleKeys/client/client.lua +++ b/modules/vehicleKey/MrNewbVehicleKeys/client/client.lua @@ -3,12 +3,11 @@ if GetResourceState('MrNewbVehicleKeys') ~= 'started' or (BridgeClientConfig.Veh VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) - if not DoesEntityExist(vehicle) and not plate then return false end - return exports.MrNewbVehicleKeys:GiveKeys(vehicle) + if not plate then return false end + return exports.MrNewbVehicleKeys:GiveKeysByPlate(plate) end VehicleKey.RemoveKeys = function(vehicle, plate) - if not vehicle and not plate then return false end - if not DoesEntityExist(vehicle) then return exports.MrNewbVehicleKeys:RemoveKeysByPlate(plate) end - return exports.MrNewbVehicleKeys:RemoveKeys(vehicle) + if not plate then return false end + return exports.MrNewbVehicleKeys:RemoveKeysByPlate(plate) end \ No newline at end of file diff --git a/modules/vehicleKey/Renewed-Vehiclekeys/client/client.lua b/modules/vehicleKey/Renewed-Vehiclekeys/client/client.lua index e99b79e..6558428 100644 --- a/modules/vehicleKey/Renewed-Vehiclekeys/client/client.lua +++ b/modules/vehicleKey/Renewed-Vehiclekeys/client/client.lua @@ -3,11 +3,11 @@ if GetResourceState('Renewed-Vehiclekeys') ~= 'started' or (BridgeClientConfig.V VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) - if not plate and not DoesEntityExist(vehicle) then return false end + if not plate then return false end return exports['Renewed-Vehiclekeys']:addKey(plate) end VehicleKey.RemoveKeys = function(vehicle, plate) - if not plate and not DoesEntityExist(vehicle) then return false end + if not plate then return false end return exports['Renewed-Vehiclekeys']:removeKey(plate) end \ No newline at end of file diff --git a/modules/vehicleKey/_default/client/client.lua b/modules/vehicleKey/_default/client/client.lua index af15d71..da6a547 100644 --- a/modules/vehicleKey/_default/client/client.lua +++ b/modules/vehicleKey/_default/client/client.lua @@ -1,9 +1,9 @@ VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) - -- wip + return true, print("There Is No Vehicle Key System Installed") end VehicleKey.RemoveKeys = function(vehicle, plate) - -- wip + return true, print("There Is No Vehicle Key System Installed") end \ No newline at end of file diff --git a/modules/vehicleKey/cd_garage/client/client.lua b/modules/vehicleKey/cd_garage/client/client.lua index c77b950..d9998be 100644 --- a/modules/vehicleKey/cd_garage/client/client.lua +++ b/modules/vehicleKey/cd_garage/client/client.lua @@ -1,10 +1,12 @@ if GetResourceState('cd_garage') ~= 'started' or (BridgeClientConfig.VehicleKey ~= "cd_garage" and BridgeClientConfig.VehicleKey ~= "auto") then return end + VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) + if not plate then return false end TriggerEvent('cd_garage:AddKeys', plate) end VehicleKey.RemoveKeys = function(vehicle, plate) - + return true end \ No newline at end of file diff --git a/modules/vehicleKey/mk_vehiclekeys/client/client.lua b/modules/vehicleKey/mk_vehiclekeys/client/client.lua index 5c11155..7f5cc6a 100644 --- a/modules/vehicleKey/mk_vehiclekeys/client/client.lua +++ b/modules/vehicleKey/mk_vehiclekeys/client/client.lua @@ -3,11 +3,11 @@ if GetResourceState('mk_vehiclekeys') ~= 'started' or (BridgeClientConfig.Vehicl VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) - if not DoesEntityExist(vehicle) then return false end + if not vehicle and not DoesEntityExist(vehicle) then return false end return exports["mk_vehiclekeys"]:AddKey(vehicle) end VehicleKey.RemoveKeys = function(vehicle, plate) - if not DoesEntityExist(vehicle) then return false end + if not vehicle and not DoesEntityExist(vehicle) then return false end return exports["mk_vehiclekeys"]:RemoveKey(vehicle) end \ No newline at end of file diff --git a/modules/vehicleKey/mono_carkeys/client/client.lua b/modules/vehicleKey/mono_carkeys/client/client.lua index ae05305..da85cc3 100644 --- a/modules/vehicleKey/mono_carkeys/client/client.lua +++ b/modules/vehicleKey/mono_carkeys/client/client.lua @@ -2,11 +2,11 @@ if GetResourceState('mono_carkeys') ~= 'started' or (BridgeClientConfig.VehicleK VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) - if type(plate) ~= 'string' then return end + if not plate then return false end TriggerServerEvent('mono_carkeys:CreateKey', plate) end VehicleKey.RemoveKeys = function(vehicle, plate) - if type(plate) ~= 'string' then return end + if not plate then return false end TriggerServerEvent('mono_carkeys:DeleteKey', 1, plate) end diff --git a/modules/vehicleKey/okokGarage/client/client.lua b/modules/vehicleKey/okokGarage/client/client.lua index 37e4c64..3da9e3f 100644 --- a/modules/vehicleKey/okokGarage/client/client.lua +++ b/modules/vehicleKey/okokGarage/client/client.lua @@ -3,6 +3,7 @@ if GetResourceState('okokGarage') ~= 'started' or (BridgeClientConfig.VehicleKey VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) + if not plate then return false end TriggerServerEvent('okokGarage:GiveKeys', plate) end diff --git a/modules/vehicleKey/qb-vehiclekeys/client/client.lua b/modules/vehicleKey/qb-vehiclekeys/client/client.lua index c12f66d..7c2b10d 100644 --- a/modules/vehicleKey/qb-vehiclekeys/client/client.lua +++ b/modules/vehicleKey/qb-vehiclekeys/client/client.lua @@ -2,11 +2,11 @@ if GetResourceState('qb-vehiclekeys') ~= 'started' and not GetResourceState("qbx VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) - if not plate and vehicle then plate = GetVehicleNumberPlateText(vehicle) end + if not plate then return false end TriggerServerEvent("qb-vehiclekeys:server:AcquireVehicleKeys", plate) end VehicleKey.RemoveKeys = function(vehicle, plate) - if not plate and vehicle then plate = GetVehicleNumberPlateText(vehicle) end + if not plate then return false end TriggerEvent("qb-vehiclekeys:client:RemoveKeys", plate) end \ No newline at end of file diff --git a/modules/vehicleKey/qbx_vehiclekeys/client/client.lua b/modules/vehicleKey/qbx_vehiclekeys/client/client.lua index 3ad5b25..7358f04 100644 --- a/modules/vehicleKey/qbx_vehiclekeys/client/client.lua +++ b/modules/vehicleKey/qbx_vehiclekeys/client/client.lua @@ -1,9 +1,9 @@ -if GetResourceState('qbx_vehiclekeys') ~= 'started' or (BridgeClientConfig.VehicleKey ~= "qbx_vehiclekeys" and BridgeClientConfig.VehicleKey ~= "auto") then return end +if GetResourceState('qbx_vehiclekeys') ~= 'started' or (BridgeClientConfig.VehicleKey ~= "qbx" and BridgeClientConfig.VehicleKey ~= "auto") then return end VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) - if not plate and vehicle then plate = GetVehicleNumberPlateText(vehicle) end + if not plate then return false end TriggerServerEvent('qb-vehiclekeys:server:AcquireVehicleKeys', plate) end diff --git a/modules/vehicleKey/qs-vehiclekeys/client/client.lua b/modules/vehicleKey/qs-vehiclekeys/client/client.lua index e0a06ba..b0ed802 100644 --- a/modules/vehicleKey/qs-vehiclekeys/client/client.lua +++ b/modules/vehicleKey/qs-vehiclekeys/client/client.lua @@ -3,27 +3,15 @@ if GetResourceState('qs-vehiclekeys') ~= 'started' or (BridgeClientConfig.Vehicl VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) - if not vehicle then return end + if not vehicle then return false end local model = GetDisplayNameFromVehicleModel(GetEntityModel(vehicle)) local verifiedPlate = GetVehicleNumberPlateText(vehicle) return exports['qs-vehiclekeys']:GiveKeys(verifiedPlate, model, true) end VehicleKey.RemoveKeys = function(vehicle, plate) - if not vehicle then return end + if not vehicle then return false end local model = GetDisplayNameFromVehicleModel(GetEntityModel(vehicle)) local verifiedPlate = GetVehicleNumberPlateText(vehicle) return exports['qs-vehiclekeys']:RemoveKeys(verifiedPlate, model) -end - -RegisterNetEvent("community_bridge:vehicleKey:removeKeys", function(netId, plate) - if not NetworkDoesNetworkIdExist(netId) then return end - local vehicle = NetworkGetEntityFromNetworkId(netId) - VehicleKey.RemoveKeys(vehicle, plate) -end) - -RegisterNetEvent("community_bridge:vehicleKey:giveKeys", function(netId, plate) - if not NetworkDoesNetworkIdExist(netId) then return end - local vehicle = NetworkGetEntityFromNetworkId(netId) - VehicleKey.GiveKeys(vehicle, plate) -end) \ No newline at end of file +end \ No newline at end of file diff --git a/modules/vehicleKey/t1ger_keys/client/client.lua b/modules/vehicleKey/t1ger_keys/client/client.lua index 347e2fe..8482f8c 100644 --- a/modules/vehicleKey/t1ger_keys/client/client.lua +++ b/modules/vehicleKey/t1ger_keys/client/client.lua @@ -10,8 +10,4 @@ end VehicleKey.RemoveKeys = function(vehicle, plate) -end - -RegisterNetEvent("community_bridge:vehicleKey:giveKeys", function(plate) - VehicleKey.GiveKeys(nil, plate) -end) \ No newline at end of file +end \ No newline at end of file