SAPE ERROR: Не могу подключиться к серверу: dispenser-01.saperu.net/code.php?user=836f97673aa6aa25a35b5029263ee232&host=amxxmodx.ru&charset=windows-1251&format=serialize, type: file_get_contents

SAPE ERROR: Не могу подключиться к серверу: dispenser-02.saperu.net/code.php?user=836f97673aa6aa25a35b5029263ee232&host=amxxmodx.ru&charset=windows-1251&format=serialize, type: file_get_contents

menu_find_id id . » AmxModX
| |
 RSS
  • OnLine

    : 2
    : 1
    : -
    : crawl Bot

    ?

    • AMX Mod X
    • up.org.ua


  • : Admin : 7-03-2012, 11:56 : 2615

    menu_find_id id .

    , , DJ_WEST, , , id , . , .

    newmenu.inc:
    /**
    * Given a page on a menu and a keypress on that page, returns the item id selected.
    * If the item is less than 0, a special option was chosen (such as MENU_EXIT).
    *
    * @param menu            Menu resource identifier.
    * @param page            Page on the menu.
    * @param key            Key pressed (from 1 to 10).
    * @return                Item identifier, or <0 for a special selection code.
    * @error                Invalid menu resource.
    */
    native menu_find_id(menu, page, key);


    :
    menu_find_id(menu, page, key)

    • menu - id
    • page -
    • key -
    id

    :
    Native

    :
    /* Plugin generated by AMXX-Studio */

    #include <amxmodx>
    #include <amxmisc>

    #define PLUGIN "[newmenu.inc] menu_items"
    #define VERSION "1.0"
    #define AUTHOR "Admin"

    new mTEST // Menu
    new mcbTEST // Menu Callback

    public plugin_init() {
        
        register_plugin(PLUGIN, VERSION, AUTHOR)
        
        register_clcmd("say /menu","func_menu")
        
        mTEST = menu_create("TEST", "mh_TEST")
        mcbTEST = menu_makecallback("mcb_TEST")
        
        new szItem[64]
        for (new i=1; i < 25; i++){
            format(szItem,63,"Item %i",i)
            menu_additem(mTEST,szItem, "ma_TEST", ADMIN_ALL, mcbTEST)
        }
        menu_setprop(mTEST,MPROP_EXIT, 1)
        
        new iItems
        iItems = menu_items(mTEST)
        server_print("[NewMenus] Number items:%d",iItems)
    }
    public func_menu(id){

        
        new menu_item_id = menu_find_id(mTEST,1,2)

        menu_item_setname(mTEST,menu_item_id,"New Menu Item Name")
        
        menu_display(id, mTEST, 0)
    }
    public mh_TEST(id, menu, item) {
        item++
        client_print(id,print_chat,"You select %d",item)
    }
    public mcb_TEST(id, menu, item){
        //callback
    }


    :
    , .

    , , .
    , .
    , . .

    ...
    , 2 .
    :
    new menu_item_id = menu_find_id(mTEST,1,2)

    , , 1.

    menu_item_setname .
    , .
    .
    menu_find_id id .