ESX Menu Default
If you are a new developer in FiveM, you can read the FiveM Documentation to get a good start.
ESX.UI.Menu.CloseAll() -- We close all the menus that may be open and open a new one.
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'menuName', -- Change menu name
{
title = ('Your Title Here'), -- Menu title
align = 'top-left', -- Menu position
elements = {
{label = 'Example 1', value = 'e1'}, -- Example elements
{label = 'Example 2', value = 'e2'} -- Example elements
}
},
function(data, menu) -- This part contains the code that executes when you press enter
if data.current.value == 'e1' then -- This detects which element you have pressed
-- The action to be executed
end
if data.current.value == 'e2' then
print('Example 2 pressed')
end
end,
function(data, menu)
menu.close() -- Action when closing the menu
end)