The problem is that you're misunderstanding how the "paccess" parameter in menu_additem() works. A value of 1 for this parameter allows anybody with immunity to access that item. The values that are intended to be used in this parameter are found in amxconst.inc
here. You can see that the admin immunity flag (ADMIN_IMMUNITY) is a value of 1.
To do what you want, you're actually looking for callbacks. Callbacks are used to determine if you want an item enabled or disabled when this menu is shown to the player. So, in this case, you want "paccess" to always be zero and then create your callback:
PHP Code:
public showMyMenu(id)
{
new menu = menu_create()
new cbLevelCheck = menu_makecallback("cbLevelCheck")
menu_additem(menu, "Name(1)", "Info", 0, cbLevelCheck)
.
.
.
menu_additem(menu, "Name(n)", "Info", 0, cbLevelCheck)
menu_display(id, menu, 0)
}
public cbLevelCheck(id, menu, item)
{
// Use any logic here to determine if the item should be enabled or disabled
if( iLevel[id] >= item )
{
return ITEM_ENABLED
}
return ITEM_DISABLED
}
You can take a look at the
New Menus Tutorial to learn more neat features.
P.S. You need to make your title descriptive (it's a rule here) so that people can have a general idea of what your post is about without having to read the entire post.
I think you should probably do some testing first (e.g. learn how the menu_additem() function works). Also, you didn't even attempt to answer his question. At least explain that nothing you're posting has anything to do with the actual question.
Also, "if( iLevel[id] > 0 )" and "if(iLevel[id])" are two very different functionality.