trouble in registration(проблема с регистрацией)
#1

ENG:trouble in registration when i choose six or seven strings. Dialog is disappears.
Please tell me when i making error( sorry for my Eng )


RUS:проблема в регистрации, когда я выбираю шестую или седьмую строку, диалог пропадает.
Подскажите где у меня ошибка.


crashdetecter:
[debug] Run time error 4: "Array index out of bounds"
[debug] Attempted to read/write array element at index 15 in array of size 14
[debug] AMX backtrace:
[debug] #0 0000c3e8 in public OnDialogResponse (playerid=0, dialogid=7, response=1, listitem=-1, inputtext[]=@00012774 "25") at C:\samp server\gamemodes\new.pwn:727
CODE
Код:
case DLG_REGSEX:
		{
		player_info[playerid] [SEX] = (response) ? (1) : (2);// 1 MAN, 2 WOMAN
  		SPD(playerid, DLG_REGRACE, DIALOG_STYLE_LIST, "{007aff}[REG] -{FFFFFF} *russian text*?",
			"USA\n\
			Spanish\n\
			Italy\n\
			Russia\n\
			Ukraine\n\
			Belarus\n\
			JAPAN",
			"NEXT", "");
		}
		case DLG_REGRACE:
		{
			switch(listitem)
			{
			    case 0: player_info[playerid] [RACE] = 0;
			    case 1: player_info[playerid] [RACE] = 1;
			    case 2: player_info[playerid] [RACE] = 2;
			    case 3: player_info[playerid] [RACE] = 3;
			    case 4: player_info[playerid] [RACE] = 4;
			    case 5: player_info[playerid] [RACE] = 5;
			    case 6: player_info[playerid] [RACE] = 6;
			    case 7: player_info[playerid] [RACE] = 7;
			}
			SPD(playerid, DLG_REGAGE, DIALOG_STYLE_INPUT, "{007aff}[REG] - {FFFFFF}*russian text*",
			"*russian text* \"NEXT\"\n\n\
			{ffc900}*russian text*:{ffffff}\n\
			Enter ages 18 to 60",
			"NEXT","");
			}
		case DLG_REGAGE:
		{
		    if(!strlen(inputtext))
		    {
		    SPD(playerid, DLG_REGAGE, DIALOG_STYLE_INPUT, "{007aff}[REG] - {FFFFFF}*russian text*",
			"*russian text* \"NEXT\"\n\n\
			{ffc900}*russian text*:{ffffff}\n\
			Enter ages 18 to 60",
			"NEXT","");
			return SCM(playerid, COLOR_RED, "[WARNING]: {FFFFFF}*russian text*");
		    }
		    if(!(18 <= strval(inputtext) <= 60))
   			//if(strval(inputtext) < 18 || strval(inputtext) > 60)
			{
			SPD(playerid, DLG_REGAGE, DIALOG_STYLE_INPUT, "{007aff}[REG] - {FFFFFF}*russian text*",
			"*russian text* \"NEXT\"\n\n\
			{ffc900}*russian text*:{ffffff}\n\
			Enter ages 18 to 60",
			"NEXT","");
			return SCM(playerid, COLOR_RED, "[warning]: {FFFFFF}*russian text*");
			}
			player_info[playerid][AGE] = strval(inputtext);
                        new regmaleskins[14][4] =
                        {
                                {2,4,5,66},//??? 18-30
                                {3,14,183,3},// ??? 31-60
                                {128,273,295,128},//??????? 18-30
                                {35,241,242,35},//??????? 31-60
                                {202,8,20,202},// ?????? 18-30
                                {36,258,259,36},//?????? 31-60
                                {26,37,177,184},//?????? 18-30
                                {1,15,137,160},//?????? 31-60
                                {96,94,135,79},//??????? 18-30
                                {133,95,132,79},//??????? 31-60
                                {38,47,48,78},//???????? 18-30
                                {32,44,53,78},//???????? 31-60
                                {210,122,210,122},//?????? 18-30
                                {229,235,236,229}//?????? 31-60
                        };
                        new regfemaleskins[14][4] =
                        {
                                {152,40,152,40},//USA
                                {151,76,39,10},//USA
                                {148,190,148,190},//SPANISH
                                {131,9,207,215},//SPANISH
                                {90,64,198,90},//ITALY
                                {89,31,89,31},//ITALY
                                {93,201,93,201},//RUS
                                {130,199,130,199},//RUS
                                {41,298,41,298},//Ykraina
                                {129,77,129,77},//ukraine
                                {55,231,55,231},//Bel?rus
                                {54,196,54,196},//belarus
                                {141,56,193,224},//japanes
                                {197,232,197,232}//japan
                        };
                new newskinindex;
                        switch(player_info[playerid][RACE])
                        {
                                case 0: {}
                                case 1: newskinindex+=3;
                                case 2: newskinindex+=6;
                                case 3: newskinindex+=9;
                                case 4: newskinindex+=12;
                                case 5: newskinindex+=15;
                                case 6: newskinindex+=18;
                                case 7: newskinindex+=21;
                        }
                        switch(player_info[playerid][AGE])
                        {
                                case 18..30: {}
                                case 31..60: newskinindex++;
                        }
/*(ERROR - STRING 727 (ВОТ ТУТ ОШИБКА 727 )*/if(player_info[playerid][SEX] == 1) player_info[playerid][SKIN] = regmaleskins[newskinindex][random(4)]; //Вот тут у меня условие ,если мужской пол то рандомный скин из списка
                        else player_info[playerid][SKIN] = regfemaleskins[newskinindex][random(4)];
Reply
#2

pawn Код:
new regfemaleskins[14][4] = //...
Becomes

pawn Код:
new regfemaleskins[16][4] = //...
Or higher
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)