esx_menu_default

ParameterTypeExample

icon

font-awesome

'fas fa-users-cog'

label

text

'General'

value

any

1

hint

text

'Thats example hint'

hintImage

url

''

url

url

'https://www.vames-store.com'

local elements = {
    {icon = 'fas fa-users-cog', label = 'General',  value = 1},
    {icon = 'fas fa-globe', label = 'Online Players',  value = 2, hint = "This is an example hint, here you can suggest what this option does and below you can put a hint image", hintImage = "IMAGE_URL"},
    {icon = 'fas fa-tshirt', label = 'Admin Clothes', value = 3},
    {icon = 'fas fa-car', label = 'Vehicle', value = 4},
    {label = 'Server Restart', value = 5},
    {icon = 'fas fa-brackets-curly', label = 'Developer Options', value = 6}
}
ESX.UI.Menu.CloseAll()
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'unique_name_menu', {
    title    = 'ADMIN MENU',
    align    = 'center',
    elements = elements
}, function(data, menu)
    if data.current.value == 1 then
        -- Entering to General
    elseif data.current.value == 2 then
        -- Entering to Online Players
    elseif data.current.value == 3 then
        -- Entering to Admin Clothes
    elseif data.current.value == 4 then
        -- Entering to Vehicle
    elseif data.current.value == 5 then
        -- Entering to Server Restart
    elseif data.current.value == 6 then
        -- Entering to Developer Options
    end
    menu.close()
end, function(data, menu)
    menu.close()
end)

Last updated