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

menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EminenT
Junior Member
Join Date: Aug 2017
Old 02-24-2019 , 10:07   menu
Reply With Quote #1

#include <amxmodx>
#include <fakemeta>

// CS Teams
enum
{
FM_CS_TEAM_UNASSIGNED = 0,
FM_CS_TEAM_T,
FM_CS_TEAM_CT,
FM_CS_TEAM_SPECTATOR
}
new const CS_TEAM_NAMES[][] = { "UNASSIGNED", "TERRORIST", "CT", "SPECTATOR" }

native fm_cs_get_user_team(id)

public plugin_init()
{
register_clcmd("say menu", "show_menu_game")
register_clcmd("say /menu", "show_menu_game")
register_clcmd("chooseteam", "clcmd_changeteam")
register_clcmd("jointeam", "clcmd_changeteam")
}

public show_menu_game(id)
{
show_menu_game(id) // show game menu
}

public show_menu_game(id)
{
new menu = menu_create("Game Menu", "show_menu_game");

menu_additem(menu, "1. Menu TAG", "", 0); // case 0
menu_additem(menu, "2. MENU TAG", "", 0); // case 1
menu_additem(menu, "3. MENU TAG", "", 0); // case 2
menu_additem(menu, "4. MENU TAG", "", 0); // case 3
menu_additem(menu, "", "", 0); // case 4
menu_additem(menu, "", "", 0); // case 5
menu_additem(menu, "9. MENU TAG", "", 0); // case 6

menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);

menu_display(id, menu, 0);

return PLUGIN_HANDLED;
}

public mh_game_menu(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_cancel(id);
return PLUGIN_HANDLED;
}

new command[6], name[64], access, callback;

menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);

switch(item)
{
case 0: client_print(id, print_chat, "You have selected Menu TAG");
case 1: client_print(id, print_chat, "You have selected MENU TAG");
case 2: client_print(id, print_chat, "You have selected MENU TAG");
case 3: client_print(id, print_chat, "You have selected MENU TAG");
case 6: client_print(id, print_chat, "You have no Access to That Command");
}

menu_destroy( menu );
return PLUGIN_HANDLED;
}

// Block Team Change
public clcmd_changeteam(id)
{
static team
team = fm_cs_get_user_team(id)

// Unless it's a spectator joining the game
if (team == FM_CS_TEAM_SPECTATOR || team == FM_CS_TEAM_UNASSIGNED)
return PLUGIN_CONTINUE;

// Pressing 'M' (chooseteam) ingame should show the main menu instead
show_menu_game(id)
return PLUGIN_HANDLED;
}




why i cant compile i want to make menu when i press M to show menu not swich team
can anyone help me please ??
EminenT is offline
SHIELD755
Veteran Member
Join Date: Feb 2018
Location: FROM MARVEL STUDIO
Old 02-24-2019 , 11:05   Re: menu
Reply With Quote #2

1. paste the code PHP TAG
2. if you wanted to show menu when pressing M than :
PHP Code:
  include <amxmodx>
#include <fakemeta>

// CS Teams
enum
{
FM_CS_TEAM_UNASSIGNED 0,
FM_CS_TEAM_T,
FM_CS_TEAM_CT,
FM_CS_TEAM_SPECTATOR
}
new const 
CS_TEAM_NAMES[][] = { "UNASSIGNED""TERRORIST""CT""SPECTATOR" }

native fm_cs_get_user_team(id)

public 
plugin_init()
{
register_clcmd("chooseteam" "show_menu_game")

register_clcmd("say menu""show_menu_game")

}

public 
show_menu_game(id)
{
show_menu_game(id// show game menu
}

public 
show_menu_game(id)
{
new 
menu menu_create("Game Menu""show_menu_game");

menu_additem(menu"1. Menu TAG"""0); // case 0
menu_additem(menu"2. MENU TAG"""0); // case 1
menu_additem(menu"3. MENU TAG"""0); // case 2
menu_additem(menu"4. MENU TAG"""0); // case 3
menu_additem(menu""""0); // case 4
menu_additem(menu""""0); // case 5
menu_additem(menu"9. MENU TAG"""0); // case 6

menu_setprop(menuMPROP_EXITMEXIT_ALL);

menu_display(idmenu0);

return 
PLUGIN_HANDLED;
}

public 
mh_game_menu(idmenuitem)
{
if(
item == MENU_EXIT)
{
menu_cancel(id);
return 
PLUGIN_HANDLED;
}

new 
command[6], name[64], accesscallback;

menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);

switch(
item)
{
case 
0client_print(idprint_chat"You have selected Menu TAG");
case 
1client_print(idprint_chat"You have selected MENU TAG");
case 
2client_print(idprint_chat"You have selected MENU TAG");
case 
3client_print(idprint_chat"You have selected MENU TAG");
case 
6client_print(idprint_chat"You have no Access to That Command");
}

menu_destroymenu );
return 
PLUGIN_HANDLED;
}

