[RELEASE] Esx_upgraded_duty

add Frequency in config like this

  police = {
    job = 'police',
    offjob = 'offpolice',
    Frequency = 2,
    Pos   = { x = -704.22430419922, y = 620.40441894531, z = 155.24028015137 },
    Size  = { x = 1.5, y = 1.5, z = 1.5 },
  },

add this under TriggerServerEvent('esx_duty:toggleduty') in line 127

if offdutyjobsinfo[playerjob] then
    if v.Frequency then
        exports["rp-radio"]:GivePlayerAccessToFrequency(v.Frequency)
    end
else
    if v.Frequency then
        exports["rp-radio"]:RemovePlayerAccessToFrequency(v.Frequency)
    end
end
1 Like

Works fine but how can I add more than one frequency?

EDIT: Solved. Thanks again!

1 Like

How were you able to add more than one frequency?

Config.Zones = {
  police = {
    job = 'police',
    offjob = 'offpolice',
	Frequency = { a = 1, b = 2},
    Pos   = { x = 454.5, y = -988.63, z = 30.68 },
    Size  = { x = 1.5, y = 1.5, z = 1.5 },
  },
  
  ambulance = {
    job = 'ambulance',
    offjob = 'offambulance',
	Frequency = { a = 3, b = 4},
    Pos   = { x = 298.98, y = -598.38, z = 43.28 },
    Size  = { x = 1.5, y = 1.5, z = 1.5 },
  },
  
  mechanic = {
    job = 'mechanic',
    offjob = 'offmechanic',
	Frequency = { a = 5, b = 6},
    Pos   = { x = -203.95, y = -1330.5, z = 34.89 },
    Size  = { x = 1.5, y = 1.5, z = 1.5 },
  },
  
  taxi = {
    job = 'taxi',
    offjob = 'offtaxi',
	Frequency = { a = 7, b = 8},
    Pos   = { x = 890.58, y = -178.09, z = 81.59 },
    Size  = { x = 1.5, y = 1.5, z = 1.5 },
  },
}
if IsControlJustPressed(0, Keys['E']) then
									TriggerServerEvent('nk_event_duty:toggleduty')
									if offdutyjobsinfo[playerjob] then
										TriggerServerEvent("utk_sl:dutyChange", offdutyjobsinfo[playerjob], true)
										if v.Frequency then
										exports["rp-radio"]:GivePlayerAccessToFrequency(v.Frequency.a)
										exports["rp-radio"]:GivePlayerAccessToFrequency(v.Frequency.b)
										end
									else
										TriggerServerEvent("utk_sl:dutyChange", playerjob, false)
										if v.Frequency then
										exports["rp-radio"]:RemovePlayerAccessToFrequency(v.Frequency.a)
										exports["rp-radio"]:RemovePlayerAccessToFrequency(v.Frequency.b)
										end
									end
								end

Your welcome

Hi, I get this error after using command CreateOffDutyJob police
ER_NO_DEFAULT_FOR_FIELD: Field 'skin_male' doesn't have a default value

Default value seems {}

replace this in jobgenetor.lua line 46 ~ 52 and try

	ExecuteSql("INSERT INTO job_grades SET job_name=@job_name,grade=@grade,name=@name,label=@label,salary=@salary,skin_male=@skin_male,skin_female=@skin_female",{
		['@job_name']      = "off".. v.job_name,
		['@grade']         = v.grade,
		['@name']          = v.name,
		['@label']         = v.label,
		['@salary']        = v.salary,
		['@skin_male']     = v.skin_male,
		['@skin_female']   = v.skin_female
	})

Thank you very much, that worked for me!

Another question: If I use On / Off Duty it still says when I use the police menu that Iā€™m not in servive. Do I need to add the action from clothing to the script by myself?

yes you need to do those thing by yourself

1 Like

Hey did you ever get this sorted? I canā€™t seem to see the markers eitherā€¦

use last version from github or make can see one false then tell me result


Yeah so Iā€™m not seeing the circle and Iā€™m getting this errorā€¦?

did u restart your server after make off duty job and put correct job in config?

Well Iā€™m 99% sure that I did add the job code and itā€™s since added it to my .sql files, this is all I get now, a message (that needs editing) when I step near what -should- be the duty line, then it also doesnā€™t work showing the message I said from before and also not showing the circleā€¦

i will help u in dm

bro can you also help me i am having issue where when i restart my server i go of duty automatically kindly pls help me thanks in adavance

send private message i will help you

:joy::joy::joy::joy::joy::joy:

Hi
Is there a way to change duty on and off in a menu that is in a other script insteed of in a marker?

Hi you can use TriggerServerEvent('esx_duty:toggleduty')

No i can not use that in an other script. it tells me it gets a nil value.
Iam trying to call it from my phonescript with a button but sence its a other server.lua it dosnt work