Raised This Month: $51 Target: $400
 12% 

[Request] How to add [] To Menu


Post New Thread Reply   
 
Thread Tools Display Modes
DON KHAN 1
Senior Member
Join Date: Mar 2019
Location: Pakistan
Old 09-03-2019 , 13:55   Re: [Request] How to add [] To Menu
Reply With Quote #11

PHP Code:
#include <amxmodx> 

public plugin_init() 

    
register_plugin("My Menu""1.0""Me"); 
    
register_clcmd("say /bb_menu""ShowMenu"_"Select team"); 
    
register_clcmd("bb_menu""ShowMenu"_"Select team"); 
    
register_concmd("bb_menu""ShowMenu"_"Select team"); 
    
register_clcmd("chooseteam""ShowMenu"
     


public 
ShowMenu(id

    new 
menu menu_create("\yHarDGaminG Menu:""MrAbdoO"); 

    
menu_additem(menu"\y[1]. \WChange Class \r[ALL Players]"""0); // case 0 
    
menu_additem(menu"\y[2]. \WBuy Items \r[ALL Players]"""0); // case 1 
    
menu_additem(menu"\y[3]. \WBanka \r[ALL Players]"""0); // case 2 
    
menu_additem(menu"\y[4]. \WBoost \r[ALL Players]"""0); // case 3 
    
menu_additem(menu"\y[5]. \WCamera \r[ALL Players]"""0); // case 4 
    
menu_additem(menu"\y[6]. \WVIP Shop \r[VIP Only]"""0); // case 5 
    
menu_additem(menu"\y[7]. \WAdmin Menu \r[Admin Only]"""0); // case 6 

    
menu_setprop(menuMPROP_EXITMEXIT_ALL); 
    
menu_setprop(menuMPROP_PERPAGE7);

    
menu_display(idmenu0); 

    return 
PLUGIN_HANDLED


public 
MrAbdoO(idmenuitem

    if(
item == MENU_EXIT
    { 
        
menu_cancel(id); 
        return 
PLUGIN_HANDLED
    } 

    new 
command[6], name[64], accesscallback

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback); 

    switch(
item
    { 
        case 
0client_cmd(id"say /class"); 
        case 
1client_cmd(id"bb_shop"); 
        case 
2client_cmd(id"bb_banka"); 
        case 
3client_cmd(id"bb_boost"); 
        case 
4client_cmd(id"bb_cam"); 
        case 
5client_cmd(id"vips_shop"); 
        case 
6client_cmd(id"admin_menu"); 

    } 

    
menu_destroy(menu); 

    return 
PLUGIN_HANDLED

added 7 items per page but u need to add items in menu by urself and after adding 7 items the other item will be transfered to next page i can't do everything with my laggy laptop

P.S: use this menu instead of the LearninG's menu cuz this menu is new style n LearninG's menu is old style & some hard for ur understandning otherwise as ur wish which menu u think is better.
__________________
Facebook
My YouTube
Ro{Y}aL WarLanD CommuniTy
Selling Zombie CSO 4.3 Money System Mod

Last edited by DON KHAN 1; 09-03-2019 at 14:01.
DON KHAN 1 is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 09-03-2019 , 15:04   Re: [Request] How to add [] To Menu
Reply With Quote #12

Quote:
#include <amxmodx>

public plugin_init()
{
register_plugin("My Menu", "1.0", "Me");
register_clcmd("say /bb_menu", "ShowMenu", _, "Select team");
register_clcmd("bb_menu", "ShowMenu", _, "Select team");
register_concmd("bb_menu", "ShowMenu", _, "Select team");
register_clcmd("chooseteam", "ShowMenu")

}

public ShowMenu(id)
{
new menu = menu_create("\yHarDGaminG Menu:", "MrAbdoO");

menu_additem(menu, "\y[1]. \WChange Class \r[ALL Players]", "", 0); // case 0
menu_additem(menu, "\y[2]. \WBuy Items \r[ALL Players]", "", 0); // case 1
menu_additem(menu, "\y[3]. \WBanka \r[ALL Players]", "", 0); // case 2
menu_additem(menu, "\y[4]. \WBoost \r[ALL Players]", "", 0); // case 3
menu_additem(menu, "\y[5]. \WCamera \r[ALL Players]", "", 0); // case 4
menu_additem(menu, "\y[6]. \WVIP Shop \r[VIP Only]", "", 0); // case 5
menu_additem(menu, "\y[7]. \WAdmin Menu \r[Admin Only]", "", 0); // case 6

menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_setprop(menu, MPROP_PERPAGE, 7);

menu_display(id, menu, 0);

return PLUGIN_HANDLED;
}

public MrAbdoO(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_cancel(id);
return PLUGIN_HANDLED;
}

new command[6], name[64], access, callback;

menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);

switch(item)
{
case 0: client_cmd(id, "say /class");
case 1: client_cmd(id, "bb_shop");
case 2: client_cmd(id, "bb_banka");
case 3: client_cmd(id, "bb_boost");
case 4: client_cmd(id, "bb_cam");
case 5: client_cmd(id, "vips_shop");
case 6: client_cmd(id, "admin_menu");

}

menu_destroy(menu);

return PLUGIN_HANDLED;
}
added 7 items per page but u need to add items in menu by urself and after adding 7 items the other item will be transfered to next page i can't do everything with my laggy laptop

P.S: use this menu instead of the LearninG's menu cuz this menu is new style n LearninG's menu is old style & some hard for ur understandning otherwise as ur wish which menu u think is better.
Bro you added Tow Nummbers
Ex: 1.[1] Classes [ALL Player]
proof : https://i.ibb.co/LJHgX2G/t.png
Supremache is offline
LearninG
Senior Member
Join Date: Apr 2019
Location: Iran
Old 09-03-2019 , 16:00   Re: [Request] How to add [] To Menu
Reply With Quote #13

Quote:
Originally Posted by DON KHAN 1 View Post
PHP Code:
#include <amxmodx> 

public plugin_init() 

    
register_plugin("My Menu""1.0""Me"); 
    
register_clcmd("say /bb_menu""ShowMenu"_"Select team"); 
    
register_clcmd("bb_menu""ShowMenu"_"Select team"); 
    
register_concmd("bb_menu""ShowMenu"_"Select team"); 
    
register_clcmd("chooseteam""ShowMenu"
     


public 
ShowMenu(id

    new 
menu menu_create("\yHarDGaminG Menu:""MrAbdoO"); 

    
menu_additem(menu"\y[1]. \WChange Class \r[ALL Players]"""0); // case 0 
    
menu_additem(menu"\y[2]. \WBuy Items \r[ALL Players]"""0); // case 1 
    
menu_additem(menu"\y[3]. \WBanka \r[ALL Players]"""0); // case 2 
    
menu_additem(menu"\y[4]. \WBoost \r[ALL Players]"""0); // case 3 
    
menu_additem(menu"\y[5]. \WCamera \r[ALL Players]"""0); // case 4 
    
menu_additem(menu"\y[6]. \WVIP Shop \r[VIP Only]"""0); // case 5 
    
menu_additem(menu"\y[7]. \WAdmin Menu \r[Admin Only]"""0); // case 6 

    
menu_setprop(menuMPROP_EXITMEXIT_ALL); 
    
menu_setprop(menuMPROP_PERPAGE7);

    
menu_display(idmenu0); 

    return 
PLUGIN_HANDLED


public 
MrAbdoO(idmenuitem

    if(
item == MENU_EXIT
    { 
        
menu_cancel(id); 
        return 
PLUGIN_HANDLED
    } 

    new 
command[6], name[64], accesscallback

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback); 

    switch(
item
    { 
        case 
0client_cmd(id"say /class"); 
        case 
1client_cmd(id"bb_shop"); 
        case 
2client_cmd(id"bb_banka"); 
        case 
3client_cmd(id"bb_boost"); 
        case 
4client_cmd(id"bb_cam"); 
        case 
5client_cmd(id"vips_shop"); 
        case 
6client_cmd(id"admin_menu"); 

    } 

    
menu_destroy(menu); 

    return 
PLUGIN_HANDLED

added 7 items per page but u need to add items in menu by urself and after adding 7 items the other item will be transfered to next page i can't do everything with my laggy laptop

P.S: use this menu instead of the LearninG's menu cuz this menu is new style n LearninG's menu is old style & some hard for ur understandning otherwise as ur wish which menu u think is better.
he want to add "[number]" , and it's not possible with new menu style , your just adding 2 numbers per item...
+
in other case if he want to use new menu style this will be more efficient : https://forums.alliedmods.net/showpo...8&postcount=10

Last edited by LearninG; 09-03-2019 at 16:04.
LearninG is offline
DON KHAN 1
Senior Member
Join Date: Mar 2019
Location: Pakistan
Old 09-04-2019 , 02:07   Re: [Request] How to add [] To Menu
Reply With Quote #14

Quote:
in other case if he want to use new menu style this will be more efficient : https://forums.alliedmods.net/showpo...8&postcount=10
this can be use too

but if he want to add next page after 7 items so
PHP Code:
 #include <amxmodx>

new g_szItems[][] =
{
    
"Change Class",
    
"Buy Items",
    
"Banka",
    
"Boost",
    
"Camera",
    
"VIP Shop",
    
"Admin Menu"
}

new 
g_szItemFlag[][] =
{
    
"",
    
"[ALL Players]",
    
"[ALL Players]",
    
"[ALL Players]",
    
"[ALL Players]",
    
"[VIP Only]",
    
"[Admin Only]"
}
public 
plugin_init()
{
    
register_plugin("My Menu""1.0""Me");
    
register_clcmd("say /bb_menu""ShowMenu"_"Select team");
    
register_clcmd("bb_menu""ShowMenu"_"Select team");
    
register_concmd("bb_menu""ShowMenu"_"Select team");
    
register_clcmd("chooseteam""ShowMenu")
}

public 
ShowMenu(id)
{
    new 
menu menu_create("\yHarDGaminG Menu:""MrAbdoO");
    new 
szItemName[64]
    for (new 
ii<sizeof g_szItems && i<sizeof g_szItemFlagi++)
    {
        
formatex(szItemName charsmax(szItemName) , "\w%s \r%s" g_szItems[i] , g_szItemFlag[i])
        
menu_additem(menu szItemName); 
    
        
menu_setprop(menuMPROP_PERPAGE7);
    }
    
menu_display(id menu 0);
}

public 
MrAbdoO(idmenuitem)
{
    if (
is_user_connected(id))
 
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
command[6], name[64], accesscallback;

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);

    switch(
item)
    {
        case 
0client_cmd(id"say /class");
        case 
1client_cmd(id"bb_shop");
        case 
2client_cmd(id"bb_banka");
        case 
3client_cmd(id"bb_boost");
        case 
4client_cmd(id"bb_cam");
        case 
5client_cmd(id"vips_shop");
        case 
6client_cmd(id"admin_menu");

    }

    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;

__________________
Facebook
My YouTube
Ro{Y}aL WarLanD CommuniTy
Selling Zombie CSO 4.3 Money System Mod
DON KHAN 1 is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 09-04-2019 , 07:06   Re: [Request] How to add [] To Menu
Reply With Quote #15

Quote:
this can be use too

but if he want to add next page after 7 items so
Bro this my First Shop, i want to make stype i told you cheack my request i told i want my shop be
From this
Quote:
#include <amxmodx>

new g_szItems[][] =
{
"Change Class",
"Buy Items",
"Banka",
"Boost",
"Camera",
"VIP Shop",
"Admin Menu"
}

new g_szItemFlag[][] =
{
"",
"[ALL Players]",
"[ALL Players]",
"[ALL Players]",
"[ALL Players]",
"[VIP Only]",
"[Admin Only]"
}
public plugin_init()
{
register_plugin("My Menu", "1.0", "Me");
register_clcmd("say /bb_menu", "ShowMenu", _, "Select team");
register_clcmd("bb_menu", "ShowMenu", _, "Select team");
register_concmd("bb_menu", "ShowMenu", _, "Select team");
register_clcmd("chooseteam", "ShowMenu")
}

public ShowMenu(id)
{
new menu = menu_create("\yHarDGaminG Menu:", "MrAbdoO");
new szItemName[64]
for (new i; i<sizeof g_szItems && i<sizeof g_szItemFlag; i++)
{
formatex(szItemName , charsmax(szItemName) , "\w%s \r%s" , g_szItems[i] , g_szItemFlag[i])
menu_additem(menu , szItemName);

menu_setprop(menu, MPROP_PERPAGE, 7);
}
menu_display(id , menu , 0);
}

public MrAbdoO(id, menu, item)
{
if (is_user_connected(id))

if(item == MENU_EXIT)
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}

new command[6], name[64], access, callback;

menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);

switch(item)
{
case 0: client_cmd(id, "say /class");
case 1: client_cmd(id, "bb_shop");
case 2: client_cmd(id, "bb_banka");
case 3: client_cmd(id, "bb_boost");
case 4: client_cmd(id, "bb_cam");
case 5: client_cmd(id, "vips_shop");
case 6: client_cmd(id, "admin_menu");

}

menu_destroy(menu);
return PLUGIN_HANDLED;
}
To https://i.ibb.co/G7kdDSw/Untitled.png
Supremache is offline
LearninG
Senior Member
Join Date: Apr 2019
Location: Iran
Old 09-04-2019 , 08:31   Re: [Request] How to add [] To Menu
Reply With Quote #16

Quote:
Originally Posted by DON KHAN 1 View Post

for (new i; i<sizeof g_szItems && i<sizeof g_szItemFlag; i++)
{
formatex(szItemName , charsmax(szItemName) , "\w%s \r%s" , g_szItems[i] , g_szItemFlag[i])
menu_additem(menu , szItemName);

menu_setprop(menu, MPROP_PERPAGE, 7);
}
menu_display(id , menu , 0);
}
Code:
menu_setprop(menu , MPROP_PERPAGE , 7);
should be out of loop.
LearninG 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 23:06.


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