help can't put amx main menu

Coding Help/Re-API Supported
Post Reply
User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 258
Joined: 7 years ago
Contact:

Re: help can't put amx main menu

#1

Post by sPe3doN » 1 year ago

Here you go

Code: Select all

#include <zombie_escape>

native ze_open_zombies_menu(id) 

// Keys
const OFFSET_CSMENUCODE = 205
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_8 |MENU_KEY_9 |MENU_KEY_0

public plugin_init()
{
	register_plugin ( "[ZE] Main Menu", ZE_VERSION, AUTHORS )

	// Commands
	register_clcmd("chooseteam", "Cmd_ChooseTeam")
	register_clcmd("say /zem", "Cmd_ChooseTeam")
	register_clcmd("say_team /ze", "Cmd_ChooseTeam")

	// Register Menus
	register_menu ( "Main Menu", KEYSMENU, "Main_Menu")
}

public Cmd_ChooseTeam(id)
{
	Show_Menu_Main(id)
	return PLUGIN_HANDLED // Kill the Choose Team Command
}

// Main Menu 
public Show_Menu_Main(id)
{
	static szMenu[500]
	new iLen

	// Title
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\yZombie Escape By Sniqie^n^n")

	// 1. Buy Weapons
	if (is_user_alive(id))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w1.\r -=||*\yWeapons\r*||=-^n")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w1.\d -=||*Weapons*||=-^n")
	}

	// 2. Extra Items
	if (is_user_alive(id))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w2.\r -=||*\yExtra Items\r*||=-^n")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w2.\d -=||*Extra Items*||=-^n")
	}

	// 3. Choose Zombies
	if (is_user_alive(id))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w3.\r -=||*\yChoose Zombies\r*||=-^n")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w3.\d -=||*Choose Zombies*||=-^n")
	}

	// 4. Unstuck
	if (is_user_alive(id))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w4.\r -=||*\yUnstuck\r*||=-^n")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w4.\d -=||*Unstuck*||=-^n")
	}

	// 5. Knife Menu
	if (is_user_alive(id))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w5.\r -=||*\yKNIFE_MENU\r*||=-^n")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w5.\d -=||*KNIFE_MENU*||=-^n")
	}

	// 6. Vip Menu
	if ((get_user_flags(id) & ADMIN_LEVEL_A))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w6.\r -=||*\yVIP_MENU\r*||=-^n")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w6.\d -=||*VIP_MENU*||=-^n")
	}

	// 7. Team Menu
	if ((get_user_flags(id) & ADMIN_LEVEL_A))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w7.\r -=||*\yTEAM_MENU\r*||=-^n")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w7.\d -=||*TEAM_MENU*||=-^n")
	}

	// 8. Admin Menu 
	if ((get_user_flags(id) & ADMIN_LEVEL_A))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w8.\r -=||*\yADMIN_MENU\r*||=-^n")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w8.\d -=||*ADMIN_MENU*||=-^n")
	}

	// 9. Admin Manager
	if ((get_user_flags(id) & ADMIN_LEVEL_A))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w9.\r -=||*\yADMIN_MANAGER\r*||=-^n")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w9.\d -=||*ADMIN_MANAGER*||=-^n")
	}

	// 0. Exit
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n^n\w0.\r %L", id, "EXIT")

 
	// Fix for AMXX custom menus
	set_pdata_int(id, OFFSET_CSMENUCODE, 0)
	show_menu(id, KEYSMENU, szMenu, -1, "Main Menu")
}

// Main Menu
public Main_Menu(id, key)
{
	// Player disconnected?
	if (!is_user_connected(id))
	return PLUGIN_HANDLED

	switch (key)
	{
		case 0: // Buy Weapons
		{
			client_cmd(id, "guns")
		}	
		case 1: // Extra Items
		{
            		if (is_user_alive(id))
            		{
				ze_show_items_menu(id)
			}
			else
			{
				ze_colored_print(id, "%L", id, "DEAD_CANT_BUY_WEAPON")
			}
		}
		case 2: // Choose Zombies
		{ 
            		if (is_user_alive(id))
            		{
				ze_open_zombies_menu(id)
			}
			else
			{
				ze_colored_print(id, "%L", id, "DEAD_CANT_CHOOSE_ZOMBIES")
			}
		}
		case 3: // Unstuck
		{
			client_cmd(id, "say /unstuck")
		}
		case 4: // Knife Menu
		{
			client_cmd(id, "say /Knife")
		}
		case 5: // Vip Menu
		{
			client_cmd(id, "say /vm")
		}
		case 6: // Team Menu
		{
			client_cmd(id, "say /teammenu")
		}
		case 7: // Admin Menu
		{
			client_cmd(id, "say /admin")
		}
		case 8: // Admin Manager
		{
			client_cmd(id, "say /Manager")
		}
	}
    	return PLUGIN_HANDLED
}
Image

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 258
Joined: 7 years ago
Contact:

#2

Post by sPe3doN » 1 year ago

Sniqie wrote: 1 year ago now I have a problem too


what are my problems?

Error: Undefined symbol "MENU_KEY_1" on line 7
Error: Must be a constant expression; assumed zero on line 7
Error: Undefined symbol "register_plugin" on line 11
Error: Undefined symbol "AUTHORS" on line 11
Error: Number of arguments does not match definition on line 11
Error: Too many error messages on one line on line 11

.
use last version of Zombie Escape Compiler https://www.escapers-zone.net/viewtopic.php?f=6&t=221
Image

User avatar
z0h1r-LK
Mod Developer
Mod Developer
Morocco
Posts: 473
Joined: 5 years ago
Location: The Red City ❤
Contact:

#3

Post by z0h1r-LK » 1 year ago

Includes not found

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 4 guests