Raised This Month: $51 Target: $400
 12% 

Simple Menu Builder


Post New Thread Reply   
 
Thread Tools Display Modes
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-08-2020 , 17:12   Re: Simple Menu Builder
Reply With Quote #161

Yes, by combining it with this plugin - https://forums.alliedmods.net/showthread.php?t=297627
Simply make a MOTD command and add it in the menu.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
iclassdon
AlliedModders Donor
Join Date: May 2006
Old 11-08-2020 , 19:06   Re: Simple Menu Builder
Reply With Quote #162

Quote:
Originally Posted by OciXCrom View Post
Yes, by combining it with this plugin - https://forums.alliedmods.net/showthread.php?t=297627
Simply make a MOTD command and add it in the menu.
I have 3 plugins doing what this one can do. Perfect and thank you.
iclassdon is offline
Send a message via MSN to iclassdon
Ark_Procession
Senior Member
Join Date: Jun 2020
Location: Argentina
Old 12-16-2020 , 11:36   Re: Simple Menu Builder
Reply With Quote #163

Hi Ocixcrom, it seems that i cannot add text before the first item in my menu.

For example:

HTML Code:
[New Menu = HELP MENU]

[Menu Settings]
;<settings> = <value>
MENU_TITLE = Help Menu
MENU_TITLE_PAGE = %newline%Page:\d
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_FLAG = 0
MENU_TEAM = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You don't access to this menu.
MENU_NOTEAM = Your team isn't allowed to use this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND = 
MENU_OPEN = say /adminhelpmenu, say_team /adminhelpmenu, amx_adminhelpmenu
MENU_REOPEN = 1
MENU_ALIVE = 0

[Menu Items]
;<Item Name> <Command> [Flag] [Team]
#text "Welcome to the help menu"
"What do you need help with?"
"What do you need help with?"
"What do you need help with?"
"What do you need help with?"
"What do you need help with?"
"What do you need help with?"
"What do you need help with?"
"What do you need help with?"
Ark_Procession is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-16-2020 , 16:12   Re: Simple Menu Builder
Reply With Quote #164

That's an AMXX/game engine limitation, not a problem with the plugin.
You can add new lines in the title if you want to add text before the items.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Ark_Procession
Senior Member
Join Date: Jun 2020
Location: Argentina
Old 12-18-2020 , 12:26   Re: Simple Menu Builder
Reply With Quote #165

It seems i'm having a really weird problem with your plugin:


The error :

HTML Code:
L 12/18/2020 - 14:03:14: [AMXX] Displaying debug trace (plugin "custom_crx_simplemenu.amxx")
L 12/18/2020 - 14:03:14: [AMXX] Run time error 4: index out of bounds 
L 12/18/2020 - 14:03:14: [AMXX]    [0] crx_simplemenu.sma::fileRead (line 144)
L 12/18/2020 - 14:03:14: [AMXX]    [1] crx_simplemenu.sma::plugin_precache (line 81)

i noticed after updating orpheu cbaseplayer "joiningthink" to this :

HTML Code:
{
    "name"      : "JoiningThink",
    "class"     : "CBasePlayer",
    "library"   : "mod",
    "identifiers":
    [
        {
            "os"    : "windows",
            "mod"   : "cstrike",
            "value" : [0x83,"*","*",0x53,0x55,0x56,0x8B,"*",0x33,0xDB,0x57,0x8B,"*","*","*","*","*",0x83,"*","*",0x0F]
        }, 
        {
            "os"    : "linux",
            "mod"   : "cstrike",
            "value" : "JoiningThink__11CBasePlayer"
        }
    ]
}
could it be in any way related?, maybe i just noticed it now.

Note:

i tested crx_simplemenu without any other plugin.
I run orpheu arkshine version.
Ark_Procession is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-18-2020 , 16:31   Re: Simple Menu Builder
Reply With Quote #166

If you modified my plugin (I noticed the changed name), please post the code.
If not, it's likely caused by your Orpheu modification.
__________________

Last edited by OciXCrom; 12-18-2020 at 16:31.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Ark_Procession
Senior Member
Join Date: Jun 2020
Location: Argentina
Old 12-18-2020 , 17:06   Re: Simple Menu Builder
Reply With Quote #167

Oh, no! not only i would not know how, also your plugins have the ini files that makes my life easier.

Simple Menu Builder is the foundation of my 60 plugins lol. i use it for everything.

the CUSTOM_ prefix is organizational... all my plugins have it since there are amx plugins and my custom plugins. whenever i want to quick manage them for backup and stuff i just filter for "custom_"

Here is the code you asked for:

HTML Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN_VERSION "2.1.2"
#define MAX_MENUS 20

enum
{
	SECTION_DEFAULTS = 0,
	SECTION_SETTINGS,
	SECTION_MENUITEMS
}

enum _:Settings
{
	MENU_TITLE[128],
	MENU_TITLE_PAGE[128],
	MENU_PREFIX[32],
	MENU_BACKK[32],
	MENU_NEXT[32],
	MENU_EXITT[32],
	MENU_FLAG,
	MENU_TEAM,
	MENU_ALIVEONLY,
	MENU_ITEMS_PER_PAGE,
	MENU_REOPEN,
	MENU_ITEM_FORMAT[64],
	MENU_NOACCESS[160],
	MENU_NOTEAM[160],
	MENU_ALIVE[160],
	MENU_DEAD[160],
	MENU_SOUND[128]
}

enum _:Items
{
	Name[64],
	Command[64],
	Flag[5],
	Team,
	bool:UseFunc,
	Plugin[64],
	Function[64]
}

new g_eDefaults[Settings],
	g_eSettings[MAX_MENUS][Settings],
	g_iTotalItems[MAX_MENUS],
	g_szMap[32],
	g_msgSayText

