Resolved Ze_main_menu

Coding Help/Re-API Supported
Post Reply
User avatar
Prekrasnoe Daleko
Member
Member
Russia
Posts: 32
Joined: 1 Year Ago
Location: Россия,Крым
Has thanked: 11 times
Been thanked: 1 time
Age: 20
Contact:

Ze_main_menu

#1

Post by Prekrasnoe Daleko » 1 Year 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
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 560
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 46 times
Age: 19
Contact:

#2

Post by Jack GamePlay » 1 Year 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
}
These users thanked the author Jack GamePlay for the post:
Prekrasnoe Daleko (1 Year Ago)
Not interested in CS/Pawn anymore.
Accepting web projects.

User avatar
Prekrasnoe Daleko
Member
Member
Russia
Posts: 32
Joined: 1 Year Ago
Location: Россия,Крым
Has thanked: 11 times
Been thanked: 1 time
Age: 20
Contact:

#3

Post by Prekrasnoe Daleko » 1 Year Ago

thanks all work, closed post

User avatar
Prekrasnoe Daleko
Member
Member
Russia
Posts: 32
Joined: 1 Year Ago
Location: Россия,Крым
Has thanked: 11 times
Been thanked: 1 time
Age: 20
Contact:

#4

Post by Prekrasnoe Daleko » 11 Months 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
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 560
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 46 times
Age: 19
Contact:

#5

Post by Jack GamePlay » 11 Months 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
}
Not interested in CS/Pawn anymore.
Accepting web projects.

User avatar
Prekrasnoe Daleko
Member
Member
Russia
Posts: 32
Joined: 1 Year Ago
Location: Россия,Крым
Has thanked: 11 times
Been thanked: 1 time
Age: 20
Contact:

#6

Post by Prekrasnoe Daleko » 11 Months Ago

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

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests