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(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;
}