new Trie:g_tCommands,
	Array:g_aMenuItems[MAX_MENUS]

new const g_szAll[] = "#all"
new const g_szItemField[] = "%item%"
new const g_szNameField[] = "%name%"
new const g_szUserIdField[] = "%userid%"
new const g_szBlankField[] = "#blank"
new const g_szTextField[] = "#text"
new const g_szPlayersField[] = "#addplayers"
new const g_szFunc[] = "do.func"
new const g_szAMXX[] = ".amxx"
new const g_szNewLine[2][] = { "%newline%", "^n" }
new const g_szSayStuff[2][] = { "say ", "say_team " }

public plugin_init()
{
	register_plugin("Simple Menu", PLUGIN_VERSION, "OciXCrom")
	register_cvar("SimpleMenu", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED)
	g_msgSayText = get_user_msgid("SayText")
}

public plugin_precache()
{
	for(new i; i < MAX_MENUS; i++)
		g_aMenuItems[i] = ArrayCreate(Items)

	get_mapname(g_szMap, charsmax(g_szMap))
	g_tCommands = TrieCreate()
	fileRead()
}

public plugin_end()
{
	for(new i; i < MAX_MENUS; i++)
		ArrayDestroy(g_aMenuItems[i])

	TrieDestroy(g_tCommands)
}

