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

Help / Support Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rustics
New Member
Join Date: Aug 2018
Location: Russia
Old 08-20-2018 , 12:23   Menu
Reply With Quote #1

Hi everyone
Could you help with that?
There is no zero menu item.What did i do wrong?



Code:
// Game Menu
show_menu_game(id)
{
	// Player disconnected?
	if (!g_isconnected[id])
		return;
	
	static menu[250], len, userflags
	len = 0
	userflags = get_user_flags(id)
	
	// Title
	if(userflags & ADMIN_SLAY)
		len += formatex(menu[len], charsmax(menu) - len, "%L^n^n", id, "MENU_MAIN_NAME")
	else if(userflags & ADMIN_LEVEL_D)
		len += formatex(menu[len], charsmax(menu) - len, "%L^n^n", id, "MENU_MAIN_NAME")
	else if(userflags & ADMIN_LEVEL_E)
		len += formatex(menu[len], charsmax(menu) - len, "%L^n^n", id, "MENU_MAIN_NAME")
	else if(userflags & ADMIN_LEVEL_A)
		len += formatex(menu[len], charsmax(menu) - len, "%L^n^n", id, "MENU_MAIN_NAME")
	else
		len += formatex(menu[len], charsmax(menu) - len, "%L^n^n", id, "MENU_MAIN_NAME")
	
	// 1. Buy weapons
	if (get_pcvar_num(cvar_buycustom))
		len += formatex(menu[len], charsmax(menu) - len, "\r[\y1\r] \w %L^n", id, "MENU_BUY")
	else
		len += formatex(menu[len], charsmax(menu) - len, "\r[\y1\r] %L^n", id, "MENU_BUY")
	
	// 2. RTV
	len += formatex(menu[len], charsmax(menu) - len, "\r[\y2\r] \w %L^n", id, "ROCK_THE_MAP")
	
	// 3. ResetScore
	len += formatex(menu[len], charsmax(menu) - len, "\r[\y3\r] \w %L^n", id, "RESET_SCORE")
	
	// 4. Unstuck
	if (g_isalive[id])
		len += formatex(menu[len], charsmax(menu) - len, "\r[\y4\r] \w %L^n", id, "MENU_UNSTUCK")
	else
		len += formatex(menu[len], charsmax(menu) - len, "\r[\y4\r] %L^n", id, "MENU_UNSTUCK")
	
	// 5. Join spec
	if (!g_isalive[id] || !get_pcvar_num(cvar_blocksuicide) || (userflags & g_access_flag[ACCESS_ADMIN_MENU]))
		len += formatex(menu[len], charsmax(menu) - len, "\r[\y5\r] \w %L^n^n", id, "MENU_SPECTATOR")
	else
		len += formatex(menu[len], charsmax(menu) - len, "\r[\y5\r] %L^n^n", id, "MENU_SPECTATOR")
	
	// 6. Admin menu
	if (userflags & g_access_flag[ACCESS_ADMIN_MENU])
		len += formatex(menu[len], charsmax(menu) - len, "\r[\y6\r] \w %L", id, "MENU_ADMIN")
	else
		len += formatex(menu[len], charsmax(menu) - len, "\r[\y6\r] %L", id, "MENU_ADMIN")
	
	// 0. Exit
	len += formatex(menu[len], charsmax(menu) - len, "^n^n\r[\y0\r] \w %L", id, "MENU_EXIT")
	
	// Fix for AMXX custom menus
	if (pev_valid(id) == PDATA_SAFE)
		set_pdata_int(id, OFFSET_CSMENUCODE, 0, OFFSET_LINUX)
	
	show_menu(id, KEYSMENU, menu, -1, "Game Menu")
}
Rustics is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 08-20-2018 , 15:55   Re: Menu
Reply With Quote #2

increase the array size of menu[] from 250 to bigger.
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Rustics
New Member
Join Date: Aug 2018
Location: Russia
Old 08-20-2018 , 17:12   Re: Menu
Reply With Quote #3

Quote:
Originally Posted by georgik57 View Post
increase the array size of menu[] from 250 to bigger.
Thank you very much!
Rustics 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 11:36.


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