// Block Team Change
public clcmd_changeteam(id)
{
static 
team
team 
fm_cs_get_user_team(id)

// Unless it's a spectator joining the game
if (team == FM_CS_TEAM_SPECTATOR || team == FM_CS_TEAM_UNASSIGNED)
return 
PLUGIN_CONTINUE;

// Pressing 'M' (chooseteam) ingame should show the main menu instead
show_menu_game(id)
return 
PLUGIN_HANDLED;


Last edited by SHIELD755; 02-24-2019 at 11:07.
SHIELD755 is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 02-24-2019 , 11:35   Re: menu
Reply With Quote #3

Delete this:
PHP Code:
public show_menu_game(id)
{
show_menu_game(id// show game menu

__________________
<VeCo> is offline
EminenT
Junior Member
Join Date: Aug 2017
Old 02-24-2019 , 12:26   Re: menu
Reply With Quote #4

still dont work again it showing chose team
idk how to stop it lol
EminenT is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-24-2019 , 13:02   Re: menu
Reply With Quote #5

Beautiful title and an even more beautiful code placement.
Add a descriptive title to your thread and put the code in [php] or [code] tags in order to make it readable. Then if you can't compile, post what errors you're getting, since we can't read your mind.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
EminenT
Junior Member
Join Date: Aug 2017
Old 02-24-2019 , 16:59   Re: menu
Reply With Quote #6

Quote:
Originally Posted by OciXCrom View Post
Beautiful title and an even more beautiful code placement.
Add a descriptive title to your thread and put the code in [php] or [code] tags in order to make it readable. Then if you can't compile, post what errors you're getting, since we can't read your mind.
lol sorry bro im new here
if you didnt understand what i ask

i want when i press M to open menu not chose team like zombie plague mod
EminenT is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-24-2019 , 20:14   Re: menu
Reply With Quote #7

Did you understand/read what I said? Being new doesn't mean you can't read.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
PartialCloning
Senior Member
Join Date: Dec 2015
Old 02-24-2019 , 23:54   Re: menu
Reply With Quote #8

PHP Code:
#include <amxmodx>
#include <cstrike>

public plugin_init()
{
    
register_clcmd("say menu""show_menu_game");
    
register_clcmd("say /menu""show_menu_game");
    
register_clcmd("chooseteam""clcmd_changeteam");
    
register_clcmd("jointeam""clcmd_changeteam");
}

public 
show_menu_game(id)
{
    new 
menu menu_create("Game Menu""mh_game_menu");

    
menu_additem(menu"1. Menu TAG"""0); // case 0
    
menu_additem(menu"2. MENU TAG"""0); // case 1
    
menu_additem(menu"3. MENU TAG"""0); // case 2
    
menu_additem(menu"4. MENU TAG"""0); // case 3
    
menu_additem(menu""""0); // case 4
    
menu_additem(menu""""0); // case 5
    
menu_additem(menu"9. MENU TAG"""0); // case 6

    
menu_setprop(menuMPROP_EXITMEXIT_ALL);

    
menu_display(idmenu0);

    return 
PLUGIN_HANDLED;
}

public 
mh_game_menu(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    switch(
item)
    {
        case 
0client_print(idprint_chat"You have selected Menu TAG");
        case 
1client_print(idprint_chat"You have selected MENU TAG");
        case 
2client_print(idprint_chat"You have selected MENU TAG");
        case 
3client_print(idprint_chat"You have selected MENU TAG");
        case 
6client_print(idprint_chat"You have no Access to That Command");
    }

    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

// Block Team Change
public clcmd_changeteam(id)
{
    new 
CsTeams:team cs_get_user_team(id)

    
// Unless it's a spectator joining the game
    
if(team == CS_TEAM_SPECTATOR || team == CS_TEAM_UNASSIGNED)
        return 
PLUGIN_CONTINUE;

    
// Pressing 'M' (chooseteam) ingame should show the main menu instead
    
show_menu_game(id);
    return 
PLUGIN_HANDLED;

PartialCloning is offline
EminenT
Junior Member
Join Date: Aug 2017
Old 02-25-2019 , 13:23   Re: menu
Reply With Quote #9

Quote:
Originally Posted by OciXCrom View Post
Did you understand/read what I said? Being new doesn't mean you can't read.
you colud help me not tell me how to post here. ;)
EminenT is offline
EminenT
Junior Member
Join Date: Aug 2017
Old 02-25-2019 , 13:24   Re: menu
Reply With Quote #10

Quote:
Originally Posted by PartialCloning View Post
PHP Code:
#include <amxmodx>
#include <cstrike>

public plugin_init()
{
    
register_clcmd("say menu""show_menu_game");
    
register_clcmd("say /menu""show_menu_game");
    
register_clcmd("chooseteam""clcmd_changeteam");
    
register_clcmd("jointeam""clcmd_changeteam");
}

public 
show_menu_game(id)
{
    new 
menu menu_create("Game Menu""mh_game_menu");

    
menu_additem(menu"1. Menu TAG"""0); // case 0
    
menu_additem(menu"2. MENU TAG"""0); // case 1
    
menu_additem(menu"3. MENU TAG"""0); // case 2
    
menu_additem(menu"4. MENU TAG"""0); // case 3
    
menu_additem(menu""""0); // case 4
    
menu_additem(menu""""0); // case 5
    
menu_additem(menu"9. MENU TAG"""0); // case 6

    
menu_setprop(menuMPROP_EXITMEXIT_ALL);

    
menu_display(idmenu0);

    return 
PLUGIN_HANDLED;
}

public 
mh_game_menu(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    switch(
item)
    {
        case 
0client_print(idprint_chat"You have selected Menu TAG");
        case 
1client_print(idprint_chat"You have selected MENU TAG");
        case 
2client_print(idprint_chat"You have selected MENU TAG");
        case 
3client_print(idprint_chat"You have selected MENU TAG");
        case 
6client_print(idprint_chat"You have no Access to That Command");
    }

    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

// Block Team Change
public clcmd_changeteam(id)
{
    new 
CsTeams:team cs_get_user_team(id)

    
// Unless it's a spectator joining the game
    
if(team == CS_TEAM_SPECTATOR || team == CS_TEAM_UNASSIGNED)
        return 
PLUGIN_CONTINUE;

    
// Pressing 'M' (chooseteam) ingame should show the main menu instead
    
show_menu_game(id);
    return 
PLUGIN_HANDLED;

bro thanks so much for the help <3 you have my respect
EminenT is offline
Reply


Thread Tools
Display Modes

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 21:53.


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