fileRead()
{
	new szConfigsName[256], szFilename[256]
	get_configsdir(szConfigsName, charsmax(szConfigsName))
	formatex(szFilename, charsmax(szFilename), "%s/SimpleMenu.ini", szConfigsName)
	new iFilePointer = fopen(szFilename, "rt")

	if(iFilePointer)
	{
		new szData[256], szKey[128], szValue[128], szTeam[2], iSection, iSize
		new eItem[Items], iMenuId = -1, bool:blRead = true

		while(!feof(iFilePointer))
		{
			fgets(iFilePointer, szData, charsmax(szData))
			trim(szData)

			switch(szData[0])
			{
				case EOS, ';': continue
				case '-':
				{
					iSize = strlen(szData)

					if(szData[iSize - 1] == '-')
					{
						szData[0] = ' '
						szData[iSize - 1] = ' '
						trim(szData)

						if(contain(szData, "*") != -1)
						{
							strtok(szData, szKey, charsmax(szKey), szValue, charsmax(szValue), '*')
							copy(szValue, strlen(szKey), g_szMap)
							blRead = equal(szValue, szKey) ? true : false
						}
						else
							blRead = equal(szData, g_szAll) || equali(szData, g_szMap)
					}
					else continue
				}
				case '[':
				{
					if(szData[strlen(szData) - 1] == ']')
					{
						if(containi(szData, "default settings") != -1)
							iSection = SECTION_DEFAULTS
						else if(containi(szData, "new menu") != -1)
						{
							iMenuId++

							for(new i; i < sizeof(g_eDefaults); i++)
								g_eSettings[iMenuId][i] = g_eDefaults[i]
						}
						else if(containi(szData, "menu settings") != -1)
						{
							if(iMenuId < 0)
								iMenuId = 0

							iSection = SECTION_SETTINGS
						}
						else if(containi(szData, "menu items") != -1)
						{
							if(iMenuId < 0)
								iMenuId = 0

							iSection = SECTION_MENUITEMS
						}
					}
					else continue
				}
				default:
				{
					if(!blRead)
						continue

					switch(iSection)
					{
						case SECTION_DEFAULTS:
						{
							strtok(szData, szKey, charsmax(szKey), szValue, charsmax(szValue), '=')
							trim(szKey); trim(szValue)

							if(szValue[0] == EOS)
								continue

							if(equal(szKey, "MENU_TITLE"))
							{
								if(contain(szValue, g_szNewLine[0]) != -1)
									replace_all(szValue, charsmax(szValue), g_szNewLine[0], g_szNewLine[1])

								copy(g_eDefaults[MENU_TITLE], charsmax(g_eDefaults[MENU_TITLE]), szValue)
							}
							if(equal(szKey, "MENU_TITLE_PAGE"))
							{
								if(contain(szValue, g_szNewLine[0]) != -1)
									replace_all(szValue, charsmax(szValue), g_szNewLine[0], g_szNewLine[1])

								copy(g_eDefaults[MENU_TITLE_PAGE], charsmax(g_eDefaults[MENU_TITLE_PAGE]), szValue)
							}
							else if(equal(szKey, "MENU_PREFIX"))
								copy(g_eDefaults[MENU_PREFIX], charsmax(g_eDefaults[MENU_PREFIX]), szValue)
							else if(equal(szKey, "MENU_BACK"))
								copy(g_eDefaults[MENU_BACKK], charsmax(g_eDefaults[MENU_BACKK]), szValue)
							else if(equal(szKey, "MENU_NEXT"))
								copy(g_eDefaults[MENU_NEXT], charsmax(g_eDefaults[MENU_NEXT]), szValue)
							else if(equal(szKey, "MENU_EXIT"))
								copy(g_eDefaults[MENU_EXITT], charsmax(g_eDefaults[MENU_EXITT]), szValue)
							else if(equal(szKey, "MENU_FLAG"))
								g_eDefaults[MENU_FLAG] = szValue[0] == '0' ? 0 : read_flags(szValue)
							else if(equal(szKey, "MENU_TEAM"))
								g_eDefaults[MENU_TEAM] = clamp(str_to_num(szValue), 0, 3)
							else if(equal(szKey, "MENU_ALIVEONLY"))
								g_eDefaults[MENU_ALIVEONLY] = str_to_num(szValue)
							else if(equal(szKey, "MENU_ITEMS_PER_PAGE"))
								g_eDefaults[MENU_ITEMS_PER_PAGE] = str_to_num(szValue)
							else if(equal(szKey, "MENU_REOPEN"))
								g_eDefaults[MENU_REOPEN] = str_to_num(szValue)
							else if(equal(szKey, "MENU_ITEM_FORMAT"))
								copy(g_eDefaults[MENU_ITEM_FORMAT], charsmax(g_eDefaults[MENU_ITEM_FORMAT]), szValue)
							else if(equal(szKey, "MENU_NOACCESS"))
								copy(g_eDefaults[MENU_NOACCESS], charsmax(g_eDefaults[MENU_NOACCESS]), szValue)
							else if(equal(szKey, "MENU_NOTEAM"))
								copy(g_eDefaults[MENU_NOTEAM], charsmax(g_eDefaults[MENU_NOTEAM]), szValue)
							else if(equal(szKey, "MENU_ALIVE"))
								copy(g_eDefaults[MENU_ALIVE], charsmax(g_eDefaults[MENU_ALIVE]), szValue)
							else if(equal(szKey, "MENU_DEAD"))
								copy(g_eDefaults[MENU_DEAD], charsmax(g_eDefaults[MENU_DEAD]), szValue)
							else if(equal(szKey, "MENU_SOUND"))
							{
								copy(g_eDefaults[MENU_SOUND], charsmax(g_eDefaults[MENU_SOUND]), szValue)
								precache_sound(szValue)
							}
						}
						case SECTION_SETTINGS:
						{
							strtok(szData, szKey, charsmax(szKey), szValue, charsmax(szValue), '=')
							trim(szKey); trim(szValue)

							if(szValue[0] == EOS)
								continue

							if(equal(szKey, "MENU_TITLE"))
							{
								if(contain(szValue, g_szNewLine[0]) != -1)
									replace_all(szValue, charsmax(szValue), g_szNewLine[0], g_szNewLine[1])

								copy(g_eSettings[iMenuId][MENU_TITLE], charsmax(g_eSettings[][MENU_TITLE]), szValue)
							}
							if(equal(szKey, "MENU_TITLE_PAGE"))
							{
								if(contain(szValue, g_szNewLine[0]) != -1)
									replace_all(szValue, charsmax(szValue), g_szNewLine[0], g_szNewLine[1])

								copy(g_eSettings[iMenuId][MENU_TITLE_PAGE], charsmax(g_eSettings[][MENU_TITLE_PAGE]), szValue)
							}
							else if(equal(szKey, "MENU_PREFIX"))
								copy(g_eSettings[iMenuId][MENU_PREFIX], charsmax(g_eSettings[][MENU_PREFIX]), szValue)
							else if(equal(szKey, "MENU_BACK"))
								copy(g_eSettings[iMenuId][MENU_BACKK], charsmax(g_eSettings[][MENU_BACKK]), szValue)
							else if(equal(szKey, "MENU_NEXT"))
								copy(g_eSettings[iMenuId][MENU_NEXT], charsmax(g_eSettings[][MENU_NEXT]), szValue)
							else if(equal(szKey, "MENU_EXIT"))
								copy(g_eSettings[iMenuId][MENU_EXITT], charsmax(g_eSettings[][MENU_EXITT]), szValue)
							else if(equal(szKey, "MENU_FLAG"))
								g_eSettings[iMenuId][MENU_FLAG] = szValue[0] == '0' ? 0 : read_flags(szValue)
							else if(equal(szKey, "MENU_TEAM"))
								g_eSettings[iMenuId][MENU_TEAM] = clamp(str_to_num(szValue), 0, 3)
							else if(equal(szKey, "MENU_ALIVEONLY"))
								g_eSettings[iMenuId][MENU_ALIVEONLY] = str_to_num(szValue)
							else if(equal(szKey, "MENU_ITEMS_PER_PAGE"))
								g_eSettings[iMenuId][MENU_ITEMS_PER_PAGE] = str_to_num(szValue)
							else if(equal(szKey, "MENU_REOPEN"))
								g_eSettings[iMenuId][MENU_REOPEN] = str_to_num(szValue)
							else if(equal(szKey, "MENU_OPEN"))
							{
								while(szValue[0] != 0 && strtok(szValue, szKey, charsmax(szKey), szValue, charsmax(szValue), ','))
								{
									trim(szKey); trim(szValue)
									register_clcmd(szKey, "cmdMenu")
									TrieSetCell(g_tCommands, szKey, iMenuId)
								}
							}
							else if(equal(szKey, "MENU_ITEM_FORMAT"))
								copy(g_eSettings[iMenuId][MENU_ITEM_FORMAT], charsmax(g_eSettings[][MENU_ITEM_FORMAT]), szValue)
							else if(equal(szKey, "MENU_NOACCESS"))
								copy(g_eSettings[iMenuId][MENU_NOACCESS], charsmax(g_eSettings[][MENU_NOACCESS]), szValue)
							else if(equal(szKey, "MENU_NOTEAM"))
								copy(g_eSettings[iMenuId][MENU_NOTEAM], charsmax(g_eSettings[][MENU_NOTEAM]), szValue)
							else if(equal(szKey, "MENU_ALIVE"))
								copy(g_eSettings[iMenuId][MENU_ALIVE], charsmax(g_eSettings[][MENU_ALIVE]), szValue)
							else if(equal(szKey, "MENU_DEAD"))
								copy(g_eSettings[iMenuId][MENU_DEAD], charsmax(g_eSettings[][MENU_DEAD]), szValue)
							else if(equal(szKey, "MENU_SOUND"))
							{
								copy(g_eSettings[iMenuId][MENU_SOUND], charsmax(g_eSettings[][MENU_SOUND]), szValue)
								precache_sound(szValue)
							}
						}
						case SECTION_MENUITEMS:
						{
							parse(szData, eItem[Name], charsmax(eItem[Name]), eItem[Command], charsmax(eItem[Command]), eItem[Flag], charsmax(eItem[Flag]), szTeam, charsmax(szTeam))
							eItem[UseFunc] = bool:(equal(eItem[Command], g_szFunc, charsmax(g_szFunc)))
							eItem[Team] = str_to_num(szTeam)

							if(eItem[UseFunc])
							{
								replace(eItem[Command], charsmax(eItem[Command]), g_szFunc, "")
								replace(eItem[Command], charsmax(eItem[Command]), "(", "")
								replace(eItem[Command], charsmax(eItem[Command]), ")", "")
								strtok(eItem[Command], eItem[Plugin], charsmax(eItem[Plugin]), eItem[Function], charsmax(eItem[Function]), ',')
								trim(eItem[Plugin]); trim(eItem[Function])

								if(contain(eItem[Plugin], g_szAMXX) == -1)
									add(eItem[Plugin], charsmax(eItem[Plugin]), g_szAMXX)
							}

							ArrayPushArray(g_aMenuItems[iMenuId], eItem)
							eItem[Flag][0] = EOS
							szTeam[0] = EOS
							g_iTotalItems[iMenuId]++
						}
					}
				}
			}
		}

		fclose(iFilePointer)
	}
}

