Solved Ze_main_menu

Coding Help/Re-API Supported
Post Reply
Prekrasnoe Daleko
Member
Member
Russia
Posts: 32
Joined: 6 years ago
Location: Россия,Крым
Contact:

Ze_main_menu

#1

Post by Prekrasnoe Daleko » 6 years ago

Hello , help me give to ze main menu
to coomand
"mute"
"unstuck"
"hats"
"stopsound"
I tried, but here's what I did. dont work

Code: Select all

#include <zombie_escape>
#include <ze_knife_menu>

// 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 /ze", "Cmd_ChooseTeam")
	register_clcmd("say_team /ze", "Cmd_ChooseTeam")
	
	// Register Menus
	register_menu("Main Menu", KEYSMENU, "Main_Menu")
}

public Cmd_ChooseTeam(id)
{
	if (get_member(id, m_iTeam) != TEAM_SPECTATOR)
	{
		Show_Menu_Main(id)
		return PLUGIN_HANDLED // Kill the Choose Team Command
	}
	
	// Player in Spec? Allow him to open choose team menu so he can join
	return PLUGIN_CONTINUE
}

// Main Menu
public Show_Menu_Main(id)
{
	static szMenu[250]
	new iLen
    
	// Title
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w%L^n^n", id, "MAIN_MENU_TITLE")
	
	// 1. Buy Weapons
	if (is_user_alive(id))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w1.\r %L^n", id, "MENU_WEAPONBUY")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d1. %L^n", id, "MENU_WEAPONBUY")
	}
	
	// 2. Extra Items
	if (is_user_alive(id))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w2.\r %L^n", id, "MENU_EXTRABUY")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d2. %L^n", id, "MENU_EXTRABUY")
	}
	
	// 3. Knife Menu
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w3.\r Knife Menu^n")
	
        // 4. Knife Menu
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w3.\r mute^n")

	// 3. Knife Menu
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w3.\r unstuck^n")

	// 3. Knife Menu
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w3.\r hats^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:
		{
			ze_open_knife_menu(id)
		}
	}
	return PLUGIN_HANDLED
}

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#2

Post by Night Fury » 6 years ago

Try:

Code: Select all

#include <zombie_escape>
#include <ze_knife_menu>

// 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 /ze", "Cmd_ChooseTeam")
	register_clcmd("say_team /ze", "Cmd_ChooseTeam")
	
	// Register Menus
	register_menu("Main Menu", KEYSMENU, "Main_Menu")
}

public Cmd_ChooseTeam(id)
{
	if (get_member(id, m_iTeam) != TEAM_SPECTATOR)
	{
		Show_Menu_Main(id)
		return PLUGIN_HANDLED // Kill the Choose Team Command
	}
	
	// Player in Spec? Allow him to open choose team menu so he can join
	return PLUGIN_CONTINUE
}

// Main Menu
public Show_Menu_Main(id)
{
	static szMenu[250]
	new iLen
    
	// Title
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w%L^n^n", id, "MAIN_MENU_TITLE")
	
	// 1. Buy Weapons
	if (is_user_alive(id))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w1.\r %L^n", id, "MENU_WEAPONBUY")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d1. %L^n", id, "MENU_WEAPONBUY")
	}
	
	// 2. Extra Items
	if (is_user_alive(id))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w2.\r %L^n", id, "MENU_EXTRABUY")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d2. %L^n", id, "MENU_EXTRABUY")
	}
	
	// 3. Knife Menu
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w3.\r Knife Menu^n")
	
    // 4. Mute
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w4.\r mute^n")

	// 5. Unstuck
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w5.\r unstuck^n")

	// 6. Hats
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w6.\r hats^n")

	// 7. Stop sound
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w7.\r Stop Sound^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:
		{
			ze_open_knife_menu(id)
		}
		case 3: // Mute
		{
			// Your code
		}
		case 4: // Unstuck
		{
			// Your code
		}
		case 5: // Hats
		{
			// Your code
		}
		case 6: // Stop sound
		{
			// Your code
		}
	}
	return PLUGIN_HANDLED
}
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

Prekrasnoe Daleko
Member
Member
Russia
Posts: 32
Joined: 6 years ago
Location: Россия,Крым
Contact:

#3

Post by Prekrasnoe Daleko » 6 years ago

thanks all work, closed post

Prekrasnoe Daleko
Member
Member
Russia
Posts: 32
Joined: 6 years ago
Location: Россия,Крым
Contact:

#4

Post by Prekrasnoe Daleko » 5 years ago

https://cloud.mail.ru/public/CkC6/waFs2WaS9 - screen copmile time
Hello all guys please help me when
not compile plugins give me error

Code: Select all

#include <zombie_escape>

// 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("[RFF] Главное Меню", ZE_VERSION, AUTHORS)
	
	// Commands
	register_clcmd("chooseteam", "Cmd_ChooseTeam")
	register_clcmd("say /ze", "Cmd_ChooseTeam")
	register_clcmd("say_team /ze", "Cmd_ChooseTeam")
	
	// Register Menus
	register_menu("Main Menu", KEYSMENU, "Main_Menu")
}

