1
0
Fork 0
forked from Simnation/Main
This commit is contained in:
Nordi98 2025-07-01 09:34:18 +02:00
parent fe08a5c318
commit e64308032a
2 changed files with 47 additions and 9 deletions

View file

@ -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)

View file

@ -3,5 +3,23 @@ return {
trackerItem = 'vehicletracker',
trackerTabletItem = 'vehicletrackertablet',
trackerScannerItem = 'vehicletrackerscanner',
policeJobs = {'police', 'marshal'} -- Add all police job names here
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
}
}