Skip to content
esx_menu_dialog

esx_menu_dialog

A menu used to get inputs from the player. Only available on clientside

ESX.UI.Menu.Open

Open a menu that can be used to input a value

ESX.UI.Menu.Open(type, namespace, name, data, confirm, cancel )

Arguments

  • type: string
    • the menu to open dialog in this case
  • namespace: string
    • The namespace of the menu, usually GetResourceName()is used
  • name: string
    • The name of the menu
  • data: table
    • The table with the elements to show in the menu
  • confirm: function
    • Function that gets ran when an element is selected.
  • cancel: function
    • Function that gets ran when the menu gets closed

Data table

  • title: title of the menu

confirm

Function triggered when the confirm button is pressed, returns data and menu, data.value is used to get the current vlue inserted

cancel

This function is triggered when the cancel button is pressed or the menu is closed, returns data and menu

Menu Example

  ESX.UI.Menu.Open("dialog", GetCurrentResourceName(), "Example_Menu", {
    title = "Example Menu", -- The Name of Menu to show to users,
  }, function(data,menu) -- confirm function  
      local value = data.value
      print(value)
      menu.close()
    end, 
    function(data, menu) -- Cancel Function
      print("Closing Menu")
      menu.close() -- close menu
  end)

Result