Here's some sample code I ripped from one of my plugins; it's how I usually handle DisplayMenuAtItem. It doesn't work in all cases, especially if you can't pass in the index to the menu item, but it might suit your needs:
PHP Code:
void:Void_MenuCreate(client, index = 0)
{
decl String:g_sDisplay[128], String:g_sTemp[8];
new g_iTemp, Handle:g_hMenu = CreateMenu(MenuHandler_CreateMenu);
Format(g_sDisplay, sizeof(g_sDisplay), "Yo Yo!");
SetMenuTitle(g_hMenu, g_sDisplay);
SetMenuExitButton(g_hMenu, true);
SetMenuExitBackButton(g_hMenu, true);
for(new i = 1; i <= 21; i++)
{
Format(g_sTemp, 8, "%d", g_iTemp);
AddMenuItem(g_hMenu, g_sTemp, g_sTemp);
g_iTemp++;
}
DisplayMenuAtItem(g_hMenu, client, index, MENU_TIME_FOREVER);
}
public MenuHandler_CreateMenu(Handle:menu, MenuAction:action, param1, param2)
{
switch (action)
{
case MenuAction_End:
CloseHandle(menu);
case MenuAction_Cancel:
Void_MenuProp(param1);
case MenuAction_Select:
{
decl String:g_sTemp[32], String:g_sBuffer[2][4];
GetMenuItem(menu, param2, g_sTemp, sizeof(g_sTemp));
new g_iTemp = StringToInt(g_sTemp);
g_iTemp = RoundToFloor(float(g_iTemp / 7)) * 7;
Void_MenuCreate(param1, g_iTemp);
}
}
return;
}
__________________