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
|
||||
|
||||
-- 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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue