duty hotfix

fixed onDuty not being picked up on script restarts
This commit is contained in:
jimathy
2022-02-05 16:18:56 +00:00
committed by GitHub
parent 3722d4b2ba
commit ded2fbb219

View File

@@ -23,7 +23,7 @@ AddEventHandler('QBCore:Client:SetDuty', function(duty)
end)
--Keeps track of duty on script restarts
AddEventHandler('onResourceStart', function(resource) if GetCurrentResourceName() == resource then QBCore.Functions.GetPlayerData(function(PlayerData) PlayerJob = PlayerData.job end) end end)
AddEventHandler('onResourceStart', function(resource) if GetCurrentResourceName() == resource then QBCore.Functions.GetPlayerData(function(PlayerData) PlayerJob = PlayerData.job onDuty = PlayerJob.onduty end) end end)
Citizen.CreateThread(function()
local jobroles = {}