#include <amxmodx>
	 
new cvar_showhudmsg

public plugin_init() 
{
	register_plugin("putinserver menu", "0.1", "X-factor")
	register_clcmd("amx_menu", "function_menu", ADMIN_ALL,"")
	register_clcmd("say /menu", "function_menu")
	register_clcmd("say_team /menu", "function_menu")
	register_clcmd("menu", "function_menu")

	cvar_showhudmsg = register_cvar("show_hudmsg", "1");		//1 - on		0 - off
}

public client_putinserver(id)
{
	if(get_pcvar_num(cvar_showhudmsg))
		set_task(1.0, "task_hudmsg", id, _, _, "b")
}

public task_hudmsg(id)
{
	set_hudmessage(0, 255, 0, 0.75, 0.0, 0, 6.0, 12.0)
	
}

public function_menu(id) 
{
	new menu = menu_create("\rМеню сервера", "menu_handler")
         menu_additem(menu, "\yНадеть шапку","1")
	menu_additem(menu, "\yЛиния за собой","2")
        menu_additem(menu, "\yАдминистраторы","3")
        menu_additem(menu, "\yHNS магазин","4")
	menu_additem(menu, "\yСтатистика","5")
        menu_additem(menu, "\yLj статиктика","6")
	menu_setprop(menu, MPROP_EXITNAME, "Выход")
	menu_setprop(menu, MPROP_EXIT,MEXIT_ALL)
	     
	menu_display(id,menu,0)
	return PLUGIN_HANDLED
register_clcmd("menu","go_menu");
}

public client_authorized(id)
{
client_cmd(id, "bind ^"F3^" ^"menu^"")
}
	 
public menu_handler(id, menu, item) 
{
	if(item == MENU_EXIT) 
	{
		menu_destroy(menu)
	        return PLUGIN_HANDLED
	}
	     
	new data[6], iName[64], access, callback
	menu_item_getinfo(menu, item, access, data, 5, iName, 63, callback)
	     
	new key = str_to_num(data)
	     
	switch(key) 
	{
		case 1:{
			if(is_user_alive(id))
				client_cmd(id, "say /hats")
	        }
	        case 2:{
			if(is_user_alive(id))
	            		client_cmd(id, "say trail")
	        }
	        case 3:{
	            	client_cmd(id, "say /admin")
	        }
	        case 4:{
	            	client_cmd(id, "say /shop")
	        }
	        case 5:{
	            	client_cmd(id, "say /top15")
	        }
	        case 6:{
	            	client_cmd(id, "say /ljtop")
	        }
	       
	}
	return PLUGIN_HANDLED
}