public cmdMenu(id)
{
	new szCommand[64], szArgs[32], iMenuId
	read_argv(0, szCommand, charsmax(szCommand))

	if(equal(szCommand[0], g_szSayStuff[0], 3) || equal(szCommand[0], g_szSayStuff[1], 8))
	{
		read_argv(1, szArgs, charsmax(szArgs))
		remove_quotes(szArgs)
		format(szCommand, charsmax(szCommand), "%s %s", szCommand, szArgs)
	}

	if(TrieGetCell(g_tCommands, szCommand, iMenuId))
		menuMain(id, iMenuId)
	else
		return PLUGIN_CONTINUE

	return PLUGIN_HANDLED
}

menuMain(id, iMenuId, iPage = 0)
{
	if(!is_user_connected(id))
	{
		return PLUGIN_HANDLED
	}

	if(g_eSettings[iMenuId][MENU_FLAG] && !(get_user_flags(id) & g_eSettings[iMenuId][MENU_FLAG]))
	{
		ColorChat(id, "%s %s", g_eSettings[iMenuId][MENU_PREFIX], g_eSettings[iMenuId][MENU_NOACCESS])
		return PLUGIN_HANDLED
	}

	if(!get_team_access(id, iMenuId))
	{
		ColorChat(id, "%s %s", g_eSettings[iMenuId][MENU_PREFIX], g_eSettings[iMenuId][MENU_NOTEAM])
		return PLUGIN_HANDLED
	}

	if(!get_alive_access(id, iMenuId))
	{
		ColorChat(id, "%s %s", g_eSettings[iMenuId][MENU_PREFIX], g_eSettings[iMenuId][MENU_ALIVEONLY] == 1 ? g_eSettings[iMenuId][MENU_ALIVE] : g_eSettings[iMenuId][MENU_DEAD])
		return PLUGIN_HANDLED
	}

	if(g_eSettings[iMenuId][MENU_SOUND][0] != EOS)
		client_cmd(id, "spk %s", g_eSettings[iMenuId][MENU_SOUND])

	new szItem[128], szData[20]
	new eItem[Items], iMenu = menu_create(g_eSettings[iMenuId][MENU_TITLE], "handlerMain")

	for(new i, iTeam = get_user_team(id); i < g_iTotalItems[iMenuId]; i++)
	{
		ArrayGetArray(g_aMenuItems[iMenuId], i, eItem)

		if(eItem[Team] && eItem[Team] != iTeam)
			continue
		else if(equal(eItem[Name], g_szBlankField))
			menu_addblank(iMenu, str_to_num(eItem[Command]))
		else if(equal(eItem[Name], g_szTextField))
			menu_addtext(iMenu, eItem[Command], str_to_num(eItem[Flag]))
		else if(equal(eItem[Name], g_szPlayersField))
		{
			new szName[32], iPlayers[32], iPnum
			get_players(iPlayers, iPnum, get_flag(eItem[Flag], "c") ? "a" : "")

			for(new j, iPlayer; j < iPnum; j++)
			{
				iPlayer = iPlayers[j]

				if(iPlayer == id)
				{
					if(!get_flag(eItem[Flag], "b"))
						continue
				}
				else if(get_user_flags(iPlayer) & ADMIN_IMMUNITY)
				{
					if(get_flag(eItem[Flag], "a"))
						continue
				}

				get_user_name(iPlayer, szName, charsmax(szName))
				copy(szItem, charsmax(szItem), g_eSettings[iMenuId][MENU_ITEM_FORMAT])
				replace_all(szItem, charsmax(szItem), g_szItemField, szName)
				formatex(szData, charsmax(szData), "%i %i %i p", iMenuId, i, get_user_userid(iPlayer))
				menu_additem(iMenu, szItem, szData)
			}
		}
		else
		{
			copy(szItem, charsmax(szItem), g_eSettings[iMenuId][MENU_ITEM_FORMAT])
			replace_all(szItem, charsmax(szItem), g_szItemField, eItem[Name])
			formatex(szData, charsmax(szData), "%i %i", iMenuId, i)
			menu_additem(iMenu, szItem, szData, read_flags(eItem[Flag]))
		}
	}

	if(menu_pages(iMenu) > 1)
	{
		new szTitle[256]
		formatex(szTitle, charsmax(szTitle), "%s %s", g_eSettings[iMenuId][MENU_TITLE], g_eSettings[iMenuId][MENU_TITLE_PAGE])
		menu_setprop(iMenu, MPROP_TITLE, szTitle)
	}

	menu_setprop(iMenu, MPROP_BACKNAME, g_eSettings[iMenuId][MENU_BACKK])
	menu_setprop(iMenu, MPROP_NEXTNAME, g_eSettings[iMenuId][MENU_NEXT])
	menu_setprop(iMenu, MPROP_EXITNAME, g_eSettings[iMenuId][MENU_EXITT])
	menu_setprop(iMenu, MPROP_PERPAGE, g_eSettings[iMenuId][MENU_ITEMS_PER_PAGE])
	menu_display(id, iMenu, iPage)
	return PLUGIN_HANDLED
}

