ESX.UI.Menu.CloseAll() -- Close all open menus first
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'menuName', {
title = 'Your Title Here',
align = 'top-left', -- Position of the menu
elements = {
{label = 'Example 1', value = 'e1'},
{label = 'Example 2', value = 'e2'}
}
}, function(data, menu)
-- This executes when an element is selected (Enter pressed)
if data.current.value == 'e1' then
-- Action for Example 1
end
if data.current.value == 'e2' then
print('Example 2 pressed')
end
end, function(data, menu)
-- This executes when the menu is closed
menu.close()
end)