Use old style menu.
Code:
#include <amxmodx>
#if !defined MAX_MENU_LENGTH
const MAX_MENU_LENGTH = 512
#endif
/*
* @note Keys is a bitflag value that represents which keys the user can press
* on the menu. If you want to display disabled menu options, or skip
* certain number slots, you should exclude that key from the bitflag.
* amxconst.inc provides MENU_KEY_* constants for convenience.
*/
const MY_CUSTOM_MENU_KEYS = -1 // -1 = all keys
public plugin_init()
{
register_plugin("Plugin", "Version", "Author")
register_menucmd(register_menuid("My Custom Menu"), MY_CUSTOM_MENU_KEYS, "MyCustomMenuHandler")
register_clcmd("say /menu", "ShowMyCustomMenu")
}
public ShowMyCustomMenu(index)
{
new body[MAX_MENU_LENGTH], len
len += copy(body[len], charsmax(body) - len, "\yTitle^n^n\w")
len += copy(body[len], charsmax(body) - len, "Text 1^n")
len += copy(body[len], charsmax(body) - len, "Text 2^n")
len += copy(body[len], charsmax(body) - len, "Text 3^n")
len += copy(body[len], charsmax(body) - len, "Text 4^n")
len += copy(body[len], charsmax(body) - len, "Text 5^n")
len += copy(body[len], charsmax(body) - len, "Text 6^n")
len += copy(body[len], charsmax(body) - len, "\r1. \woption 1^n")
len += copy(body[len], charsmax(body) - len, "^n\r0. \wExit^n")
show_menu(index, MY_CUSTOM_MENU_KEYS, body, -1, "My Custom Menu")
return PLUGIN_HANDLED
}
public MyCustomMenuHandler(index, key)
{
switch (key)
{
case 9: // exit
{
return PLUGIN_HANDLED
}
}
ShowMyCustomMenu(index)
return PLUGIN_HANDLED
}
If you need formatting, replace "copy" with "formatex".
By the way, that will work only with menus of one page. If you need multiple pages you will have to do it manually. Check out plmenu.sma
__________________