From 6efabfbbd849828cc2b843ddf384f3b309aee48c Mon Sep 17 00:00:00 2001 From: MrNewb <47620135+MrNewb@users.noreply.github.com> Date: Mon, 24 Feb 2025 18:23:19 -0500 Subject: [PATCH] prepping for version update --- modules/phone/gksphone/client.lua | 3 ++- modules/phone/gksphone/server.lua | 3 ++- modules/phone/lb-phone/client.lua | 3 ++- modules/phone/lb-phone/server.lua | 3 ++- modules/phone/qs-smartphone/client.lua | 3 ++- modules/phone/qs-smartphone/server.lua | 2 +- .../{ => client}/client.lua | 2 +- .../MrNewbVehicleKeys/client/client.lua | 3 ++- .../MrNewbVehicleKeys/server/server.lua | 3 ++- .../Renewed-Vehiclekeys/client/client.lua | 7 +++--- .../Renewed-Vehiclekeys/server/server.lua | 9 ++++--- .../vehicleKey/cd_garage/client/client.lua | 2 +- .../vehicleKey/cd_garage/server/server.lua | 2 +- .../mk_vehiclekeys/client/client.lua | 3 ++- .../mk_vehiclekeys/server/server.lua | 3 ++- .../mono_carkeys/{ => client}/client.lua | 2 +- .../vehicleKey/okokGarage/client/client.lua | 3 ++- .../vehicleKey/okokGarage/server/server.lua | 3 ++- .../qb-vehiclekeys/client/client.lua | 12 ++++----- .../qb-vehiclekeys/server/server.lua | 14 ++++++----- .../qbx_vehiclekeys/client/client.lua | 4 ++- .../qbx_vehiclekeys/server/server.lua | 3 ++- .../qs-vehiclekeys/client/client.lua | 25 ++++++++++++++++--- .../qs-vehiclekeys/server/server.lua | 11 +++++--- .../vehicleKey/t1ger_keys/client/client.lua | 9 +++++-- .../vehicleKey/t1ger_keys/server/server.lua | 7 +++--- .../wasabi_carlock/client/client.lua | 4 ++- .../wasabi_carlock/server/server.lua | 8 +++--- settings/sharedConfig.lua | 2 ++ 29 files changed, 105 insertions(+), 53 deletions(-) rename modules/vehicleKey/F_RealCarKeysSystem/{ => client}/client.lua (55%) rename modules/vehicleKey/mono_carkeys/{ => client}/client.lua (68%) diff --git a/modules/phone/gksphone/client.lua b/modules/phone/gksphone/client.lua index ea45267..d8ddb8f 100644 --- a/modules/phone/gksphone/client.lua +++ b/modules/phone/gksphone/client.lua @@ -1,4 +1,5 @@ -if GetResourceState('gksphone') ~= 'started' then return end +if GetResourceState('gksphone') ~= 'started' or (BridgeSharedConfig.Phone ~= "gksphone" and BridgeSharedConfig.VehicleKey ~= "auto") then return end + Phone = {} Phone.SendEmail = function(email, title, message) diff --git a/modules/phone/gksphone/server.lua b/modules/phone/gksphone/server.lua index 5de2c37..0d50297 100644 --- a/modules/phone/gksphone/server.lua +++ b/modules/phone/gksphone/server.lua @@ -1,4 +1,5 @@ -if GetResourceState('gksphone') ~= 'started' then return end +if GetResourceState('gksphone') ~= 'started' or (BridgeSharedConfig.Phone ~= "gksphone" and BridgeSharedConfig.VehicleKey ~= "auto") then return end + Phone = {} Phone.GetPlayerPhone = function(src) diff --git a/modules/phone/lb-phone/client.lua b/modules/phone/lb-phone/client.lua index 5918f64..8eb3fe6 100644 --- a/modules/phone/lb-phone/client.lua +++ b/modules/phone/lb-phone/client.lua @@ -1,4 +1,5 @@ -if GetResourceState('lb-phone') ~= 'started' then return end +if GetResourceState('lb-phone') ~= 'started' or (BridgeSharedConfig.Phone ~= "lb-phone" and BridgeSharedConfig.VehicleKey ~= "auto") then return end + Phone = {} Phone.SendEmail = function(email, title, message) diff --git a/modules/phone/lb-phone/server.lua b/modules/phone/lb-phone/server.lua index 84cf579..f298707 100644 --- a/modules/phone/lb-phone/server.lua +++ b/modules/phone/lb-phone/server.lua @@ -1,4 +1,5 @@ -if GetResourceState('lb-phone') ~= 'started' then return end +if GetResourceState('lb-phone') ~= 'started' or (BridgeSharedConfig.Phone ~= "lb-phone" and BridgeSharedConfig.VehicleKey ~= "auto") then return end + Phone = {} Phone.GetPlayerPhone = function(src) diff --git a/modules/phone/qs-smartphone/client.lua b/modules/phone/qs-smartphone/client.lua index b325b24..4194a00 100644 --- a/modules/phone/qs-smartphone/client.lua +++ b/modules/phone/qs-smartphone/client.lua @@ -1,4 +1,5 @@ -if GetResourceState('qs-smartphone') ~= 'started' then return end +if GetResourceState('qs-smartphone') ~= 'started' or (BridgeSharedConfig.Phone ~= "qs-smartphone" and BridgeSharedConfig.VehicleKey ~= "auto") then return end + Phone = {} Phone.SendEmail = function(email, title, message) diff --git a/modules/phone/qs-smartphone/server.lua b/modules/phone/qs-smartphone/server.lua index 909ee8d..5694c32 100644 --- a/modules/phone/qs-smartphone/server.lua +++ b/modules/phone/qs-smartphone/server.lua @@ -1,4 +1,4 @@ -if GetResourceState('qs-smartphone') ~= 'started' then return end +if GetResourceState('qs-smartphone') ~= 'started' or (BridgeSharedConfig.Phone ~= "qs-smartphone" and BridgeSharedConfig.VehicleKey ~= "auto") then return end Phone = {} Phone.GetPlayerPhone = function(src) diff --git a/modules/vehicleKey/F_RealCarKeysSystem/client.lua b/modules/vehicleKey/F_RealCarKeysSystem/client/client.lua similarity index 55% rename from modules/vehicleKey/F_RealCarKeysSystem/client.lua rename to modules/vehicleKey/F_RealCarKeysSystem/client/client.lua index d780704..5a9f367 100644 --- a/modules/vehicleKey/F_RealCarKeysSystem/client.lua +++ b/modules/vehicleKey/F_RealCarKeysSystem/client/client.lua @@ -1,4 +1,4 @@ -if GetResourceState('F_RealCarKeysSystem') ~= 'started' then return end +if GetResourceState('F_RealCarKeysSystem') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "F_RealCarKeysSystem" and BridgeSharedConfig.VehicleKey ~= "auto") then return end VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) diff --git a/modules/vehicleKey/MrNewbVehicleKeys/client/client.lua b/modules/vehicleKey/MrNewbVehicleKeys/client/client.lua index 31230ac..55689b2 100644 --- a/modules/vehicleKey/MrNewbVehicleKeys/client/client.lua +++ b/modules/vehicleKey/MrNewbVehicleKeys/client/client.lua @@ -1,4 +1,5 @@ -if GetResourceState('MrNewbVehicleKeys') ~= 'started' then return end +if GetResourceState('MrNewbVehicleKeys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "MrNewbVehicleKeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end + VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) diff --git a/modules/vehicleKey/MrNewbVehicleKeys/server/server.lua b/modules/vehicleKey/MrNewbVehicleKeys/server/server.lua index 32f50ba..c584568 100644 --- a/modules/vehicleKey/MrNewbVehicleKeys/server/server.lua +++ b/modules/vehicleKey/MrNewbVehicleKeys/server/server.lua @@ -1,4 +1,5 @@ -if GetResourceState('MrNewbVehicleKeys') ~= 'started' then return end +if GetResourceState('MrNewbVehicleKeys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "MrNewbVehicleKeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end + VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(src, vehicle, plate) diff --git a/modules/vehicleKey/Renewed-Vehiclekeys/client/client.lua b/modules/vehicleKey/Renewed-Vehiclekeys/client/client.lua index 0682798..21b7028 100644 --- a/modules/vehicleKey/Renewed-Vehiclekeys/client/client.lua +++ b/modules/vehicleKey/Renewed-Vehiclekeys/client/client.lua @@ -1,12 +1,13 @@ -if GetResourceState('Renewed-Vehiclekeys') ~= 'started' then return end +if GetResourceState('Renewed-Vehiclekeys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "Renewed-Vehiclekeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end + VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) - if not DoesEntityExist(vehicle) then return false end + if not plate and not DoesEntityExist(vehicle) then return false end return exports['Renewed-Vehiclekeys']:addKey(plate) end VehicleKey.RemoveKeys = function(vehicle, plate) - if not DoesEntityExist(vehicle) then return false end + if not plate and not DoesEntityExist(vehicle) then return false end return exports['Renewed-Vehiclekeys']:removeKey(plate) end \ No newline at end of file diff --git a/modules/vehicleKey/Renewed-Vehiclekeys/server/server.lua b/modules/vehicleKey/Renewed-Vehiclekeys/server/server.lua index ed5552d..78f76ef 100644 --- a/modules/vehicleKey/Renewed-Vehiclekeys/server/server.lua +++ b/modules/vehicleKey/Renewed-Vehiclekeys/server/server.lua @@ -1,10 +1,13 @@ -if GetResourceState('Renewed-Vehiclekeys') ~= 'started' then return end +if GetResourceState('Renewed-Vehiclekeys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "Renewed-Vehiclekeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end + VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(src, vehicle, plate) - --wip + if not plate then plate = GetVehicleNumberPlateText(vehicle) end + exports['Renewed-Vehiclekeys']:addKey(src, plate) end VehicleKey.RemoveKeys = function(src, vehicle, plate) - -- wip + if not plate then plate = GetVehicleNumberPlateText(vehicle) end + exports['Renewed-Vehiclekeys']:removeKey(src, plate) 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 7651f69..b83de16 100644 --- a/modules/vehicleKey/cd_garage/client/client.lua +++ b/modules/vehicleKey/cd_garage/client/client.lua @@ -1,4 +1,4 @@ -if GetResourceState('cd_garage') ~= 'started' then return end +if GetResourceState('cd_garage') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "cd_garage" and BridgeSharedConfig.VehicleKey ~= "auto") then return end VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) diff --git a/modules/vehicleKey/cd_garage/server/server.lua b/modules/vehicleKey/cd_garage/server/server.lua index 96a29e5..e69d70c 100644 --- a/modules/vehicleKey/cd_garage/server/server.lua +++ b/modules/vehicleKey/cd_garage/server/server.lua @@ -1,4 +1,4 @@ -if GetResourceState('cd_garage') ~= 'started' then return end +if GetResourceState('cd_garage') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "cd_garage" and BridgeSharedConfig.VehicleKey ~= "auto") then return end VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(src, vehicle, plate) diff --git a/modules/vehicleKey/mk_vehiclekeys/client/client.lua b/modules/vehicleKey/mk_vehiclekeys/client/client.lua index d2ca909..82debda 100644 --- a/modules/vehicleKey/mk_vehiclekeys/client/client.lua +++ b/modules/vehicleKey/mk_vehiclekeys/client/client.lua @@ -1,4 +1,5 @@ -if GetResourceState('mk_vehiclekeys') ~= 'started' then return end +if GetResourceState('mk_vehiclekeys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "mk_vehiclekeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end + VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) diff --git a/modules/vehicleKey/mk_vehiclekeys/server/server.lua b/modules/vehicleKey/mk_vehiclekeys/server/server.lua index 54e50e8..d14ad51 100644 --- a/modules/vehicleKey/mk_vehiclekeys/server/server.lua +++ b/modules/vehicleKey/mk_vehiclekeys/server/server.lua @@ -1,4 +1,5 @@ -if GetResourceState('mk_vehiclekeys') ~= 'started' then return end +if GetResourceState('mk_vehiclekeys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "mk_vehiclekeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end + VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(src, vehicle, plate) diff --git a/modules/vehicleKey/mono_carkeys/client.lua b/modules/vehicleKey/mono_carkeys/client/client.lua similarity index 68% rename from modules/vehicleKey/mono_carkeys/client.lua rename to modules/vehicleKey/mono_carkeys/client/client.lua index 63e4b72..3180d32 100644 --- a/modules/vehicleKey/mono_carkeys/client.lua +++ b/modules/vehicleKey/mono_carkeys/client/client.lua @@ -1,4 +1,4 @@ -if GetResourceState('mono_carkeys') ~= 'started' then return end +if GetResourceState('mono_carkeys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "mono_carkeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) diff --git a/modules/vehicleKey/okokGarage/client/client.lua b/modules/vehicleKey/okokGarage/client/client.lua index 5338e6a..afea250 100644 --- a/modules/vehicleKey/okokGarage/client/client.lua +++ b/modules/vehicleKey/okokGarage/client/client.lua @@ -1,4 +1,5 @@ -if GetResourceState('okokGarage') ~= 'started' then return end +if GetResourceState('okokGarage') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "okokGarage" and BridgeSharedConfig.VehicleKey ~= "auto") then return end + VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) diff --git a/modules/vehicleKey/okokGarage/server/server.lua b/modules/vehicleKey/okokGarage/server/server.lua index 0669b0a..702bf82 100644 --- a/modules/vehicleKey/okokGarage/server/server.lua +++ b/modules/vehicleKey/okokGarage/server/server.lua @@ -1,4 +1,5 @@ -if GetResourceState('okokGarage') ~= 'started' then return end +if GetResourceState('okokGarage') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "okokGarage" and BridgeSharedConfig.VehicleKey ~= "auto") then return end + VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(src, vehicle, plate) diff --git a/modules/vehicleKey/qb-vehiclekeys/client/client.lua b/modules/vehicleKey/qb-vehiclekeys/client/client.lua index e27b7f2..09d3485 100644 --- a/modules/vehicleKey/qb-vehiclekeys/client/client.lua +++ b/modules/vehicleKey/qb-vehiclekeys/client/client.lua @@ -1,14 +1,12 @@ -if GetResourceState('qb-vehiclekeys') ~= 'started' then return end -if GetResourceState('qbx_vehiclekeys') == 'started' then return end +if GetResourceState('qb-vehiclekeys') ~= 'started' and not GetResourceState("qbx_vehiclekeys") == "started" or (BridgeSharedConfig.VehicleKey ~= "qb-vehiclekeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) - if plate == nil and vehicle and DoesEntityExist(vehicle) then - plate = GetVehicleNumberPlateText(vehicle) - end - TriggerServerEvent('qb-vehiclekeys:server:AcquireVehicleKeys', plate) + if not plate and vehicle then plate = GetVehicleNumberPlateText(vehicle) end + TriggerServerEvent("qb-vehiclekeys:server:AcquireVehicleKeys", plate) end VehicleKey.RemoveKeys = function(vehicle, plate) - TriggerEvent('qb-vehiclekeys:client:RemoveKeys', plate) + if not plate and vehicle then plate = GetVehicleNumberPlateText(vehicle) end + TriggerEvent("qb-vehiclekeys:client:RemoveKeys", plate) end \ No newline at end of file diff --git a/modules/vehicleKey/qb-vehiclekeys/server/server.lua b/modules/vehicleKey/qb-vehiclekeys/server/server.lua index 4709d37..e331af6 100644 --- a/modules/vehicleKey/qb-vehiclekeys/server/server.lua +++ b/modules/vehicleKey/qb-vehiclekeys/server/server.lua @@ -1,15 +1,17 @@ -if GetResourceState('qb-vehiclekeys') ~= 'started' then return end -if GetResourceState('qbx_vehiclekeys') == 'started' then return end +if GetResourceState('qb-vehiclekeys') ~= 'started' and not GetResourceState("qbx_vehiclekeys") == "started" or (BridgeSharedConfig.VehicleKey ~= "qb-vehiclekeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end + VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(src, vehicle, plate) - if plate then - return exports["qb-vehiclekeys"]:GiveKeys(src, plate) + if not plate and vehicle then + plate = GetVehicleNumberPlateText(vehicle) end + return exports["qb-vehiclekeys"]:GiveKeys(src, plate) end VehicleKey.RemoveKeys = function(src, vehicle, plate) - if plate then - return exports["qb-vehiclekeys"]:RemoveKeys(src, plate) + if not plate and vehicle then + plate = GetVehicleNumberPlateText(vehicle) end + return exports["qb-vehiclekeys"]:RemoveKeys(src, 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 8de11a0..3ba123c 100644 --- a/modules/vehicleKey/qbx_vehiclekeys/client/client.lua +++ b/modules/vehicleKey/qbx_vehiclekeys/client/client.lua @@ -1,7 +1,9 @@ -if GetResourceState('qbx_vehiclekeys') ~= 'started' then return end +if GetResourceState('qbx_vehiclekeys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "qbx_vehiclekeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end + VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) + if not plate and vehicle then plate = GetVehicleNumberPlateText(vehicle) end TriggerServerEvent('qb-vehiclekeys:server:AcquireVehicleKeys', plate) end diff --git a/modules/vehicleKey/qbx_vehiclekeys/server/server.lua b/modules/vehicleKey/qbx_vehiclekeys/server/server.lua index ae9ec98..1c25ea5 100644 --- a/modules/vehicleKey/qbx_vehiclekeys/server/server.lua +++ b/modules/vehicleKey/qbx_vehiclekeys/server/server.lua @@ -1,4 +1,5 @@ -if GetResourceState('qbx_vehiclekeys') ~= 'started' then return end +if GetResourceState('qbx_vehiclekeys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "qbx_vehiclekeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end + VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(src, vehicle, plate) diff --git a/modules/vehicleKey/qs-vehiclekeys/client/client.lua b/modules/vehicleKey/qs-vehiclekeys/client/client.lua index aa85802..6882001 100644 --- a/modules/vehicleKey/qs-vehiclekeys/client/client.lua +++ b/modules/vehicleKey/qs-vehiclekeys/client/client.lua @@ -1,12 +1,29 @@ -if GetResourceState('qs-vehiclekeys') ~= 'started' then return end +if GetResourceState('qs-vehiclekeys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "qs-vehiclekeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end + VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) + if not vehicle then return end local model = GetDisplayNameFromVehicleModel(GetEntityModel(vehicle)) local verifiedPlate = GetVehicleNumberPlateText(vehicle) - exports['qs-vehiclekeys']:GiveKeys(verifiedPlate, model, true) + return exports['qs-vehiclekeys']:GiveKeys(verifiedPlate, model, true) end VehicleKey.RemoveKeys = function(vehicle, plate) - return true -end \ No newline at end of file + if not vehicle then return 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 diff --git a/modules/vehicleKey/qs-vehiclekeys/server/server.lua b/modules/vehicleKey/qs-vehiclekeys/server/server.lua index 5a07ae3..13579d3 100644 --- a/modules/vehicleKey/qs-vehiclekeys/server/server.lua +++ b/modules/vehicleKey/qs-vehiclekeys/server/server.lua @@ -1,10 +1,15 @@ -if GetResourceState('qs-vehiclekeys') ~= 'started' then return end +if GetResourceState('qs-vehiclekeys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "qs-vehiclekeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end + VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(src, vehicle, plate) - --wip + if not vehicle and not plate then return end + local netId = NetworkGetNetworkIdFromEntity(vehicle) + TriggerClientEvent("community_bridge:vehicleKey:giveKeys", src, netId, plate) end VehicleKey.RemoveKeys = function(src, vehicle, plate) - -- wip + if not vehicle and not plate then return end + local netId = NetworkGetNetworkIdFromEntity(vehicle) + TriggerClientEvent("community_bridge:vehicleKey:removeKeys", src, netId, plate) 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 6f34b03..6834932 100644 --- a/modules/vehicleKey/t1ger_keys/client/client.lua +++ b/modules/vehicleKey/t1ger_keys/client/client.lua @@ -1,4 +1,5 @@ -if GetResourceState('t1ger_keys') ~= 'started' then return end +if GetResourceState('t1ger_keys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "t1ger_keys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end + VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) @@ -9,4 +10,8 @@ end VehicleKey.RemoveKeys = function(vehicle, plate) -end \ No newline at end of file +end + +RegisterNetEvent("community_bridge:vehicleKey:giveKeys", function(plate) + VehicleKey.GiveKeys(nil, plate) +end) \ No newline at end of file diff --git a/modules/vehicleKey/t1ger_keys/server/server.lua b/modules/vehicleKey/t1ger_keys/server/server.lua index 569b2f3..1130e37 100644 --- a/modules/vehicleKey/t1ger_keys/server/server.lua +++ b/modules/vehicleKey/t1ger_keys/server/server.lua @@ -1,10 +1,11 @@ -if GetResourceState('t1ger_keys') ~= 'started' then return end +if GetResourceState('t1ger_keys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "t1ger_keys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end + VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(src, vehicle, plate) - --wip + TriggerClientEvent("community_bridge:vehicleKey:giveKeys", src, plate) end VehicleKey.RemoveKeys = function(src, vehicle, plate) - -- wip + end \ No newline at end of file diff --git a/modules/vehicleKey/wasabi_carlock/client/client.lua b/modules/vehicleKey/wasabi_carlock/client/client.lua index 7f5704b..3bee3e2 100644 --- a/modules/vehicleKey/wasabi_carlock/client/client.lua +++ b/modules/vehicleKey/wasabi_carlock/client/client.lua @@ -1,10 +1,12 @@ -if GetResourceState('wasabi_carlock') ~= 'started' then return end +if GetResourceState('wasabi_carlock') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "wasabi_carlock" and BridgeSharedConfig.VehicleKey ~= "auto") then return end VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(vehicle, plate) + if not plate and vehicle then plate = GetVehicleNumberPlateText(vehicle) end exports.wasabi_carlock:GiveKey(plate) end VehicleKey.RemoveKeys = function(vehicle, plate) + if not plate and vehicle then plate = GetVehicleNumberPlateText(vehicle) end exports.wasabi_carlock:RemoveKey(plate) end \ No newline at end of file diff --git a/modules/vehicleKey/wasabi_carlock/server/server.lua b/modules/vehicleKey/wasabi_carlock/server/server.lua index 55c7838..36e7689 100644 --- a/modules/vehicleKey/wasabi_carlock/server/server.lua +++ b/modules/vehicleKey/wasabi_carlock/server/server.lua @@ -1,10 +1,12 @@ -if GetResourceState('wasabi_carlock') ~= 'started' then return end +if GetResourceState('wasabi_carlock') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "wasabi_carlock" and BridgeSharedConfig.VehicleKey ~= "auto") then return end VehicleKey = VehicleKey or {} VehicleKey.GiveKeys = function(src, vehicle, plate) - --wip + if not plate and vehicle then plate = GetVehicleNumberPlateText(vehicle) end + exports.wasabi_carlock:GiveKey(src, plate) end VehicleKey.RemoveKeys = function(src, vehicle, plate) - -- wip + if not plate and vehicle then plate = GetVehicleNumberPlateText(vehicle) end + exports.wasabi_carlock:RemoveKey(src, plate) end \ No newline at end of file diff --git a/settings/sharedConfig.lua b/settings/sharedConfig.lua index 3d81fd2..366e261 100644 --- a/settings/sharedConfig.lua +++ b/settings/sharedConfig.lua @@ -1,5 +1,7 @@ BridgeSharedConfig = {} BridgeSharedConfig.Lang = "auto" -- Change this to your preferred language (must match the locale file name ex. en or fr etc) BridgeSharedConfig.DebugLevel = 0 -- Change this to your Debug level, 0 for none, 1 for some, 2 for all data +BridgeSharedConfig.VehicleKey = "auto" -- Change this to your prefrence or leave it as auto +BridgeSharedConfig.Phone = "auto" -- Change this to your prefrence or leave it as auto return BridgeSharedConfig \ No newline at end of file