Raised This Month: $ Target: $400
 0% 

Submenu?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xer'
Junior Member
Join Date: Apr 2009
Old 09-28-2009 , 06:41   Submenu?
Reply With Quote #1

hello, i have this code:

Code:
#include <amxmodx>
#include <amxmisc>


public plugin_init()
{
    register_plugin("menu", "1.0", "xer'");
    register_clcmd("say /price","hook_say");
    register_clcmd("say_team /price","hook_say");
}
public hook_say(id)
{
    new g_Nlen = menu_create("\rSOMET.:", "menu_settings");

    menu_additem(g_Nlen, "\wsomething", "1", 0);
    menu_additem(g_Nlen, "\wblabla", "2", 0);
    menu_additem(g_Nlen, "\wsomethingelse", "3", 0);
    menu_additem(g_Nlen, "\wgrrrrrr", "4", 0);
    menu_additem(g_Nlen, "\wswtomywa", "5", 0);
    
    menu_additem(g_Nlen, "\wsomething", "6", 0);

    menu_setprop(g_Nlen, MPROP_EXIT, MEXIT_ALL);
    
    menu_display(id, g_Nlen, 0);
}
public menu_settings(id, g_Nlen, item)
{
    if(item == MENU_EXIT)
    {
        menu_destroy(g_Nlen);
        return PLUGIN_HANDLED;
    }

    new szData[6], iName[64];
    new access, callback;

    menu_item_getinfo(g_Nlen, item, access, szData,5, iName,63, callback);

    new key = str_to_num(szData)

    switch(key)
    {
        case 1:
        {
            menu_destroy(g_Nlen);
            return PLUGIN_HANDLED;
        }
        case 2:
            menu_destroy(g_Nlen);
            return PLUGIN_HANDLED;
        }
        case 3:
            menu_destroy(g_Nlen);
            return PLUGIN_HANDLED;
        }
        case 4:
        {
            menu_destroy(g_Nlen);
            return PLUGIN_HANDLED;
        }
        case 5:
        {
            menu_destroy(g_Nlen);
            return PLUGIN_HANDLED;
        }
        case 6: 
        {
            new g_SubNlen = menu_create("\rSomething:", "something");
    
            menu_additem(g_SubNlen, "\wsz", "1", 0);
            menu_additem(g_SubNlen, "\wForum: -", "2", 0);
    
            menu_additem(g_SubNlen, "\wInapoi", "3", 0);

            menu_setprop(g_SubNlen, MPROP_EXIT, MEXIT_ALL);
    
            menu_display(id, g_SubNlen, 0);
        }
    }
    return PLUGIN_HANDLED;
}
public something(id, g_SubNlen, item)
{
    if(item == MENU_EXIT)
    {
        menu_destroy(g_SubNlen);
        return PLUGIN_HANDLED;
    }

    new szData1[6], iName1[64];
    new access1, callback1;

    menu_item_getinfo(g_SubNlen, item, access1, szData1,5, iName1,63, callback1);

    new key1 = str_to_num(szData1)

    switch(key1)
    {
        case 1:
        {
            menu_destroy(g_SubNlen)
            return PLUGIN_HANDLED;
        }
        case 2:
        {
            menu_destroy(g_SubNlen)
            return PLUGIN_HANDLED;
        }
        case 3:
        {
            menu_display(id, g_Nlen, 0);
            return PLUGIN_HANDLED;
        }
    }
    return PLUGIN_HANDLED;
}
How can i make a "submenu"?
He give errors at compile.
Thanks.
__________________

Last edited by xer'; 09-28-2009 at 06:43.
xer' is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-28-2009 , 11:50   Re: Submenu?
Reply With Quote #2

Quote:
Originally Posted by xer' View Post
hello, i have this code:
That's the problem.
You have that code, but you don't exactly know what you're doing.
Please read up on Pawn and some tutorials to get a good feel of scripting.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:36.


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