public handlerMain(id, iMenu, iItem)
{
	if(iItem == MENU_EXIT)
		goto @DESTROY

	new szData[20], szMenuId[3], szKey[3], szUserId[5], iMenuId, iKey, iUserId, iAccess, iCallback
	menu_item_getinfo(iMenu, iItem, iAccess, szData, charsmax(szData), .callback = iCallback)
	parse(szData, szMenuId, charsmax(szMenuId), szKey, charsmax(szKey), szUserId, charsmax(szUserId))

	iMenuId = str_to_num(szMenuId)
	iKey = str_to_num(szKey)
	iUserId = str_to_num(szUserId)

	if(get_alive_access(id, iMenuId) && get_team_access(id, iMenuId))
	{
		new eItem[Items]
		ArrayGetArray(g_aMenuItems[iMenuId], iKey, eItem)

		if(szData[strlen(szData) - 1] == 'p')
		{
			new szCommand[64]
			copy(szCommand, charsmax(szCommand), eItem[Command])

			if(get_flag(szCommand, g_szNameField))
			{
				new szName[32]
				get_user_name(find_player("k", iUserId), szName, charsmax(szName))
				replace_all(szCommand, charsmax(szCommand), g_szNameField, szName)
			}

			if(get_flag(szCommand, g_szUserIdField))
				replace_all(szCommand, charsmax(szCommand), g_szUserIdField, szUserId)

			client_cmd(id, szCommand)
		}
		else
		{
			if(eItem[UseFunc])
			{
				callfunc_begin(eItem[Function], eItem[Plugin])
				callfunc_push_int(id)
				callfunc_end()
			}
			else
				client_cmd(id, eItem[Command])
		}
	}

	if(g_eSettings[iMenuId][MENU_REOPEN])
	{
		new iMenu2, iPage
		player_menu_info(id, iMenu2, iMenu2, iPage)
		menu_destroy(iMenu)
		menuMain(id, iMenuId, iPage)
		return PLUGIN_HANDLED
	}

	@DESTROY:
	menu_destroy(iMenu)
	return PLUGIN_HANDLED
}

ColorChat(const id, const szInput[], any:...)
{
	new iPlayers[32], iCount = 1
	static szMessage[191]
	vformat(szMessage, charsmax(szMessage), szInput, 3)

	replace_all(szMessage, charsmax(szMessage), "!g", "^4")
	replace_all(szMessage, charsmax(szMessage), "!n", "^1")
	replace_all(szMessage, charsmax(szMessage), "!t", "^3")

	if(id)
		iPlayers[0] = id
	else
		get_players(iPlayers, iCount, "ch")

	for(new i; i < iCount; i++)
	{
		if(is_user_connected(iPlayers[i]))
		{
			message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayers[i])
			write_byte(iPlayers[i])
			write_string(szMessage)
			message_end()
		}
	}
}

bool:get_flag(szString[], const szFlag[])
	return (contain(szString, szFlag) != -1) ? true : false

bool:get_alive_access(id, iMenuId)
	return ((g_eSettings[iMenuId][MENU_ALIVEONLY] == 1 && !is_user_alive(id)) || (g_eSettings[iMenuId][MENU_ALIVEONLY] == 2 && is_user_alive(id))) ? false : true

bool:get_team_access(id, iMenuId)
	return (!g_eSettings[iMenuId][MENU_TEAM] || g_eSettings[iMenuId][MENU_TEAM] == get_user_team(id))
EDIT: tested it alone without other plugins and the problem persists,
tested it without orpheu installed and the problem persists.

Maybe i'm just noticing it now since my LOG was filled with crap that needed repairs...

this error that throws... is it something critical? should i worry about an overflow kick in my server or something like that? otherwise i could just let it be.... i mostly want to know if it can harm the stability of my server because of it.

it's the last plugin i need to "fix" so my log is squeaky clean of errors.

Last edited by Ark_Procession; 12-18-2020 at 17:09.
Ark_Procession is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-18-2020 , 18:22   Re: Simple Menu Builder
Reply With Quote #168

The issue may be caused by wrong configuration. Can I have a look at the .ini file?

PS: no, it's nothing you should worry about. The worst case scenario is the menu failing to open, but it looks like it's trying to do something with an invalid menu so that won't ever happen.
__________________

Last edited by OciXCrom; 12-18-2020 at 18:22.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Ark_Procession
Senior Member
Join Date: Jun 2020
Location: Argentina
Old 12-18-2020 , 21:00   Re: Simple Menu Builder
Reply With Quote #169

Quote:
Originally Posted by OciXCrom View Post
The issue may be caused by wrong configuration. Can I have a look at the .ini file?

PS: no, it's nothing you should worry about. The worst case scenario is the menu failing to open, but it looks like it's trying to do something with an invalid menu so that won't ever happen.

The menu works just fine, it's just i thought that error above was a red flag for a inminent crash or something in the future.

Thanks so much, and of course, here is the ini content:

HTML Code:
[Default Settings]
;These are the default settings for each menu created.
;You can add certain options in [Menu Settings] if you want to change them.
;Please note that every menu needs to have a different MENU_OPEN settings, therefore there's no default one.










;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ADMIN MENU\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ADMIN MENU\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ADMIN MENU\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ADMIN MENU\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ADMIN MENU\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ADMIN MENU\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ADMIN MENU\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ADMIN MENU\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ADMIN MENU\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ADMIN MENU\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\










