Post by LegendofWarior on Dec 14, 2015 11:16:29 GMT
I Learn New Trick from ZP Code, Tested 100%, Press "M" = Show a Menu
Now Follow Me, add After public plugin_init(id)
This Code
An Exemple:
NOTE : You need FakeMeta
Now Follow Me, add After public plugin_init(id)
This Code
register_clcmd("chooseteam", "clcmd_changeteam")
register_clcmd("jointeam", "clcmd_changeteam")
After That add this code (not in public plugin_init)// Block Team Change
public clcmd_changeteam(id)
{
static team
// 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_your_game_menu(id)
return PLUGIN_HANDLED;
}
An Exemple:
#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" }
public plugin_init()
{
register_plugin("Game Menu", "1.0", "LegendofWarior");
register_clcmd("say /menu", "Show_Game_Menu", _, "-");
register_clcmd("chooseteam", "clcmd_changeteam")
register_clcmd("jointeam", "clcmd_changeteam")
}
public Show_Game_Menu(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(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
// 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_Game_Menu(id)
return PLUGIN_HANDLED;
}
NOTE : You need FakeMeta