Thanks If you mean the french naming yeah itās just iāve not gone through yet and changed them to English.
I will do later tonight when Iām on my pc, do you think itās because Iām possibly missing the offpolice on the jobs table?
Also, if this solves the SQL error will the duty circle appear? I canāt seem to see it anywhere in Mission Rowā¦?
If you donāt see the circle, just change the coords, we might not having the same interior.
I dont see recruit where offpolice is, (0 grade), also, label doesnt do anything even if thats different, it takes only the grade and the job.
The other thing is that you probably havenāt added offpolice where jobs table is.
Good point, where is the default police interior youāve made set to?
Also what police station are you using?
Yeah you should have them in the jobs table as well
In the same place, i am just using Gabz Police Department (paid interior).
Yeah Iām gonna pick that up later, where abouts is the default place though? in the reception?
It is yes but in Gabz, why not changing coords than trying to find where is located? You can edit from config or even teleport to the coords.
How would I make it so that when you go off duty all your weapons get taken away from you. (When clocking off duty.).
That must be done by your developer unfortunately, also, i donāt find it a great idea because they might be carrying weapons they purchased.
When I go on duty, it doesnāt detect that iāve entered service. The jobs for sure change ā but then I try to use the Police Armory and it says I need to change clothes as Iāve not entered service. Any ideas?
That might be a problem of the job script, i had this in many scripts and i had to manually edit them, try doing it in other jobs to confirm if thats the issue.
I feel like sharing this code as I couldnāt find it anywhere and wish to help anyone who also needs it. It makes it so you can toggle duty from your F6 menu instead of always having to go back to the station.
STEPS:
- Make sure you have installed this resource (esx_advanced_duty).
- For this example Iāll be doing this for the esx_policejob. Locate the esx_policejob folder and find esx_policejob > client > main.lua.
- Look for this code:
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'police_actions', {
title = 'Police',
align = 'right',
elements = {
{label = _U('citizen_interaction'), value = 'citizen_interaction'},
{label = _U('vehicle_interaction'), value = 'vehicle_interaction'},
{label = _U('object_spawner'), value = 'object_spawner'}
}}, function(data, menu)
and change it to:
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'police_actions', {
title = 'Police',
align = 'right',
elements = {
{label = _U('citizen_interaction'), value = 'citizen_interaction'},
{label = _U('vehicle_interaction'), value = 'vehicle_interaction'},
{label = _U('toggle_duty'), value = 'toggle_duty'}, -- adds the line toggle duty
{label = _U('object_spawner'), value = 'object_spawner'}
}}, function(data, menu)
- Then scroll down a bit more and add:
elseif data.current.value == 'toggle_duty' then
local elements = {
{label = _U('toggle'), value = 'toggle'}
}
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'toggle_duty', {
title = _U('toggle_duty'),
align = 'right',
elements = elements
}, function(data2, menu2)
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
local action = data2.current.value
if action == 'toggle' then
TriggerServerEvent('esx_advanced_duty:changeDutyStatus')
end
end, function(data2, menu2)
menu2.close()
end)
If youāre unsure where to put it, hereās an example:
if data.current.value == 'citizen_interaction' then
local elements = {
{label = _U('id_card'), value = 'identity_card'},
{label = _U('search'), value = 'search'},
{label = _U('handcuff'), value = 'handcuff'},
{label = _U('drag'), value = 'drag'},
{label = _U('put_in_vehicle'), value = 'put_in_vehicle'},
{label = _U('out_the_vehicle'), value = 'out_the_vehicle'},
{label = _U('unpaid_bills'), value = 'unpaid_bills'}
}
if Config.EnableLicenses then
table.insert(elements, {label = _U('license_check'), value = 'license'})
end
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'citizen_interaction', {
title = _U('citizen_interaction'),
align = 'right',
elements = elements
}, function(data2, menu2)
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
if closestPlayer ~= -1 and closestDistance <= 3.0 then
local action = data2.current.value
if action == 'identity_card' then
OpenIdentityCardMenu(closestPlayer)
elseif action == 'search' then
OpenBodySearchMenu(closestPlayer)
elseif action == 'handcuff' then
TriggerServerEvent('esx_policejob:handcuff', GetPlayerServerId(closestPlayer))
elseif action == 'drag' then
TriggerServerEvent('esx_policejob:drag', GetPlayerServerId(closestPlayer))
elseif action == 'put_in_vehicle' then
TriggerServerEvent('esx_policejob:putInVehicle', GetPlayerServerId(closestPlayer))
elseif action == 'out_the_vehicle' then
TriggerServerEvent('esx_policejob:OutVehicle', GetPlayerServerId(closestPlayer))
elseif action == 'license' then
ShowPlayerLicense(closestPlayer)
elseif action == 'unpaid_bills' then
OpenUnpaidBillsMenu(closestPlayer)
end
else
ESX.ShowNotification(_U('no_players_nearby'))
end
end, function(data2, menu2)
menu2.close()
end) -- add the elseif under here, like this
elseif data.current.value == 'toggle_duty' then -- paste the code here
local elements = {
{label = _U('toggle'), value = 'toggle'}
}
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'toggle_duty', {
title = _U('toggle_duty'),
align = 'right',
elements = elements
}, function(data2, menu2)
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
local action = data2.current.value
if action == 'toggle' then
TriggerServerEvent('esx_advanced_duty:changeDutyStatus')
end
end, function(data2, menu2)
menu2.close()
end)
- Lastly go to esx_policejob > locales > en.lua (or whatever language youāre using) and add:
['toggle_duty'] = 'toggle Duty',
['toggle'] = 'toggle On/Off',
And thatās it, hope this helps anyone who is looking for this.
I also suggest removing the duty marker positions in esx_advanced_duty > config.lua to avoid any issues.