[New Menu = FULL ADMIN MENU]

[Menu Settings]
;<settings> = <value>

MENU_TITLE = Admin Menu
MENU_TITLE_PAGE = %newline%Page:\d
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_FLAG = 0
MENU_TEAM = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You don't access to this menu.
MENU_NOTEAM = Your team isn't allowed to use this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND = 
MENU_OPEN = say /adminfullmenu, say_team /adminfullmenu, amx_adminfullmenu
MENU_REOPEN = 1
MENU_ALIVE = 0

[Menu Items]
;<Item Name> <Command> [Flag] [Team]
"Admin Menu" "say /adminmenu"
"Client Menu" "say /clientmenu"

[New Menu = ADMIN MENU]

[Menu Settings]
;<settings> = <value>

MENU_TITLE = Admin Menu
MENU_TITLE_PAGE = 
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_FLAG = 0
MENU_TEAM = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 0
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You don't access to this menu.
MENU_NOTEAM = Your team isn't allowed to use this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND = 
MENU_OPEN = say /adminmenu, say_team /adminmenu, amx_adminmenu
MENU_REOPEN = 1
MENU_ALIVE = 0

[Menu Items]
;<Item Name> <Command> [Flag] [Team]
"Server Menu" "say /adminservermenu"
"Buy Menu" "say /adminbuymenu"
"Money Menu" "say /adminmoneymenu"
"Map Menu" "say /adminmapmenu"
"Rank Menu" "say /adminrankmenu"
"Spectator Menu" "say /adminspectatormenu"
"Bot Menu" "say /adminbotmenu"
"Entity Menu" "say /adminentitymenu"
"Hud Menu" "say /adminhudmenu"

[New Menu = HUD MENU]

[Menu Settings]
;<settings> = <value>

MENU_TITLE = Hud Menu
MENU_TITLE_PAGE = %newline%Page:\d
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_FLAG = 0
MENU_TEAM = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You don't access to this menu.
MENU_NOTEAM = Your team isn't allowed to use this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND = 
MENU_OPEN = say /adminhudmenu, say_team /adminhudmenu, amx_adminhudmenu
MENU_REOPEN = 1
MENU_ALIVE = 0

[Menu Items]
;<Item Name> <Command> [Flag] [Team]
"Hud Position" "amx_hudmenupos"
"Hud Color" amx_hudmenucolor"

[New Menu = SERVER MENU]

[Menu Settings]
;<settings> = <value>

MENU_TITLE = Server Menu
MENU_TITLE_PAGE = %newline%Page:\d
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_FLAG = 0
MENU_TEAM = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You don't access to this menu.
MENU_NOTEAM = Your team isn't allowed to use this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND = 
MENU_OPEN = say /adminservermenu, say_team /adminservermenu, amx_adminservermenu
MENU_REOPEN = 1
MENU_ALIVE = 0

[Menu Items]
;<Item Name> <Command> [Flag] [Team]
"Pause Server" "amx_pause"
"The Time" "say thetime"
"Timeleft" "say timeleft"
"Admin/Client Groups" "say /admincheckmenu"

[New Menu = BOT MENU]

[Menu Settings]
;<settings> = <value>

MENU_TITLE = Bot Menu
MENU_TITLE_PAGE = %newline%Page:\d
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_FLAG = 0
MENU_TEAM = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You don't access to this menu.
MENU_NOTEAM = Your team isn't allowed to use this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND = 
MENU_OPEN = say /adminbotmenu, say_team /adminbotmenu, amx_adminbotmenu
MENU_REOPEN = 1
MENU_ALIVE = 0

[Menu Items]
;<Item Name> <Command> [Flag] [Team]
"Enable Bot Editor" "amx_spawn_editor 1"
"Disable Bot Editor" "amx_spawn_editor 0"
"Bot Editor Menu" "amx_editor_menu"
"Bot Test Menu" "amx_adminbottestmenu"

[New Menu = ENTITY MENU]

[Menu Settings]
;<settings> = <value>

MENU_TITLE = Entity Menu
MENU_TITLE_PAGE = %newline%Page:\d
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_FLAG = 0
MENU_TEAM = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You don't access to this menu.
MENU_NOTEAM = Your team isn't allowed to use this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND = 
MENU_OPEN = say /adminentitymenu, say_team /adminentitymenu, amx_adminentitymenu
MENU_REOPEN = 1
MENU_ALIVE = 0

[Menu Items]
;<Item Name> <Command> [Flag] [Team]
"Entity Editor" "brush_edit"

[New Menu = BUY MENU]

[Menu Settings]
;<settings> = <value>

MENU_TITLE = Buy Menu
MENU_TITLE_PAGE = %newline%Page:\d
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_FLAG = 0
MENU_TEAM = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You don't access to this menu.
MENU_NOTEAM = Your team isn't allowed to use this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND = 
MENU_OPEN = say /adminbuymenu, say_team /adminbuymenu, amx_adminbuymenu
MENU_REOPEN = 1
MENU_ALIVE = 0

[Menu Items]
;<Item Name> <Command> [Flag] [Team]
"Buy HealthKit" "say /buyrkit"
"Buy Bulletproof Helmet" "say /bphelmet"

[New Menu = MONEY MENU]

[Menu Settings]
;<settings> = <value>

MENU_TITLE = Money Menu
MENU_TITLE_PAGE = %newline%Page:\d
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_FLAG = 0
MENU_TEAM = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You don't access to this menu.
MENU_NOTEAM = Your team isn't allowed to use this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND = 
MENU_OPEN = say /adminmoneymenu, say_team /adminmoneymenu, amx_adminmoneymenu
MENU_REOPEN = 1
MENU_ALIVE = 0