public Cmd_ChooseTeam(id)
{
	if (get_member(id, m_iTeam) != TEAM_SPECTATOR)
	{
		Show_Menu_Main(id)
		return PLUGIN_HANDLED // Kill the Choose Team Command
	}
	
	// Player in Spec? Allow him to open choose team menu so he can join
	return PLUGIN_CONTINUE
}

// Main Menu
public Show_Menu_Main(id)
{
	static szMenu[250]
	new iLen
    
	// Title
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w%L^n^n", id, "MAIN_MENU_TITLE")
	
	// 1. Buy Weapons
	if (is_user_alive(id))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w1.\r %L^n", id, "MENU_WEAPONBUY")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d1. %L^n", id, "MENU_WEAPONBUY")
	}
	
	// 2. Extra Items
	if (is_user_alive(id))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w2.\r %L^n", id, "MENU_EXTRABUY")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d2. %L^n", id, "MENU_EXTRABUY")
	}
	
	// 3. Unstuck
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w3.\rЗастряли?^n")
	
    // 4. Mute
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w4.\rМут^n")

	// 5. Nominate
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w5.\rMaps^n")

	// 6. StopSound
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w6.\rВыкл-Музыку^n")

	// 7. Hats
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w7.\r Шапки^n")
	
	// 8. Hs
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w8.\r Рулетка^n")
	
	// 8. Hats
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w9.\r WeaponSkin^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: //unstuck
		{
			client_cmd(id, "say /unstuck"
		}
		case 3: // Mute
		{
			client_cmd(id, "say /mute"
		}
		case 4: // maps
		{
			client_cmd(id, "say /maps"
		}
		case 5: // stopsound
		{
			client_cmd(id, "stopsound"
		}
		case 6: // hats
		{
			client_cmd(id, "say /hats"
		}
		case 7: // award
		{
			client_cmd(id, "say /prize"
		}
		case 8: // Ws
		{
			client_cmd(id, "say /skins"
		}
	}
	return PLUGIN_HANDLED
}

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#5

Post by Night Fury » 5 years ago

Try:

Code: Select all

#include <zombie_escape>

// 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("[RFF] Главное Меню", ZE_VERSION, AUTHORS)
	
	// Commands
	register_clcmd("chooseteam", "Cmd_ChooseTeam")
	register_clcmd("say /ze", "Cmd_ChooseTeam")
	register_clcmd("say_team /ze", "Cmd_ChooseTeam")
	
	// Register Menus
	register_menu("Main Menu", KEYSMENU, "Main_Menu")
}

public Cmd_ChooseTeam(id)
{
	if (get_member(id, m_iTeam) != TEAM_SPECTATOR)
	{
		Show_Menu_Main(id)
		return PLUGIN_HANDLED // Kill the Choose Team Command
	}
	
	// Player in Spec? Allow him to open choose team menu so he can join
	return PLUGIN_CONTINUE
}

// Main Menu
public Show_Menu_Main(id)
{
	static szMenu[250]
	new iLen
    
	// Title
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w%L^n^n", id, "MAIN_MENU_TITLE")
	
	// 1. Buy Weapons
	if (is_user_alive(id))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w1.\r %L^n", id, "MENU_WEAPONBUY")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d1. %L^n", id, "MENU_WEAPONBUY")
	}
	
	// 2. Extra Items
	if (is_user_alive(id))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w2.\r %L^n", id, "MENU_EXTRABUY")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d2. %L^n", id, "MENU_EXTRABUY")
	}
	
	// 3. Unstuck
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w3.\rЗастряли?^n")
	
    // 4. Mute
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w4.\rМут^n")

	// 5. Nominate
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w5.\rMaps^n")

	// 6. StopSound
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w6.\rВыкл-Музыку^n")

	// 7. Hats
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w7.\r Шапки^n")
	
	// 8. Hs
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w8.\r Рулетка^n")
	
	// 8. Hats
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w9.\r WeaponSkin^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: //unstuck
		{
			client_cmd(id, "say /unstuck")
		}
		case 3: // Mute
		{
			client_cmd(id, "say /mute")
		}
		case 4: // maps
		{
			client_cmd(id, "say /maps")
		}
		case 5: // stopsound
		{
			client_cmd(id, "stopsound")
		}
		case 6: // hats
		{
			client_cmd(id, "say /hats")
		}
		case 7: // award
		{
			client_cmd(id, "say /prize")
		}
		case 8: // Ws
		{
			client_cmd(id, "say /skins")
		}
	}
	return PLUGIN_HANDLED
}
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

Prekrasnoe Daleko
Member
Member
Russia
Posts: 32
Joined: 6 years ago
Location: Россия,Крым
Contact:

#6

Post by Prekrasnoe Daleko » 5 years ago

Jack, very thanks i'am solved this problem. thanks

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: Bing [Bot] and 11 guests