Resolved Main Menu HELP.

Coding Help/Re-API Supported
Post Reply
User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 514
Joined: 1 Year Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 6 times
Age: 18
Contact:

Main Menu HELP.

#1

Post by Spir0x » 9 Months Ago

Hello all guys please help me when i change map or map changed or player join the server, he can't choose team menu with this main menu code

Code:

Code: Select all

#include <ze_vip>
#include <ze_unstuck>


native ze_open_knife_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 /zemenu", "Cmd_ChooseTeam")
	register_clcmd("say_team /zemenu", "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[\rBraZZerS \y| \rZombie \y| \rEscape\w]^n", id, "MAIN_MENU_TITLE")
         iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w[\rUPDATE\w] \y==> \rWinter Special\y.^n^n", id, "MAIN_MENU_TITLE")
	 
	// 1. Buy Weapons
	if (is_user_alive(id))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w[\r1\w].\y %L^n", id, "MENU_WEAPONBUY")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d[1].\y %L^n", id, "MENU_WEAPONBUY")
	}
	
	// 2. Extra Items
	if (is_user_alive(id))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w[\r2\w].\y %L^n", id, "MENU_EXTRABUY")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d[2].\y %L^n", id, "MENU_EXTRABUY")
	}
         
	// 3. Unstuck
	if (is_user_alive(id))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w[\r3\w].\y Unstuck^n")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d[3].\y Unstuck^n")
	}
	
	// 4. Camera View
	if (is_user_alive(id))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w[\r4\w].\y Camera View^n")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d[4].\y Camera View^n")
	}
	
	// 5. Knife Menu
	if (ze_get_vip_flags(id) & VIP_A)
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w[\r5\w].\y Knife Menu \w[\rVIP\w]^n^n")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d[5].\y Knife Menu \d[\rVIP\d]^n^n")
	}
	
	// 0. Exit
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n^n\w[\r0\w].\y %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
		{
			if (is_user_alive(id))
			{
				client_cmd(id, "say /unstuck")
			}
			else
			{
				ze_colored_print(id, "!tYou can't use !gUnstuck !tyourself while you are dead!y!")
			}
		}
		case 3: // Camera View
		{
			client_cmd(id, "say /cam")
		}
		case 4:
		{
			if (ze_get_vip_flags(id))
				ze_open_knife_menu(id)
			else
				ze_colored_print(id, "!gKnife menu!y, !tallowed only for !gVIPs!y!")
		}
	}
	return PLUGIN_HANDLED
}

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 514
Joined: 1 Year Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 6 times
Age: 18
Contact:

#2

Post by Spir0x » 9 Months Ago

So i removed
return PLUGIN_HANDLED // Kill the Choose Team Command

and why ? becuz when someone press "M" or "?" he see main menu and Choose Team menu both so i wanted to disable it and make this one.

Guys Please help me to make this one in main menu to help player to choose team

1. Buy Weapons
2. Extra Items
3. Unstuck
and now i just wanna make new one to choose team like this
4. Choose Team
So when player press 4 he can join. hope u understand me

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 514
Joined: 1 Year Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 6 times
Age: 18
Contact:

#3

Post by Spir0x » 9 Months Ago

anyone here ? @Raheem , @Jack GamePlay , @sam_bhosale4 @TheWhitesmith

User avatar
TheWhitesmith
Member
Member
Morocco
Posts: 33
Joined: 1 Year Ago
Location: Temara/Rabat
Has thanked: 1 time
Been thanked: 2 times
Age: 18
Contact:

#4

Post by TheWhitesmith » 9 Months Ago

I'm working on one, but by the way, souldn't that TEAM_SPECTATOR be TEAM_UNASSIGNED? Because at first players are not spectators.
[SYA] CSGO-Mod for CS 1.6 [ Cases/Keys/Rank ]
IP: 149.202.251.74:27016

User avatar
TheWhitesmith
Member
Member
Morocco
Posts: 33
Joined: 1 Year Ago
Location: Temara/Rabat
Has thanked: 1 time
Been thanked: 2 times
Age: 18
Contact:

#5

