Es menu

From EventScripts Community Encyclopedia


Overview

Syntax: es_menu <duration> <userid> "<menutext>" [numberkeys]

Note: Command parameters are described inside the < and > characters. Optional parameters are contained within [ and ] characters.

Variation of this command that doesn't expand variables: es_xmenu

Description

Displays an on-screen HUD menu in Counter-Strike: Source using the menutext you specify.


Parameters

  • duration - the number of seconds the menu should stay up. Use 0 for indefinitely.
  • userid - the userid you wish to show the menu to
  • "menutext" - this is the text you want to show in the menu. Enclose it in quotes and use \n wherever you wish a new line to begin in the menu.
  • numberkeys - A string of all numberkeys you want to use. If somebody presses a numberkey not in the string, the menu will stay.


Examples

Display a menu to the user welcoming them to the server

es_menu 10 event_var(userid) "Welcome to Mattie's Test Server!\n \nServer rules:\n1. Do not use profanity.\n2. No porn sprays.\n3. You can't shoot Mattie."

Display a menu to the user using es_format

es_xsetinfo menu 0
es_format menu "%1 Welcome To Our Server\nServer Info:\n->1 Server IP: %2:%3\n->2 Current Map: %4\n->3 Servers Admin: Skillz, Wonder, Menu, Example\n \nServer Rulles:\n->4 No Use Cheats\n->5 Dont Do TK\n \n0 Cancel" event_var(es_username) server_var(ip) server_var(hostport) server_var(eventscripts_currentmap)
es_menu 0 event_var(userid) server_var(menu)

Displays a menu using the numberkeystring

es_menu 0 event_var(userid) "Choose the function:\n->1. Kick \n->2. Ban \n->3. Slay \n->0. Exit" 1230


Notes

  • This command exists in EventScripts v1.1 or higher.
  • This menu style only works in Counter-Strike: Source and Day of Defeat: Source.
  • While a menu is in front of a player, if they hit a number key (e.g. 1, 2, 3, etc.) then the client command "menuselect 1" will be sent from the user. This allows you to use the es_client_command event to capture selections they make from the menu.
  • This command is very similar to Mani's ma_msay command.
  • By typing a "->" before numbers you can make the orange and mark the as a option. They will blink if somebody presses them. This will only work before numbers from 1-9


See also

blog comments powered by Disqus