Es.menu

From EventScripts Community Encyclopedia
This article is a stub. Please help by adding to it.



Method: menu

Module: es
Class: (no class)
EventScripts version: 2.0

Method Overview

Table of Contents

Contents


Description

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

This is the Python equivalent of: http://www.eventscripts.com/pages/es_menu

Arguments

  • 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, ev['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.")

esmenuexample1.png

Displays a menu using the numberkeystring

es.menu(0, ev['userid'], "Choose the function:\n->1. Kick \n->2. Ban \n->3. Slay \n->0. Exit", "1230")

esmenuexample2.png

Notes

  • This command exists in EventScripts v2.0 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

http://www.eventscripts.com/pages/Es_client_command

blog comments powered by Disqus