Post by TheWhitesmith » 9 Months Ago

    Try this one, although I'm not sure it is the best way to do so.

    Code: Select all

    #include <ze_vip>
    #include <ze_unstuck>
    
    
    native ze_open_knife_menu(id)
    
    new bool:g_bCanChange[33]
    // 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 /zemenu", "Cmd_ChooseTeam")
    	register_clcmd("say_team /zemenu", "Cmd_ChooseTeam")
    	
    	// Register Menus
    	register_menu("Main Menu", KEYSMENU, "Main_Menu")
    }
    
    public Cmd_ChooseTeam(id)
    {
    	if (get_member(id, m_iTeam) != TEAM_SPECTATOR && get_member(id, m_iTeam) != TEAM_UNASSIGNED && !g_bCanChange[id])
    	{
    		Show_Menu_Main(id)
    		return PLUGIN_HANDLED // Kill the Choose Team Command
    	}
    	g_bCanChange[id] = false
    	
    	// 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[\rBraZZerS \y| \rZombie \y| \rEscape\w]^n", id, "MAIN_MENU_TITLE")
             iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w[\rUPDATE\w] \y==> \rWinter Special\y.^n^n", id, "MAIN_MENU_TITLE")
    	 
    	// 1. Buy Weapons
    	if (is_user_alive(id))
    	{
    		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w[\r1\w].\y %L^n", id, "MENU_WEAPONBUY")
    	}
    	else
    	{
    		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d[1].\y %L^n", id, "MENU_WEAPONBUY")
    	}
    	
    	// 2. Extra Items
    	if (is_user_alive(id))
    	{
    		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w[\r2\w].\y %L^n", id, "MENU_EXTRABUY")
    	}
    	else
    	{
    		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d[2].\y %L^n", id, "MENU_EXTRABUY")
    	}
             
    	// 3. Unstuck
    	if (is_user_alive(id))
    	{
    		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w[\r3\w].\y Unstuck^n")
    	}
    	else
    	{
    		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d[3].\y Unstuck^n")
    	}
    	
    	// 4. Camera View
    	if (is_user_alive(id))
    	{
    		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w[\r4\w].\y Camera View^n")
    	}
    	else
    	{
    		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d[4].\y Camera View^n")
    	}
    	
    	// 5. Knife Menu
    	if (ze_get_vip_flags(id) & VIP_A)
    	{
    		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w[\r5\w].\y Knife Menu \w[\rVIP\w]^n")
    	}
    	else
    	{
    		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d[5].\y Knife Menu \d[\rVIP\d]^n")
    	}
    	
    	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w[\r6\w].\y ChangeTeam^n^n")
    	
    	// 0. Exit
    	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n^n\w[\r0\w].\y %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
    		{
    			if (is_user_alive(id))
    			{
    				client_cmd(id, "say /unstuck")
    			}
    			else
    			{
    				ze_colored_print(id, "!tYou can't use !gUnstuck !tyourself while you are dead!y!")
    			}
    		}
    		case 3: // Camera View
    		{
    			client_cmd(id, "say /cam")
    		}
    		case 4:
    		{
    			if (ze_get_vip_flags(id))
    				ze_open_knife_menu(id)
    			else
    				ze_colored_print(id, "!gKnife menu!y, !tallowed only for !gVIPs!y!")
    		}
    		case 5:
    		{
    			g_bCanChange[id] = true
    			client_cmd(id, "chooseteam")
    		}
    	}
    	return PLUGIN_HANDLED
    }
    [SYA] CSGO-Mod for CS 1.6 [ Cases/Keys/Rank ]
    IP: 149.202.251.74:27016

    User avatar
    Spir0x
    Veteran Member
    Veteran Member
    Tunisia
    Posts: 514
    Joined: 1 Year Ago
    Location: Tunisia
    Has thanked: 14 times
    Been thanked: 6 times
    Age: 18
    Contact:

    #6

    Post by Spir0x » 9 Months Ago

    Thanks so much bro ! now working fine :D

    User avatar
    Spir0x
    Veteran Member
    Veteran Member
    Tunisia
    Posts: 514
    Joined: 1 Year Ago
    Location: Tunisia
    Has thanked: 14 times
    Been thanked: 6 times
    Age: 18
    Contact:

    #7

    Post by Spir0x » 8 Months Ago

    White Bro idk why when i added some things on main menu won't appear exampe i added
    4. sound menu
    5. daily award
    6. random prize
    7. camera view
    8. knife menu
    then i can see only Daily awar and random prize & knife menu won't appear on main menu i think there's a problem in cases or what ?
    and on another servers using this mod have +9 Cases

    Code:

    Code: Select all

    #include <ze_vip>
    #include <ze_unstuck>
    
    
    native ze_open_knife_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 /zemenu", "Cmd_ChooseTeam")
    	register_clcmd("say_team /zemenu", "Cmd_ChooseTeam")
    	
    	// Register Menus
    	register_menu("Main Menu", KEYSMENU, "Main_Menu")
    }
    
    public Cmd_ChooseTeam(id)
    {
    	if (get_member(id, m_iTeam) == TEAM_TERRORIST || get_member(id, m_iTeam) == TEAM_CT)
    	{
    		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, "%L^n^n", id, "MAIN_MENU_TITLE")
    	
    	// 1. Buy Weapons
    	if (is_user_alive(id))
    	{
    		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w[\y1\w]\d. \r%L^n", id, "MENU_WEAPONBUY")
    	}
    	else
    	{
    		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d[1]. %L^n", id, "MENU_WEAPONBUY")
    	}
    	
    	// 2. Extra Items
    	if (is_user_alive(id))
    	{
    		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w[\y2\w]\d. \r%L^n", id, "MENU_EXTRABUY")
    	}
    	else
    	{
    		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d[2]. %L^n", id, "MENU_EXTRABUY")
    	}
        
    	// 3. Unstuck
    	if (is_user_alive(id))
    	{
    		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w[\y3\w]\d. \rUnstuck^n")
    	}
    	else
    	{
    		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d[3]. Unstuck^n")
    	}
    	
    	// 4. Sound Menu
    	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w[\y4\w]\d. \rSound Menu^n")
    	
    	// 5. Daily Award
    	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w[\y5\w]\d. \rDaily Award^n")
    	
    	// 6. Random Prizes
    	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w[\y6\w]\d. \rRandom Prize^n")
    	
    	// 7. Camera View
    	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w[\y7\w]\d. \rCamera View^n")
    	
    	// 8. Knife Menu
    	if (ze_get_vip_flags(id) & VIP_A)
    	{
    		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w[\y8\w]\d. \rKnife Menu \w[\rVIP\w]^n^n")
    	}
    	else
    	{
    		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d[8]. Knife Menu [\rVIP\d]^n^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
    		{
    			if (is_user_alive(id))
    			{
    				client_cmd(id, "say /unstuck")
    			}
    			else
    			{
    				ze_colored_print(id, "%L", id, "DEAD_CANT_UNSTUCK")
    			}
    		}
    		case 3: // Sound Menu
    		{
    			ze_show_sound_menu(id)
    		}
    		case 4: // Daily Award
    		{
    			client_cmd(id, "say /get")
    		}
    		case 5: // Random Prize
    		{
    			client_cmd(id, "say /prize")
    		}
    		case 6: // Camera View
    		{
    			client_cmd(id, "say /cam")
    		}
    		case 7: // Knife Menu
    		{
    			ze_open_knife_menu(id)
    		}
    	}
    	return PLUGIN_HANDLED
    }
    /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
    *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
    */
    

    User avatar
    Raheem
    Mod Developer
    Mod Developer
    Egypt
    Posts: 1627
    Joined: 1 Year Ago
    Location: Egypt
    Has thanked: 27 times
    Been thanked: 64 times
    Age: 20
    Contact:

    #8

    Post by Raheem » 8 Months Ago

    This problem still need solution?
    You don't know? Learn and you will know.

    User avatar
    Spir0x
    Veteran Member
    Veteran Member
    Tunisia
    Posts: 514
    Joined: 1 Year Ago
    Location: Tunisia
    Has thanked: 14 times
    Been thanked: 6 times
    Age: 18
    Contact:

    #9

    Post by Spir0x » 8 Months Ago

    No solved i remove all the braquets [1.] [2]. into 1. 2. Solved.

    Post Reply

    Who is online

    Users browsing this forum: No registered users and 1 guest