As a side note, for admin items you don't need to make a callback.
Code:
/**
* Adds an menu to a menu.
*
* @param menu Menu resource identifier.
* @param name Item text to display.
* @param info Item info string for internal information.
* @param paccess Access required by the player viewing the menu.
* @param callback If set to a valid ID from menu_makecallback(), the
* callback will be invoked before drawing the item.
* @noreturn
* @error Invalid menu resource.
*/
native menu_additem(menu, const name[], const info[]="", paccess=0, callback=-1);
Just set paccess variable to ADMIN_ADMIN and it should work.
PHP Code:
menu_additem(DM_Menu, "Admin Menu", "5", 0, g_AdminCallback)
->
PHP Code:
menu_additem(DM_Menu, "Admin Menu", "5", ADMIN_ADMIN)
2nd tip, you don't need to get item info and ton convert it to an integer to retrieve key, just use item instead :
PHP Code:
new data[6], szName[64];
new access, callback;
menu_item_getinfo(DM_Menu, item, access, data, charsmax(data), szName, charsmax(szName), callback);
new key = str_to_num(data);
switch( key )
{
case 1: // Change Team Menu
->
PHP Code:
switch( item )
{
case 0: // Change Team Menu
item starts at 0 when your code was making key start at 1, this is the only difference.
__________________