Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Job repair points #185

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Loading