#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun> 

#define PLUGIN "zasady"
#define VERSION "1.0"
#define AUTHOR "Ace"



   public plugin_init ()
{
   	register_plugin(PLUGIN, VERSION, AUTHOR);
	register_clcmd("say /menu", "xmenu");
	
}


public xmenu(id) 
{
		new menu = menu_create("\rMenu:", "wybieranie");
		menu_additem(menu, "\wKup Slota", "1", 0);
		menu_additem(menu, "\wKup Admina", "2", 0);
		menu_additem(menu, "\wKup EXP", "3", 0);
		
		menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
		
		menu_display(id, menu, 0);
}

public wybieranie(id, menu, item)
{
		if (item == MENU_EXIT)
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	
	
	new data[6], iName[64];
	new zaccess, callback;
	menu_item_getinfo(menu, item, zaccess, data,5, iName, 64, callback);
	new key = str_to_num(data)
	
	switch(key)
{
	case 1:
	{
		show_motd(id, "slot.txt", "Kup Slota")
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	
	case 2:
	{
		show_motd(id, "admin.txt", "Kup Admina")
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	
	case 3:
	{
		show_motd(id, "exp.txt", "Kup EXP")
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
      }
      menu_destroy(menu);
      return PLUGIN_HANDLED;
}
