forked from Simnation/Main
ed
This commit is contained in:
parent
fe08a5c318
commit
e64308032a
2 changed files with 47 additions and 9 deletions
|
@ -15,11 +15,25 @@ else
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Ensure policeJobs exists
|
-- Ensure all config values exist
|
||||||
if not config.policeJobs then
|
if not config.policeJobs then
|
||||||
config.policeJobs = {'police', 'sheriff'}
|
config.policeJobs = {'police', 'sheriff'}
|
||||||
end
|
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 = {}
|
local trackedVehicles = {}
|
||||||
|
|
||||||
lib.locale()
|
lib.locale()
|
||||||
|
@ -308,8 +322,14 @@ end)
|
||||||
|
|
||||||
-- New events for advanced scanner features
|
-- New events for advanced scanner features
|
||||||
RegisterNetEvent('qb_vehicle_tracker:client:locateTrackerOwner', function(vehiclePlate)
|
RegisterNetEvent('qb_vehicle_tracker:client:locateTrackerOwner', function(vehiclePlate)
|
||||||
-- Perform a skill check
|
-- Determine which skill check difficulty to use based on player job
|
||||||
local success = lib.skillCheck({'easy', 'medium', 'medium'}, {'w', 'a', 's', 'd'})
|
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
|
if success then
|
||||||
lib.callback('qb_vehicle_tracker:getTrackerOwnerLocation', false, function(ownerCoords)
|
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')
|
playSound('Hack_Success', 'DLC_HEIST_BIOLAB_PREP_HACKING_SOUNDS')
|
||||||
uiNotify(locale('vt_owner_located') or "Successfully traced signal to the owner's location", 'success')
|
uiNotify(locale('vt_owner_located') or "Successfully traced signal to the owner's location", 'success')
|
||||||
|
|
||||||
-- Remove the blip after some time
|
-- Remove the blip after configured time
|
||||||
SetTimeout(60000, function()
|
SetTimeout(config.durations.ownerBlipDuration, function()
|
||||||
if trackedVehicles[uniqueKey] then
|
if trackedVehicles[uniqueKey] then
|
||||||
RemoveBlip(trackedVehicles[uniqueKey])
|
RemoveBlip(trackedVehicles[uniqueKey])
|
||||||
trackedVehicles[uniqueKey] = nil
|
trackedVehicles[uniqueKey] = nil
|
||||||
|
@ -354,8 +374,8 @@ RegisterNetEvent('qb_vehicle_tracker:client:locateTrackerOwner', function(vehicl
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterNetEvent('qb_vehicle_tracker:client:getTrackerOwnerPhone', function(vehiclePlate)
|
RegisterNetEvent('qb_vehicle_tracker:client:getTrackerOwnerPhone', function(vehiclePlate)
|
||||||
-- Perform a more difficult skill check for police
|
-- Perform a more difficult skill check for police using configured difficulty
|
||||||
local success = lib.skillCheck({'medium', 'medium', 'hard'}, {'w', 'a', 's', 'd'})
|
local success = lib.skillCheck(config.skillChecks.policeGetPhone, {'w', 'a', 's', 'd'})
|
||||||
|
|
||||||
if success then
|
if success then
|
||||||
lib.callback('qb_vehicle_tracker:getTrackerOwnerPhone', false, function(phoneNumber)
|
lib.callback('qb_vehicle_tracker:getTrackerOwnerPhone', false, function(phoneNumber)
|
||||||
|
|
|
@ -3,5 +3,23 @@ return {
|
||||||
trackerItem = 'vehicletracker',
|
trackerItem = 'vehicletracker',
|
||||||
trackerTabletItem = 'vehicletrackertablet',
|
trackerTabletItem = 'vehicletrackertablet',
|
||||||
trackerScannerItem = 'vehicletrackerscanner',
|
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
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue