Raised This Month: $319 Target: $400
 79%   Almost there!

Solved show only first 7 items in menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
retail
New Member
Join Date: Jun 2021
Old 06-01-2021 , 11:33   show only first 7 items in menu
Reply With Quote #1

i have this small menu, it shows all items, i want to show only 7 items on a page and if i press 9 it should to switch to another page

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <engine> #include <cstrike> #include <fakemeta> const KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_9|MENU_KEY_0 new const items[][] = {     "Item 1",     "Item 2",     "Item 3",     "Item 4",     "Item 5",     "Item 6",     "Item 7",     "Item 8",     "Item 9",     "Item 10",     "Item 11",     "Item 12",     "Item 13",     "Item 14",     "Item 15",     "Item 16",     "Item 17",     "Item 18",     "Item 19",     "Item 20",     "Item 21",     "Item 22",     "Item 23" } public plugin_init() {     register_plugin("[AMXX] Shop", "1.0", "retail")         register_clcmd("say /menu", "show_shop", ADMIN_ALL)     register_menu("Shop Menu", KEYSMENU, "menu_handler") } public show_shop(id) {        new szMenu[512], len     len = formatex(szMenu, charsmax(szMenu), ("\yShop^n"))         for (new i = 0; i < sizeof items; i++)         len += formatex(szMenu[len], charsmax(szMenu) - len, "^n\w%d. \y%s", i + 1, items[i])     len += formatex(szMenu[len], charsmax(szMenu) - len, "^n^n\w9. \yNext / Back")         formatex(szMenu[len], charsmax(szMenu) - len, "^n^n\w0. \yExit")         set_pdata_int(id, 205, 0)     show_menu(id, KEYSMENU, szMenu, -1, "Shop Menu") } public menu_handler(id, key) {     new iKey = key + 1         switch(iKey)     {         case 9:         {             // what i need to do here?         }     }         return PLUGIN_HANDLED }

Last edited by retail; 06-01-2021 at 16:57.
retail is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-01-2021 , 14:24   Re: show only first 7 items in menu
Reply With Quote #2

use the new menu system no need to use the old one its deprecated !!!
__________________
@Jailbreak Main Mod v2.6.6 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
retail
New Member
Join Date: Jun 2021
Old 06-01-2021 , 14:53   Re: show only first 7 items in menu
Reply With Quote #3

Quote:
Originally Posted by Natsheh View Post
use the new menu system no need to use the old one its deprecated !!!
i used this method to put a text like this:


i dont know how to put that text with new menu system
retail is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-01-2021 , 15:15   Re: show only first 7 items in menu
Reply With Quote #4

menu_additem(menuID, "Open Sub-Menu^nLook, this is a cool text!")

^n or \n is a symbol for a newline
__________________
@Jailbreak Main Mod v2.6.6 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
retail
New Member
Join Date: Jun 2021
Old 06-01-2021 , 16:57   Re: show only first 7 items in menu
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
menu_additem(menuID, "Open Sub-Menu^nLook, this is a cool text!")

^n or \n is a symbol for a newline
thanks
retail is offline
Reply


Thread Tools
Display Modes

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:16.


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