#include <amxmodx>
#include <cstrike>
#define MENUITEM_DISABLED (1<<26)
public plugin_init()
{
register_plugin("Gasior Menu", "1.0", "Gasior");
register_clcmd("say /menu", "Menu");
register_clcmd("say_team /menu", "Menu");
}
//lets make the function that will make the menu
public Menu( id )
{
//first we need to make a variable that will hold the menu
new menu = menu_create( "\rWybierz jedna z dostepnych opcji:", "menu_handler" );
//Note - menu_create
//The first parameter is what the menu will be titled ( what is at the very top )
//The second parameter is the function that will deal/handle with the menu ( which key was pressed, and what to do )
//Now lets add some things to select from the menu
menu_additem( menu, "\yZakup VIPa!", "", 0 );
menu_additem( menu, "\yCo Oferuje VIP?", "", 0 );
menu_additem( menu, "\rZloz Podanie na Admina!", "", 0 );
menu_additem( menu, "\wCzym jest Bywalec?", "", 0 );
menu_additem( menu, "\wKlasyfikacja Ogolna", "", 0);
menu_additem( menu, "\wMapy", "", 0);
menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
//Note - menu_setprop
//The first parameter is the menu to modify
//The second parameter is what to modify ( found in amxconst.inc )
//The third parameter is what to modify it to ( in this case, we are adding a option to the menu that will exit the menu. setting it to MEXIT_NEVER will disable this option )
//Additional note - MEXIT_ALL is the default property for MPROP_EXIT, so this is redundant
//Lets display the menu
menu_display( id, menu, 0 );
//Note - menu_display
//The first parameter is which index to show it to ( you cannot show this to everyone at once )
//The second parameter is which menu to show them ( in this case, the one we just made )
//The third parameter is which page to start them on
}
//okay, we showed them the menu, now lets handle it ( looking back at menu_create, we are going to use that function )
public menu_handler( id, menu, item )
{
//Because of the simplicity of this menu, we can switch for which item was pressed
//Note - this is zero-based, so the first item is 0
switch( item )
{
case 0:
{
show_motd(id, "sklepsms.txt", "Kupno Vipa");
}
case 1:
{
show_motd(id, "vip.txt", "Co Oferuje VIP?");
}
case 2:
{
show_motd(id, "podanie.txt", "Zloz Podanie");
}
case 3:
{
show_motd(id, "bywalec.txt", "Czym jest Bywalec?");
}
case 4:
{
//client_print(id, print_center, "/mapy");
show_motd(id, "klasyfikacja.txt", "Klasyfikacja");
}
case 5:
{
if(callfunc_begin("nomination_menu", "galileo.amxx"))
{
callfunc_push_int(id);
callfunc_end();
}
}
}
menu_destroy( menu );
return PLUGIN_HANDLED;
}
Wygląda to teraz tak, tylko dalej nie reaguje.
Coś źle zrobiłem?