Raised This Month: $32 Target: $400
 8% 

Request rewrite this choose menu code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eNNkds
Member
Join Date: Sep 2012
Location: Romania
Old 12-15-2020 , 12:29   Request rewrite this choose menu code
Reply With Quote #1

i whant to add a number 0 to be Exit (menu destroy)
8 back 9 for next

Code:
public show_zclass_menu(id,offset)
{
	if(offset<0) offset = 0

	new keys, curnum, menu[512], szCache1[32], szCache2[32], iCache3
	for(new i=offset;i<g_iZClasses;i++)
	{
		ArrayGetString(g_zclass_name, i, szCache1, charsmax(szCache1))
		ArrayGetString(g_zclass_info, i, szCache2, charsmax(szCache2))
		iCache3 = ArrayGetCell(g_zclass_admin, i)
		
		// Add to menu
		if (i == g_iZombieClass[id])
			format(menu,511,"%s^n\d%d. %s %s \r%s", menu, curnum+1, szCache1, szCache2, iCache3 == ADMIN_ALL ? "" : "(Admin Only)")
		else
			format(menu,511,"%s^n\w%d. %s \y%s \r%s", menu, curnum+1, szCache1, szCache2, iCache3 == ADMIN_ALL ? "" : "(Admin Only)")
		
		g_iMenuOptions[id][curnum] = i
		keys += (1<<curnum)
	
		curnum++
		
		if(curnum==8)
			break;
	}

	format(menu,511,"\w[\rBB\w] Select Your Class:^n\w%s^n", menu)
	if(curnum==8 && offset<12)
	{
		keys += (1<<8)
		format(menu,511,"%s^n\w9. \rNext",menu)
	}
	if(offset)
	{
		keys += (1<<9)
		format(menu,511,"%s^n\w0. \rBack",menu)
	}

	show_menu(id,keys,menu,-1,"ZClassSelect")
}
eNNkds is offline
Send a message via Skype™ to eNNkds
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-15-2020 , 22:53   Re: Request rewrite this choose menu code
Reply With Quote #2

The easiest way to do that is to implement your menu using the "new menu" api here.
__________________
fysiks is online now
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 21:18.


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