Example #1
0
Menu::Menu(const char *title, AMX *amx, int fid) : m_Title(title), m_ItemColor("\\r"), 
m_NeverExit(false), m_AutoColors(g_coloredmenus), thisId(0), func(fid), 
isDestroying(false), items_per_page(7)
{
	CPluginMngr::CPlugin *pPlugin = g_plugins.findPluginFast(amx);
	menuId = g_menucmds.registerMenuId(title, amx);

	if (strcmp(pPlugin->getName(), "war3ft.amxx") == 0)
	{
		const char *version = pPlugin->getVersion();
		if (strncmp(pPlugin->getVersion(), "3.0 RC", 6) == 0
			&& atoi(&version[6]) <= 8)
		{
			g_menucmds.registerMenuCmd(
				g_plugins.findPluginFast(amx), 
				menuId, 
				-1, 
				g_forwards.duplicateSPForward(fid), 
				true);
		}
	}

	m_OptNames[abs(MENU_BACK)] = "Back";
	m_OptNames[abs(MENU_MORE)] = "More";
	m_OptNames[abs(MENU_EXIT)] = "Exit";
}
Example #2
0
const char *Debugger::_GetVersion()
{
    if (m_Version.size() < 1)
    {
        const char *version = "";
        CPluginMngr::CPlugin *pl = g_plugins.findPluginFast(m_pAmx);
        if (pl)
        {
            version = pl->getVersion();
        }

        m_Version.assign(version);
    }

    return m_Version.c_str();
}