The onDuty variable? (Here are all of the cases I found for it) [/esx_jobs/client/main.lua]
if data.current.value == 'citizen_wear' then
onDuty = false
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin)
TriggerEvent('skinchanger:loadSkin', skin)
end)
elseif data.current.value == 'job_wear' then
onDuty = true
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
if skin.sex == 0 then
TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male)
else
TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female)
end
end)
end
RegisterNetEvent('esx:setJob')
AddEventHandler('esx:setJob', function(job)
PlayerData.job = job
onDuty = false
myPlate = {} -- loosing vehicle caution in case player changes job.
spawner = 0
deleteBlips()
refreshBlips()
end)
-- Display markers (only if on duty and the player's job ones)
Citizen.CreateThread(function()
while true do
Citizen.Wait(1)
local zones = {}
-
if PlayerData.job ~= nil then
for k,v in pairs(Config.Jobs) do
if PlayerData.job.name == k then
zones = v.Zones
end
end
local coords = GetEntityCoords(PlayerPedId())
for k,v in pairs(zones) do
if onDuty or v.Type == "cloakroom" or PlayerData.job.name == "reporter" then
if(v.Marker ~= -1 and GetDistanceBetweenCoords(coords, v.Pos.x, v.Pos.y, v.Pos.z, true) < Config.DrawDistance) then
DrawMarker(v.Marker, v.Pos.x, v.Pos.y, v.Pos.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, v.Size.x, v.Size.y, v.Size.z, v.Color.r, v.Color.g, v.Color.b, 100, false, true, 2, false, false, false, false)
end
end
end
end
end
end)
if IsControlJustReleased(0, Keys['E']) and not menuIsShowed and isInMarker then
if onDuty or zone.Type == "cloakroom" or PlayerData.job.name == "reporter" then
TriggerEvent('esx_jobs:action', job, zone)
end
end
-- hide or show top left zone hints
if isInMarker and not menuIsShowed then
hintIsShowed = true
if (onDuty or zone.Type == "cloakroom" or PlayerData.job.name == "reporter") and zone.Type ~= "vehdelete" then
hintToDisplay = zone.Hint
hintIsShowed = true
elseif zone.Type == "vehdelete" and (onDuty or PlayerData.job.name == "reporter") then
local playerPed = PlayerPedId()
elseif onDuty and zone.Spawner ~= spawner then
hintToDisplay = _U('wrong_point')
hintIsShowed = true
else
Sorry for the spam code, I just need a little more guidance because I haven’t been able to do it myself.