diff --git a/client/main.lua b/client/main.lua index 8319477..035af48 100644 --- a/client/main.lua +++ b/client/main.lua @@ -22,6 +22,10 @@ RegisterNetEvent('QBCore:Client:OnPlayerUnload', function() end end) +RegisterNetEvent('QBCore:Client:OnJobUpdate', function(JobInfo) + PlayerData.job = JobInfo +end) + -- Functions local function DrawText3Ds(x, y, z, text) @@ -161,7 +165,7 @@ CreateThread(function() local pos = GetEntityCoords(ped) for k, data in pairs(Config.WeaponRepairPoints) do local distance = #(pos - data.coords) - if distance < 10 then + if distance < 10 and (not data.Job or (data.Job and PlayerData.job.grade.level >= data.MinJobGrade)) then inRange = true if distance < 1 then if data.IsRepairing then diff --git a/config.lua b/config.lua index 3c3d0c3..9754528 100644 --- a/config.lua +++ b/config.lua @@ -155,7 +155,8 @@ Config.DurabilityMultiplier = { } Config.WeaponRepairPoints = { - { coords = vector3(964.02, -1267.41, 34.97), IsRepairing = false, RepairingData = {} } + { coords = vector3(964.02, -1267.41, 34.97), IsRepairing = false, RepairingData = {} }, + --{ coords = vector3(487.32, -996.99, 30.69), IsRepairing = false, RepairingData = {}, Job = 'police', MinJobGrade = 4 } } Config.WeaponRepairCosts = {