From e64308032a5571146d7da32b06de315d1965063c Mon Sep 17 00:00:00 2001 From: Nordi98 Date: Tue, 1 Jul 2025 09:34:18 +0200 Subject: [PATCH] ed --- .../qb-vehicle-tracker/client/client.lua | 34 +++++++++++++++---- .../qb-vehicle-tracker/config.lua | 22 ++++++++++-- 2 files changed, 47 insertions(+), 9 deletions(-) diff --git a/resources/[carscripts]/qb-vehicle-tracker/client/client.lua b/resources/[carscripts]/qb-vehicle-tracker/client/client.lua index 1561db18a..8830e9711 100644 --- a/resources/[carscripts]/qb-vehicle-tracker/client/client.lua +++ b/resources/[carscripts]/qb-vehicle-tracker/client/client.lua @@ -15,11 +15,25 @@ else } end --- Ensure policeJobs exists +-- Ensure all config values exist if not config.policeJobs then config.policeJobs = {'police', 'sheriff'} end +if not config.skillChecks then + config.skillChecks = { + normalLocateOwner = {'easy', 'medium', 'medium'}, + policeLocateOwner = {'easy', 'easy', 'medium'}, + policeGetPhone = {'medium', 'medium', 'hard'} + } +end + +if not config.durations then + config.durations = { + ownerBlipDuration = 60000 -- 60 seconds = 1 minute + } +end + local trackedVehicles = {} lib.locale() @@ -308,8 +322,14 @@ end) -- New events for advanced scanner features RegisterNetEvent('qb_vehicle_tracker:client:locateTrackerOwner', function(vehiclePlate) - -- Perform a skill check - local success = lib.skillCheck({'easy', 'medium', 'medium'}, {'w', 'a', 's', 'd'}) + -- Determine which skill check difficulty to use based on player job + local skillCheckDifficulty = config.skillChecks.normalLocateOwner + if isPlayerPolice() then + skillCheckDifficulty = config.skillChecks.policeLocateOwner + end + + -- Perform a skill check with appropriate difficulty + local success = lib.skillCheck(skillCheckDifficulty, {'w', 'a', 's', 'd'}) if success then lib.callback('qb_vehicle_tracker:getTrackerOwnerLocation', false, function(ownerCoords) @@ -339,8 +359,8 @@ RegisterNetEvent('qb_vehicle_tracker:client:locateTrackerOwner', function(vehicl playSound('Hack_Success', 'DLC_HEIST_BIOLAB_PREP_HACKING_SOUNDS') uiNotify(locale('vt_owner_located') or "Successfully traced signal to the owner's location", 'success') - -- Remove the blip after some time - SetTimeout(60000, function() + -- Remove the blip after configured time + SetTimeout(config.durations.ownerBlipDuration, function() if trackedVehicles[uniqueKey] then RemoveBlip(trackedVehicles[uniqueKey]) trackedVehicles[uniqueKey] = nil @@ -354,8 +374,8 @@ RegisterNetEvent('qb_vehicle_tracker:client:locateTrackerOwner', function(vehicl end) RegisterNetEvent('qb_vehicle_tracker:client:getTrackerOwnerPhone', function(vehiclePlate) - -- Perform a more difficult skill check for police - local success = lib.skillCheck({'medium', 'medium', 'hard'}, {'w', 'a', 's', 'd'}) + -- Perform a more difficult skill check for police using configured difficulty + local success = lib.skillCheck(config.skillChecks.policeGetPhone, {'w', 'a', 's', 'd'}) if success then lib.callback('qb_vehicle_tracker:getTrackerOwnerPhone', false, function(phoneNumber) diff --git a/resources/[carscripts]/qb-vehicle-tracker/config.lua b/resources/[carscripts]/qb-vehicle-tracker/config.lua index ea7189c92..0ce5a6c59 100644 --- a/resources/[carscripts]/qb-vehicle-tracker/config.lua +++ b/resources/[carscripts]/qb-vehicle-tracker/config.lua @@ -3,5 +3,23 @@ return { trackerItem = 'vehicletracker', trackerTabletItem = 'vehicletrackertablet', trackerScannerItem = 'vehicletrackerscanner', - policeJobs = {'police', 'marshal'} -- Add all police job names here -} \ No newline at end of file + policeJobs = {'police', 'sheriff'}, -- Add all police job names here + + -- Skill check difficulty settings + skillChecks = { + -- For normal players trying to locate tracker owner + normalLocateOwner = {'easy', 'medium', 'medium'}, + + -- For police trying to locate tracker owner (can be easier than normal) + policeLocateOwner = {'easy', 'easy', 'easy'}, + + -- For police trying to get phone number + policeGetPhone = {'easy', 'easy', 'easy'} + }, + + -- Duration settings (in milliseconds) + durations = { + -- How long the owner location blip stays on map + ownerBlipDuration = 60000 -- 60 seconds = 1 minute + } +}