duty hotfix

fixed onDuty not being picked up on script restarts
This commit is contained in:
jimathy authored and GitHub committed 2022-02-05 16:18:56 +00:00
1 parent 3722d4b2ba
commit ded2fbb219
1 file changed
+1 -1
+1 -1
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 = {}