I’ve added this to my Policejob and EMS Menu with the help of Alpha on the discord.
To the menu I added
{label = _U('object22'), value = 'object22'},
and put -- infront of the old spawner.
esx_policejob/client/main.lua
title = 'Police',
align = 'bottom-right',
elements = {
{label = _U('citizen_interaction'), value = 'citizen_interaction'},
{label = _U('vehicle_interaction'), value = 'vehicle_interaction'},
--{label = _U('object_spawner'), value = 'object_spawner'},
{label = _U('object22'), value = 'object22'},
esx_ambulancejob/client/jobs.lua
title = _U('ambulance'),
align = 'bottom-right',
elements = {
{label = _U('ems_menu'), value = 'citizen_interaction'}
{label = _U('object22'), value = 'object22'},
}
then I added this to it as well to trigger it when the menu selects it.
Policejob
elseif data.current.value == 'object22' then
TriggerEvent('objectmenuv2')
ESX.UI.Menu.CloseAll()
ambulancejob was different it needs to go above the citizen_interaction menu like this and change the if to elseif at the start of if data.current.value == 'citizen_interaction' then
}, function(data, menu)
if data.current.value == 'object22' then
TriggerEvent('objectmenuv2')
ESX.UI.Menu.CloseAll()
elseif data.current.value == 'citizen_interaction' then
In Objectspawnerv2/client.lua I replaced this
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
_menuPool:ProcessMenus()
if IsControlJustPressed(1, 51) then
mainMenu:Visible(not mainMenu:Visible())
end
end
end)
With this
AddEventHandler("objectmenuv2", function()
mainMenu:Visible(not mainMenu:Visible())
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
_menuPool:ProcessMenus()
end
end)
This should allow you to use them in your policejob and ems menus.
I did also change the allowed peds
pedsList = {
"mp_f_freemode_01",
"mp_m_freemode_01",
}
But that was just for how I needed it set up.
And of course add the locales to the language.lua you are using in this case
['object22'] = 'Object Selection Menu',