Thread: menu
View Single Post
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