|
Стаж: 9 лет 8 месяцев
Сообщений: 2
Благодарностей: 1
Полезность: 0
|
Всем доброе время суток, Мне нужна помощь. Кому не лень, буду очень благодарен. Описание проблемы:Вообщем, у меня есть War3 Mod (Не от Русского скриптера ), и мне весь Мод, нужно перевести на русский, в целом, уже перевожу 2 дня, и все потихоньку выходит, где то дописываю код, где-то переписываю.(Так как просто поменять Кодировку Не получится) Нужно везде, практически создавать " LANG_PLAYER" итд. Так вот проблема у меня появилась в переводе функции в menu.inl В разделе " // Function will display the changerace menu" так как после перевода, (через команду Lang_Player) у меня в меню Выбора рас на сервере, кнопку «9. Вперед» и «0. Выход» Не хватает место, (Не вмещается полное название) Вместо «Вперед» пишется «Вп» и все, а «0. Выход» Вообще не отображается. Вообщем я решил к меню добавить функцию. szMenu[512] и pos = 0 Все сделал, прописал везде, но при компиляции пишет: …….. error 035: argument type mismatch <argument 2> Вроде все сделал правильно, вот уже сижу день ломаю голову что не так. Вот код, в котором я сделал изминение: Код:
// Function will display the changerace menu public MENU_ChangeRace( id, iRaceXP[MAX_RACES],iRaceLVL[MAX_RACES], pos ) { if(pos < 0) { g_menuPosition[id] = 0 return } new i, szRaceName[MAX_RACES+1][64], szXP[256], szLVL[1024]; new g_szMenu[512]; // Get our race names for ( i = 0; i < get_pcvar_num( CVAR_wc3_races ); i++ ) { lang_GetRaceName( i + 1, id, szRaceName[i], 63 ); } static start start = pos * 8 static pos; pos = 0 static maxitem maxitem = get_pcvar_num( CVAR_wc3_races ) if(start >= maxitem) start = pos = g_menuPosition[id] static racemenu[65536], len len = formatex(racemenu, 65535, "\r%L", id, "MENU_SELECT_RACE" ); static end end = start + 8 if(end > maxitem) end = maxitem static keys keys = MENU_KEY_0 static a, b b = 0 if ( get_pcvar_num( CVAR_wc3_save_xp ) ) { //len += formatex(racemenu[len], 65535 - len, "\r\R%L \R%L^n^n", id, "MENU_WORD_EXPERIENCE", id, "MENU_WORD_LEVEL" ); len += formatex(racemenu[len], 65535 - len, "\r\R%L^n^n", id, "MENU_WORD_EXPERIENCE"); } else { len += formatex(racemenu[len], 65535 - len, "^n^n" ); } for(a = start; a < end; ++a) { num_to_str( iRaceXP[a], szXP, 255 ); formatex(szLVL, charsmax(szLVL), "%d",iRaceLVL[a]); // Add the "Select a Hero" message if necessary if ( a == 4 ) { len += formatex(racemenu[len], 65535 - len, "\r%L", id, "SELECT_HERO" ); } if ( a == 12 ) { len += formatex(racemenu[len], 65535 - len, "\r%L", id, "SELECT_HERO" ); } // User's current race if ( a == p_data[id][P_RACE] - 1 ) { keys |= (1<<b) len += formatex(racemenu[len], 65535 - len, "\d%d. %s (Level %s) \d\R%s^n", ++b, szRaceName[a], ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szLVL : " " ), ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) ); } // Race the user wants to change to else if ( a == p_data[id][P_CHANGERACE] - 1 ) { keys |= (1<<b) len += formatex(racemenu[len], 65535 - len, "\r%d.\r %s (Level %s) \r\R%s^n", ++b, szRaceName[a], ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szLVL : " " ), ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) ); } // All other cases else { new bool:bAllowRace = true; // Check to see if the user can choose this race (are there too many of this race?) if ( bAllowRace ) { keys |= (1<<b) len += formatex(racemenu[len], 65535 - len, "\r%d.\w %s (\rLevel %s\w) \r\R%s^n", ++b, szRaceName[a], ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szLVL : " " ), ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) ); } // If not, display the race, but don't give them a key to press else { len += formatex(racemenu[len], 65535 - len, "\d%d. %s (Level %s) \d\R%s^n", ++b, szRaceName[a], ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szLVL : " " ), ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) ); } } } if(end != maxitem) { pos += formatex( g_szMenu[pos], charsmax(g_szMenu)-pos, "^n^n\d9. %L",LANG_PLAYER,"NEXT_NEXT") keys |= (1<<8) pos += formatex( g_szMenu[pos], charsmax(g_szMenu)-pos, "^n\d0. %L",LANG_PLAYER,"SN_MENU_BACK") keys |= (1<<9) } show_menu(id, g_szMenu, keys, racemenu, -1, "ChangeRace") return } Вариант Оригинал Код:
// Function will display the changerace menu public MENU_ChangeRace( id, iRaceXP[MAX_RACES],iRaceLVL[MAX_RACES], pos ) { if(pos < 0) { g_menuPosition[id] = 0 return } new i, szRaceName[MAX_RACES+1][64], szXP[256], szLVL[1024]; // Get our race names for ( i = 0; i < get_pcvar_num( CVAR_wc3_races ); i++ ) { lang_GetRaceName( i + 1, id, szRaceName[i], 63 ); } static start start = pos * 8 static maxitem maxitem = get_pcvar_num( CVAR_wc3_races ) if(start >= maxitem) start = pos = g_menuPosition[id] static racemenu[65536], len len = formatex(racemenu, 65535, "\r%L", id, "MENU_SELECT_RACE" ); static end end = start + 8 if(end > maxitem) end = maxitem static keys keys = MENU_KEY_0 static a, b b = 0 if ( get_pcvar_num( CVAR_wc3_save_xp ) ) { //len += formatex(racemenu[len], 65535 - len, "\r\R%L \R%L^n^n", id, "MENU_WORD_EXPERIENCE", id, "MENU_WORD_LEVEL" ); len += formatex(racemenu[len], 65535 - len, "\r\R%L^n^n", id, "MENU_WORD_EXPERIENCE"); } else { len += formatex(racemenu[len], 65535 - len, "^n^n" ); } for(a = start; a < end; ++a) { num_to_str( iRaceXP[a], szXP, 255 ); formatex(szLVL, charsmax(szLVL), "%d",iRaceLVL[a]); // Add the "Select a Hero" message if necessary if ( a == 4 ) { len += formatex(racemenu[len], 65535 - len, "\r%L", id, "SELECT_HERO" ); } if ( a == 12 ) { len += formatex(racemenu[len], 65535 - len, "\r%L", id, "SELECT_HERO" ); } // User's current race if ( a == p_data[id][P_RACE] - 1 ) { keys |= (1<<b) len += formatex(racemenu[len], 65535 - len, "\d%d. %s (Level %s) \d\R%s^n", ++b, szRaceName[a], ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szLVL : " " ), ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) ); } // Race the user wants to change to else if ( a == p_data[id][P_CHANGERACE] - 1 ) { keys |= (1<<b) len += formatex(racemenu[len], 65535 - len, "\r%d.\r %s (Level %s) \r\R%s^n", ++b, szRaceName[a], ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szLVL : " " ), ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) ); } // All other cases else { new bool:bAllowRace = true; // Check to see if the user can choose this race (are there too many of this race?) if ( bAllowRace ) { keys |= (1<<b) len += formatex(racemenu[len], 65535 - len, "\r%d.\w %s (\rLevel %s\w) \r\R%s^n", ++b, szRaceName[a], ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szLVL : " " ), ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) ); } // If not, display the race, but don't give them a key to press else { len += formatex(racemenu[len], 65535 - len, "\d%d. %s (Level %s) \d\R%s^n", ++b, szRaceName[a], ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szLVL : " " ), ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) ); } } } if(end != maxitem) { formatex(racemenu[len], 65535 - len, "^n\r9.\w Next Page^n\r0.\w %s", pos ? "Previous Page" : "Exit") keys |= MENU_KEY_9 } else formatex(racemenu[len], 65535 - len, "^n\r0.\w %s", pos ? "Previous Page" : "Exit") show_menu(id, keys, racemenu, -1, "ChangeRace") return } Если надо заплачу, и если что вот мой скайп slava.n99 | i |
| Уведомление: Для оформления кода используйте тег PAWN или CODE + SPOILER  |
Отредактировал: iShot, - 22.8.2016, 15:16
|