PHP Code:
add_new_item( id )
{
new oldmenu, menu;
player_menu_info( id, oldmenu, menu );
if( menu ) //New menu
{
client_cmd( id, "slot10" );
menu_additem( menu, "New item" );
menu_display( id, menu );
}
//else { } //Old menu action if wanted
}
This can only add an item to a menu player is currently viewing. Also we can't know what the menu handler does to it's items and this is a bad idea anyway. If you are wanting to do this properly you should use dynamic natives.