BABAZORO | Дата: Понедельник, 06.06.2016, 20:50 | Сообщение # 1 |
- Сообщения: 32
- Награды: 0
- Замечания:
|
Эта проблема возникает только при выборе "Дракон" Все остальные утомительной без проблем Как исправить эту проблему
Добавлено (06.06.2016, 20:50) --------------------------------------------- SMaster пожалуйста содействие
public MENU_ChangeRace2( idUser, iRaceXP[MAX_RACES],iRaceLVL[MAX_RACES]) { new szRaceName[MAX_RACES+1][64],y, pos, iKeys = 0, szMenu[1024], szXP[16],szLVL[64]; // Get our race names for ( y = 0; y < get_pcvar_num( CVAR_wc3_races ); y++ ) { lang_GetRaceName( y + 1, idUser, szRaceName[y], 63 ); } pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "%L", LANG_PLAYER, "MENU_SELECT_RACE2" ); if ( get_pcvar_num( CVAR_wc3_save_xp ) ) { pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\R%L^n^n", LANG_PLAYER, "MENU_WORD_EXPERIENCE" ); } else { pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "^n" ); } // Build the changerace menu (for every race) for ( y = 0; y < get_pcvar_num(CVAR_wc3_races)-9; y++ ) { num_to_str( iRaceXP[y+8], szXP, 16 ); formatex(szLVL, charsmax(szLVL), "%L", LANG_PLAYER, "MENU_WORD_LEVEL",iRaceLVL[y+8]); if(y == 6) { continue; } // User's current race if ( y == p_data[idUser][P_RACE] - 9 ) { pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\d%d. %s %s\d\R%s^n", y + 1, szRaceName[y+8],szLVL, ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) ); iKeys |= (1<<y); } // Race the user wants to change to else if ( y == p_data[idUser][P_CHANGERACE] - 9 ) { pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\r%d. %s %s\r\R%s^n", y + 1, szRaceName[y+8],szLVL, ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) ); iKeys |= (1<<y); } // All other cases else { new bool:bAllowRaceNew = true; // Check to see if the user can choose this race (are there too many of this race?) if ( bAllowRaceNew ) { pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\r%d. \w%s %s\y\R%s^n", y + 1, szRaceName[y+8],szLVL, ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) ); iKeys |= (1<<y); } // If not, display the race, but don't give them a key to press else { pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\r%d. \w%s %s\y\R%s^n", y + 1, szRaceName[y+8],szLVL, ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) ); } }
}
iKeys |= (1<<y); pos += formatex( szMenu[pos], 512-pos, "^n\r7.\y %L",idUser,"MENU_BACK"); pos += formatex( szMenu[pos], 512-pos, "^n\d0. %L",idUser,"WORD_EXIT"); iKeys |= (1<<9); // Show the menu to the user! show_menu( idUser, iKeys, szMenu, -1 ); return; }
public _MENU_ChangeRace2( id, key ) { if ( !WC3_Check() || key == 9 ) { return PLUGIN_HANDLED; } if ( key == 5 || key == 6 || key == 7 || key == 8 || key == 9 ) { return PLUGIN_HANDLED; }
// Save the current race data before we change DB_SaveXP( id, false );
new iRace;
// Otherwise race is set if (key == 6) { new iRaceXP[MAX_RACES], iRaceLVL[MAX_RACES]; iRaceXP = g_iDBPlayerXPInfoStore[id]; iRaceLVL = arrPlayerLevelsInfo[id]; MENU_ChangeRace(id, iRaceXP, iRaceLVL); return PLUGIN_HANDLED; } else { iRace = key + 9; } if(iRace == 9 ) { if(!(get_user_flags(id) & ADMIN_FLAG)) { format(szMessage, sizeof(szMessage) - 1, "%L%L%L %L", LANG_PLAYER,"WC3_BRACKET_LEFT",LANG_PLAYER,"WC3_MODCLIENT",LANG_PLAYER,"WC3_BRACKET_RIGHT", LANG_PLAYER,"YOU_HAVE_NO_ACCESS"); client_print( id, print_console,szMessage); cssbColoredPrint(id, szMessage); // Get the race's name new szRaceName[64]; lang_GetRaceName( iRace, id, szRaceName, 63 ); show_motd(id, "addons/amxmodx/configs/war3ft/vip.txt", szRaceName); return PLUGIN_HANDLED; } }
// User currently has a race if ( p_data[id][P_RACE] != 0 ) {
// Change the user's race at the start of next round if ( iRace != p_data[id][P_RACE] ) { // Special message for csdm if ( CVAR_csdm_active > 0 && get_pcvar_num( CVAR_csdm_active ) == 1 ) { client_print( id, print_center, "%L",LANG_PLAYER,"CLIENT_PRINT_MENU_CHANGE_RACE"); }
p_data[id][P_CHANGERACE] = iRace; }
// Do nothing else { p_data[id][P_CHANGERACE] = 0; } }
// User doesn't have a race so give it to him!!! else { WC3_SetRace( id, iRace ); }
return PLUGIN_HANDLED; }
public MENU_ChangeRace( idUser, iRaceXP[MAX_RACES],iRaceLVL[MAX_RACES]) { new szRaceName[MAX_RACES+1][64],i, pos, iKeys = 0, szMenu[512], szXP[16],szLVL[64]; // Get our race names for ( i = 0; i < 8; i++ ) { lang_GetRaceName( i + 1, idUser, szRaceName, 63 ); } pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "%L", LANG_PLAYER, "MENU_SELECT_RACE" ); if ( get_pcvar_num( CVAR_wc3_save_xp ) ) { pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\R%L^n^n", LANG_PLAYER, "MENU_WORD_EXPERIENCE" ); } else { pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "^n" ); } // Build the changerace menu (for every race) for ( i = 0; i < 8; i++ ) { num_to_str( iRaceXP, szXP, 16 ); formatex(szLVL, charsmax(szLVL), "%L", LANG_PLAYER, "MENU_WORD_LEVEL",iRaceLVL); // User's current race if ( i == p_data[idUser][P_RACE] - 1 ) { pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\d%d. %s %s\d\R%s^n", i + 1, szRaceName, szLVL, ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) ); iKeys |= (1<<i); } // Race the user wants to change to else if ( i == p_data[idUser][P_CHANGERACE] - 1 ) { pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\r%d. %s %s\r\R%s^n", i + 1, szRaceName, szLVL, ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) ); iKeys |= (1<<i); } // 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 ) { pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\r%d. \w%s %s\y\R%s^n", i + 1, szRaceName, szLVL, ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) ); iKeys |= (1<<i); } // If not, display the race, but don't give them a key to press else { pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\r%d. \w%s %s\y\R%s^n", i + 1, szRaceName, szLVL, ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) ); } } }
iKeys |= (1<<i); // Add a cancel button to the bottom if ( get_pcvar_num( CVAR_wc3_races ) != 9 ) { iKeys |= (1<<9); pos += formatex( szMenu[pos], 512-pos, "^n\r9.\y %L",idUser,"MENU_NEXT"); pos += formatex( szMenu[pos], 512-pos, "^n\d0. %L",idUser,"WORD_EXIT"); } // Show the menu to the user! show_menu( idUser, iKeys, szMenu, -1 ); return; }
public _MENU_ChangeRace( id, key ) {
if ( !WC3_Check() ) { return PLUGIN_HANDLED; } // User pressed 0 (cancel) if ( get_pcvar_num( CVAR_wc3_races ) < 9 && key - 1 == get_pcvar_num( CVAR_wc3_races ) ) { return PLUGIN_HANDLED; } // Save the current race data before we change
new iRace;
// Otherwise race is set if (key == 8) { new iRaceXP[MAX_RACES], iRaceLVL[MAX_RACES]; iRaceXP = g_iDBPlayerXPInfoStore[id]; iRaceLVL = arrPlayerLevelsInfo[id]; MENU_ChangeRace2(id, iRaceXP, iRaceLVL); return PLUGIN_HANDLED; } else { iRace = key + 1; } if(iRace == 10) { return PLUGIN_HANDLED; } DB_SaveXP( id, false ); // User currently has a race if ( p_data[id][P_RACE] != 0 ) {
// Change the user's race at the start of next round if ( iRace != p_data[id][P_RACE] ) { p_data[id][P_CHANGERACE] = iRace; } // Do nothing else { p_data[id][P_CHANGERACE] = 0; } }
// User doesn't have a race so give it to him!!! else { WC3_SetRace( id, iRace ); }
return PLUGIN_HANDLED; }
Сообщение отредактировал BABAZORO - Понедельник, 13.06.2016, 22:38 |
|
| |