Hi! I have created my own menu, connected to war3menu. It is kind of guide. Part of it works, but the rest doesn't and I don't have any idea why. I think I did everything correctly...
Here are menus.inl parts. 1. War3menu:
Код
public MENU_War3Menu( id ) { static pos, szMenu[256], keys; keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<9); pos = 0;
// Add the title pos += formatex( szMenu[pos], 255-pos, "%L^n^n", id, "MENU_WAR3MENU" );
// Display the menu show_menu( id, keys, szMenu, -1 );
return; }
public _MENU_War3Menu( id, key ) {
if ( !WC3_Check() ) { return PLUGIN_HANDLED; }
switch ( key ) { case 0: menu_Skill_Options( id ); case 1: menu_Race_Options( id ); case 2: menu_Item_Options( id ); case 3: MOTD_War3help( id ); case 4: menu_Admin_Options( id ); case 5: menu_Poradnik( id ); case 6: MOTD_Info_Vip( id ); }
return PLUGIN_HANDLED; }
2. And my code:
Код
public menu_Poradnik( id ) {
new pos = 0, i, menu_body[512], menuitems[4][32] new keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<8)|(1<<9)
public _menu_Poradnik( id, key ) { if ( !WC3_Check() ) { return PLUGIN_HANDLED; }
switch ( key ) { case 0: MOTD_Ogolny_Opis( id ); case 1: MOTD_Przydatne_Komendy( id ); case 2: menu_Opis_Ras( id ); case 3: menu_Opis_Ras2( id ); case 8: MENU_War3Menu(id) }
return PLUGIN_HANDLED; }
public menu_Opis_Ras( id ) {
new pos = 0, i, menu_body[512], menuitems[4][32] new keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<8)|(1<<9)
switch (key) { case 0: MOTD_Krwawy( id ); case 1: MOTD_Lowca( id ); case 2: MOTD_Wartownik( id ); case 3: MOTD_Krypt( id ); case 4: MOTD_Kameleon ( id ); case 8: MENU_War3Menu(id);
"Poradnik" means guide (путеводитель), "ogolny opis" means general description, "przydatne komendy" means useful commands and "opis ras" means description of races. The problem looks like that: Poradnik menu (first public) displays correct. It looks as follows:
Код
1. General description 2. Useful commands 3. Description of races 4. Descritpion of races (2)
When i click any number from this menu, nothing happens - MOTD windows don't display. menu_Opis_Ras and menu_Opis_Ras2 don't appear too. Of course, I have uploaded every .txt file to "addons/amxmodx/configs/war3ft" and I have added new words to War3FT.txt file. Everything is done fine. Have I done something wrong? Is there any error in this code? Any help would be appreciated.
Thanks! But I still have a problem. I added this to language.inl:
Код
#define TOTAL_MENUS 17
// This is the list of menu titles that are in war3ft.txt new const MENU_NAMES[TOTAL_MENUS][] = { "MENU_BUY_ITEM", "MENU_BUY_ITEM2", "MENU_BUY_ITEM3", "MENU_SELECT_SKILL", "MENU_SELECT_RACE", "MENU_WAR3MENU", "MENU_SKILLS_OPTIONS", "MENU_ITEM_OPTIONS", "MENU_RACE_OPTIONS", "MENU_ADMIN_MENU", "MENU_GIVE_PLAYERS_XP", "MENU_TEAM_XP", "MENU_RESET_XP", "MENU_REPLACE_ITEM", "MENU_PORADNIK", "MENU_OPIS_RAS", "MENU_OPIS_RAS2" };
// Callback functions for the above menu names new const MENU_CALLBACK[TOTAL_MENUS][] = { "_MENU_Shopmenu1", "_MENU_Shopmenu2", "_MENU_Shopmenu3", "_MENU_SelectSkill", "_MENU_ChangeRace", "_MENU_War3Menu", "_menu_Skill_Options", "_menu_Item_Options", "_menu_Race_Options", "_menu_Admin_Options", "_menu_PlayerXP_Options", "_menu_TeamXP_Options", "_MENU_ResetXP", "_menu_ReplaceItem", "_menu_Poradnik", "_menu_Opis_Ras", "_menu_Opis_Ras2" };
And I added this to war3ft.txt:
Код
INFO_VIP = Zdobadz VIPa PORADNIK = \rPoradnik War3FT by DaNcer MENU_PORADNIK = \rPoradnik War3FT by DaNceR OGOLNY_OPIS = \yOgolny opis moda War3FT PRZYDATNE_KOMENDY = \yPrzydatne komendy i bindy OPIS_RAS = \rOpis ras OPIS_RAS2 = \rOpis bohaterow MENU_OPIS_RAS = Opis ras MENU_OPIS_RAS2 = Opis bohaterow
And now situation goes like this. When I delete above statements from war3ft.txt, my menu works fine. There is some ML_NOTFOUND errors of course, but the menu works good. When I click a button, there appears thing I expected to appear. But with those words in war3ft.txt, my menu doesn't work good. When I click 6 from war3menu, there appears my menu, but when I click any number from this menu, it shows me informations about races in motd from MENU_OPIS_RAS2. I think there is an error in this:
Код
for (i = 0; i<4; i++) { pos += format(menu_body[pos], 511-pos, "\w%d. %s^n",i+1,menuitems[i]) }