AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Menu doesn't works (https://forums.alliedmods.net/showthread.php?t=221710)

TheDS1337 07-25-2013 10:35

Menu doesn't works
 
Hi all, I'm trying to make something, but the menu doesn't work, can some one fix it ?
ZP Addons: Achievements

iBrazilian 07-25-2013 11:02

Re: Menu doesn't works
 
Be specific or detailed to what isn't working..

TheDS1337 07-25-2013 11:10

Re: Menu doesn't works
 
Quote:

Originally Posted by iBrazilian (Post 1998490)
Be specific or detailed to what isn't working..

menu_Register and menu_Achievements doesn't work

iBrazilian 07-25-2013 12:30

Re: Menu doesn't works
 
Quote:

Originally Posted by DeagLe.Studio (Post 1998498)
menu_Register and menu_Achievements doesn't work

Either I'm slow from not sleeping tonight, or menu_Register and menu_Achievements aren't defined in the file.

---------------------------------------------------------------------

EDIT: It's menuRegister and menuAchievements. No underscore on them.

---------------------------------------------------------------------

EDIT 2: let us know if it works.

Code:

public menuRegister(id)
{
    new menu = menu_create("Register Menu", "menuHandleRegister");
    menu_additem(menu, "Login");
    menu_additem(menu, "Register");
    menu_display(id, menu);
   
    menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
    menu_display( id, menu, 0 );
}

public menuHandleRegister(id, menu, item) {
    if (item == MENU_EXIT)
    {
    menu_destroy( menu );
    return PLUGIN_HANDLED;
}

    switch(item)
    {
        case 0:
        {
            if (!g_registered[id]) {
                zp_colored_print(id, "%s %L", PLUGIN_PREFIX, id, "NOT_REGISTERED");
                return PLUGIN_CONTINUE;
            }
            client_cmd(id, "messagemode _get_achievement_password");
        }
        case 1:
        {
            if (g_registered[id]) {
                zp_colored_print(id, "%s %L", PLUGIN_PREFIX, id, "ALREADY_REGISTERED");
                return PLUGIN_CONTINUE;
            }
            client_cmd(id, "messagemode _set_achievement_password");
        }
    }
    menu_destroy( menu );
    return PLUGIN_HANDLED;
}

public menuAchievements(id)
{
    new menu = menu_create("Achievements Menu", "menuHandleAchievements");
    menu_additem(menu, "Buy SAPs by APs");
    menu_additem(menu, "Buy APs by SAPs");
   
    menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
    menu_display( id, menu, 0 );
}

public menuHandleAchievements(id, menu, item)
{
    if (item == MENU_EXIT) {
    menu_destroy( menu );
    return PLUGIN_HANDLED;
}

    new subMenu, i;
    switch (item)
    {
        case 0:
        {
            subMenu = menu_create("Buy SAPs", "menuHandleBuySAPs");
            for (i = 0; i < sizeof g_menuSAPs; i++) menu_additem(subMenu, g_menuSAPs[i][name]);
            menu_display(id, subMenu);
        }
        case 1:
        {
            subMenu = menu_create("Buy APs", "menuHandleBuyAPs");
            for (i = 0; i < sizeof g_menuAPs; i++) menu_additem(subMenu, g_menuAPs[i][name]);
            menu_display(id, subMenu);
        }
    }
    menu_destroy( menu );
    return PLUGIN_HANDLED;
}


fysiks 07-25-2013 23:13

Re: Menu doesn't works
 
Post plugins as attachments. It's really not that hard.

TheDS1337 07-26-2013 06:56

Re: Menu doesn't works
 
2 Attachment(s)
Quote:

Originally Posted by fysiks (Post 1998859)
Post plugins as attachments. It's really not that hard.

Sorry, I forget to attach the header file, here what you need:

almat123 03-02-2014 16:47

Re: Menu doesn't works
 
Hmmm Not Hard i can help you with this plaguin. send me massage.

fysiks 03-02-2014 17:43

Re: Menu doesn't works
 
Quote:

Originally Posted by almat123 (Post 2106486)
Hmmm Not Hard i can help you with this plaguin. send me massage.

This thread is 7 months old. Also, This forum is for helping people so you can just post what your suggestion or "help" is.


All times are GMT -4. The time now is 06:27.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.