[Menu Items]
;<Item Name> <Command> [Flag] [Team]
"Give/Request Money" "say /money"

[New Menu = MAP MENU]

[Menu Settings]
;<settings> = <value>

MENU_TITLE = Map Menu
MENU_TITLE_PAGE = %newline%Page:\d
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_FLAG = 0
MENU_TEAM = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You don't access to this menu.
MENU_NOTEAM = Your team isn't allowed to use this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND = 
MENU_OPEN = say /adminmapmenu, say_team /adminmapmenu, amx_adminmapmenu
MENU_REOPEN = 1
MENU_ALIVE = 0

[Menu Items]
;<Item Name> <Command> [Flag] [Team]
"Current Map Name" "say /currentmap"
"Nextmap" "say nextmap"
"Map Lists" "say /adminmapfinder"

[New Menu = MAP LISTS]

[Menu Settings]
;<settings> = <value>

MENU_TITLE = Map Lists (For keywords use /mapfind "" in chat)
MENU_TITLE_PAGE = %newline%Page:\d 
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_FLAG = 0
MENU_TEAM = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You don't access to this menu.
MENU_NOTEAM = Your team isn't allowed to use this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND = 
MENU_OPEN = say /adminmapfinder, say_team /adminmapfinder, amx_adminmapfinder
MENU_REOPEN = 1
MENU_ALIVE = 0

[Menu Items]
;<Item Name> <Command> [Flag] [Team]
"All Maps" "say /mapfind *"
"CS Maps" "say /mapfind CS"
"DE Maps" "say /mapfind DE"
"FY Maps" "say /mapfind FY"
"AWP Maps" "say /mapfind AWP"

[New Menu = RANK MENU]

[Menu Settings]
;<settings> = <value>

MENU_TITLE = Rank Menu
MENU_TITLE_PAGE = %newline%Page:\d
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_FLAG = 0
MENU_TEAM = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You don't access to this menu.
MENU_NOTEAM = Your team isn't allowed to use this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND = 
MENU_OPEN = say /adminrankmenu, say_team /adminrankmenu, amx_adminrankmenu
MENU_REOPEN = 1
MENU_ALIVE = 0

[Menu Items]
;<Item Name> <Command> [Flag] [Team]
"Show XP & Rank" "say /xp"
"" "" "" ""
"" "" "" ""
"" "" "" ""
"" "" "" ""
"" "" "" ""
"Reset Admin Rank XP" "crxranks_reset_xp NQuarter"

[New Menu = SPECTATOR MENU]

[Menu Settings]
;<settings> = <value>

MENU_TITLE = Spectator Menu
MENU_TITLE_PAGE = %newline%Page:\d
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_FLAG = 0
MENU_TEAM = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You don't access to this menu.
MENU_NOTEAM = Your team isn't allowed to use this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND = 
MENU_OPEN = say /adminspectatormenu, say_team /adminspectatormenu, amx_adminspectatormenu
MENU_REOPEN = 1
MENU_ALIVE = 0

[Menu Items]
;<Item Name> <Command> [Flag] [Team]
"Spectator Info On/Off" "say /speclist"

[New Menu = BOT TEST MENU]

[Menu Settings]
;<settings> = <value>

MENU_TITLE = Bot Test Menu (Use amx_botexec to run a specific command on test bot.)
MENU_TITLE_PAGE = %newline%Page:\d 
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_FLAG = 0
MENU_TEAM = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You don't access to this menu.
MENU_NOTEAM = Your team isn't allowed to use this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND = 
MENU_OPEN = say /adminbottestmenu, say_team /adminbottestmenu, amx_adminbottestmenu
MENU_REOPEN = 1
MENU_ALIVE = 0

[Menu Items]
;<Item Name> <Command> [Flag] [Team]
"Add Test Bot" "amx_botadd Test"
"Delete Test Bot" "amx_botdel"
"Copy My Movements" "amx_botmove 1"
"Copy My Aim + Movements" "amx_botmove 2"
"Copy Opposite Movements" "amx_botmove 3"
"Stop Copying My Movements" "amx_botmove 0"






;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\CLIENT MENU\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\CLIENT MENU\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\CLIENT MENU\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\CLIENT MENU\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\CLIENT MENU\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\CLIENT MENU\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\CLIENT MENU\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\CLIENT MENU\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\CLIENT MENU\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\CLIENT MENU\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\










[New Menu = CLIENT MENU]

[Menu Settings]
;<settings> = <value>

MENU_TITLE = Client Menu
MENU_TITLE_PAGE = %newline%Page:\d
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_FLAG = 0
MENU_TEAM = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You don't access to this menu.
MENU_NOTEAM = Your team isn't allowed to use this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND = 
MENU_OPEN = say /clientmenu, say_team /clientmenu, amx_clientmenu
MENU_REOPEN = 0
MENU_ALIVE = 0

[Menu Items]
;<Item Name> <Command> [Flag] [Team]
"Server Menu" "amx_clientservermenu"
"Buy Menu" "amx_clientbuymenu"
"Money Menu" "amx_clientmoneymenu"
"Map Menu" "amx_clientmapmenu"
"Rank Menu" "amx_clientrankmenu"
"Spectator Menu" "amx_clientspectatormenu"

[New Menu = SERVER MENU]

[Menu Settings]
;<settings> = <value>

MENU_TITLE = Server Menu
MENU_TITLE_PAGE = %newline%Page:\d
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_FLAG = 0
MENU_TEAM = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You don't access to this menu.
MENU_NOTEAM = Your team isn't allowed to use this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND = 
MENU_OPEN = say /clientservermenu, say_team /clientservermenu, amx_clientservermenu
MENU_REOPEN = 0
MENU_ALIVE = 0

