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

hotfixes #24

Merged
merged 2 commits into from
Jul 19, 2023
Merged
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
15 changes: 10 additions & 5 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ end

AddEventHandler('esx_jobs:action', function(job, zone, zoneKey)
menuIsShowed = true
local playerJob = LocalPlayer.state.job.name
local playerJob = ESX.PlayerData.job.name
if zone.Type == "cloakroom" then
OpenMenu()
elseif zone.Type == "work" then
Expand Down Expand Up @@ -185,6 +185,7 @@ AddEventHandler('esx_jobs:hasExitedMarker', function(zone)
end)

RegisterNetEvent('esx:setJob', function(job)
ESX.PlayerData.job = job
onDuty = false
myPlate = {} -- loosing vehicle caution in case player changes job.
spawner = 0
Expand All @@ -204,9 +205,12 @@ end
function refreshBlips()
local zones = {}
local blipInfo = {}
local playerJob = LocalPlayer.state.job.name

while not ESX.PlayerLoaded do
Wait(500)
end

if playerJob == nil then return end
local playerJob = ESX.PlayerData.job.name

for jobKey, jobValues in pairs(Config.Jobs) do
if jobKey == playerJob then
Expand Down Expand Up @@ -275,7 +279,7 @@ CreateThread(function()
local zones = {}

if ESX.PlayerLoaded then
local playerJob = LocalPlayer.state.job.name
local playerJob = ESX.PlayerData.job.name

if playerJob then
for k, v in pairs(Config.Jobs) do
Expand Down Expand Up @@ -361,7 +365,7 @@ CreateThread(function()
local Sleep = 500

if ESX.PlayerLoaded then
local playerJob = LocalPlayer.state.job.name
local playerJob = ESX.PlayerData.job.name

if playerJob and playerJob ~= 'unemployed' then
local zones = nil
Expand Down Expand Up @@ -487,4 +491,5 @@ if Config.RequestIPL then
RequestIpl("id2_14_during1")
end)
end

if ESX.PlayerLoaded then refreshBlips() end