[Menu Items]
;<Item Name> <Command> [Flag] [Team]
"Pause Server" "amx_pause"
"The Time" "say thetime"
"Timeleft" "say timeleft"


[New Menu = BUY MENU]

[Menu Settings]
;<settings> = <value>

MENU_TITLE = Buy Menu
MENU_TITLE_PAGE = %newline%Page:\d
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_FLAG = 0
MENU_TEAM = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You don't access to this menu.
MENU_NOTEAM = Your team isn't allowed to use this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND = 
MENU_OPEN = say /clientbuymenu, say_team /clientbuymenu, amx_clientbuymenu
MENU_REOPEN = 0
MENU_ALIVE = 0

[Menu Items]
;<Item Name> <Command> [Flag] [Team]
"Buy HealthKit" "say /buyrkit"
"Buy Bulletproof Helmet" "say /bphelmet"

[New Menu = MONEY MENU]

[Menu Settings]
;<settings> = <value>

MENU_TITLE = Money Menu
MENU_TITLE_PAGE = %newline%Page:\d
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_FLAG = 0
MENU_TEAM = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You don't access to this menu.
MENU_NOTEAM = Your team isn't allowed to use this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND = 
MENU_OPEN = say /clientmoneymenu, say_team /clientmoneymenu, amx_clientmoneymenu
MENU_REOPEN = 0
MENU_ALIVE = 0

[Menu Items]
;<Item Name> <Command> [Flag] [Team]
"Give/Request Money" "say /money"

[New Menu = MAP MENU]

[Menu Settings]
;<settings> = <value>

MENU_TITLE = Map Menu
MENU_TITLE_PAGE = %newline%Page:\d
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_FLAG = 0
MENU_TEAM = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You don't access to this menu.
MENU_NOTEAM = Your team isn't allowed to use this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND = 
MENU_OPEN = say /clientmapmenu, say_team /clientmapmenu, amx_clientmapmenu
MENU_REOPEN = 0
MENU_ALIVE = 0

[Menu Items]
;<Item Name> <Command> [Flag] [Team]
"Current Map Name" "say /currentmap"
"Nextmap" "say nextmap"
"Map Lists" "say /clientmapfinder"

[New Menu = MAP LISTS]

[Menu Settings]
;<settings> = <value>

MENU_TITLE = Map Lists (For keywords use /mapfind "" in chat)
MENU_TITLE_PAGE = %newline%Page:\d 
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_FLAG = 0
MENU_TEAM = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You don't access to this menu.
MENU_NOTEAM = Your team isn't allowed to use this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND = 
MENU_OPEN = say /clientmapfinder, say_team /clientmapfinder, amx_clientmapfinder
MENU_REOPEN = 0
MENU_ALIVE = 0

[Menu Items]
;<Item Name> <Command> [Flag] [Team]
"All Maps" "say /mapfind *"
"CS Maps" "say /mapfind CS"
"DE Maps" "say /mapfind DE"
"FY Maps" "say /mapfind FY"
"AWP Maps" "say /mapfind AWP"

[New Menu = RANK MENU]

[Menu Settings]
;<settings> = <value>

MENU_TITLE = Rank Menu
MENU_TITLE_PAGE = %newline%Page:\d
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_FLAG = 0
MENU_TEAM = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You don't access to this menu.
MENU_NOTEAM = Your team isn't allowed to use this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND = 
MENU_OPEN = say /clientrankmenu, say_team /clientrankmenu, amx_clientrankmenu
MENU_REOPEN = 0
MENU_ALIVE = 0

[Menu Items]
;<Item Name> <Command> [Flag] [Team]
"Show XP & Rank" "say /xp"

[New Menu = SPECTATOR MENU]

[Menu Settings]
;<settings> = <value>

MENU_TITLE = Spectator Menu
MENU_TITLE_PAGE = %newline%Page:\d
MENU_BACK = \yPrevious Page
MENU_NEXT = \yNext Page
MENU_EXIT = \rClose
MENU_FLAG = 0
MENU_TEAM = 0
MENU_ALIVEONLY = 0
MENU_ITEMS_PER_PAGE = 7
MENU_ITEM_FORMAT = %item%
MENU_PREFIX = !g[Simple Menu]!n
MENU_NOACCESS = You don't access to this menu.
MENU_NOTEAM = Your team isn't allowed to use this menu.
MENU_ALIVE = You need to be alive to use this menu.
MENU_DEAD = You need to be dead to use this menu.
MENU_SOUND = 
MENU_OPEN = say /clientspectatormenu, say_team /clientspectatormenu, amx_clientspectatormenu
MENU_REOPEN = 0
MENU_ALIVE = 0

[Menu Items]
;<Item Name> <Command> [Flag] [Team]
"Spectator Info On/Off" "say /speclist"

PS: is there a limit for the amount of menus i can have? since i'm planning on adding lots more for my other plugins but i wouldn't like to forward till i had a word from you.

Note that if menus seems redundant, it's because some menus are available for clients, but have slightly different options/configurations. ( like menu reopen 0 or certain admin commands and tools)
i know i can add flags, but i find it better that way... unless the amount of menus i have its causing said runtime error.

Last edited by Ark_Procession; 12-18-2020 at 21:06. Reason: forgot to add
Ark_Procession is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-18-2020 , 21:18   Re: Simple Menu Builder
Reply With Quote #170

Pretty sure the problem is caused by you deleting the default settings in the beginning of the file. Put them back and see if it still happens.

You can have a maximum of 20 menus by default. You can easily increase this by editing MAX_MENUS in the .sma file.

Actually, now that I think about it, exceeding the max number could cause that error. Try increasing it.
__________________

Last edited by OciXCrom; 12-18-2020 at 21:22.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Old 12-18-2020, 21:21
OciXCrom
This message has been deleted by OciXCrom.
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode