danis11255
Нуль
- Регистрация
- 21 Авг 2016
- Сообщения
- 7
- Лучшие ответы
- 0
- Репутация
- 0
Здравствуйте скриптеры, впервые столкнулся с вот такой ошибкой :at:
Вот сам LoadOrgs()[21:55:48] [debug] Run time error 4: "Array index out of bounds"
[21:55:48] [debug] Attempted to read/write array element at index 21 in array of size 21
[21:55:48] [debug] AMX backtrace:
[21:55:48] [debug] #0 006f33f0 in LoadOrgs () at C:\Users\danis\Desktop\Rodina\gamemodes\rrp.pwn:44656
[21:55:48] [debug] #1 0001c4b8 in public SSCANF_OnGameModeInit () at C:\Users\danis\Desktop\Rodina\gamemodes\rrp.pwn:6601
[21:55:48] [debug] #2 native CallLocalFunction () in samp-server-cr.exe
[21:55:48] [debug] #3 00004358 in public dc_cmd_OnGameModeInit () at C:\Users\danis\Desktop\Rodina\pawno\include\sscanf2.inc:84
[21:55:48] [debug] #4 000008e0 in public OnGameModeInit () at C:\Users\danis\Desktop\Rodina\pawno\include\dc_cmd.inc:97
PHP:
LoadOrgs()
{
new string[500];
for(new i; i < 10; i ++) RankName[0][i] = "Гражданин";
format(string, sizeof(string), "SELECT * FROM `orgsinfo`");
new Cache:result = mysql_query(mysql, string);
new num = cache_get_row_count(mysql);
for(new i = 1;i <= num;i ++)
{
OrgInfo[i][oID] = cache_get_row_int(i-1, 0, mysql);
cache_get_row(i-1, 1, OrgInfo[i][oName], mysql,32);
cache_get_row(i-1, 2, OrgInfo[i][oLeader], mysql,24);
OrgInfo[i][oBank] = cache_get_row_int(i-1, 3, mysql);
OrgInfo[i][oDrugs] = cache_get_row_int(i-1, 4, mysql);
OrgInfo[i][oMats] = cache_get_row_int(i-1, 5, mysql);
OrgInfo[i][Max_Rang] = cache_get_row_int(i-1, 6, mysql);
cache_get_row(i-1, 7, RankName[i][0], mysql, 50);
cache_get_row(i-1, 8, RankName[i][1], mysql, 50);
cache_get_row(i-1, 9, RankName[i][2], mysql, 50);
cache_get_row(i-1, 10, RankName[i][3], mysql, 50);
cache_get_row(i-1, 11, RankName[i][4], mysql, 50);
cache_get_row(i-1, 12, RankName[i][5], mysql, 50);
cache_get_row(i-1, 13, RankName[i][6], mysql, 50);
cache_get_row(i-1, 14, RankName[i][7], mysql, 50);
cache_get_row(i-1, 15, RankName[i][8], mysql, 50);
cache_get_row(i-1, 16, RankName[i][9], mysql, 50);
OrgInfo[i][oBenz] = cache_get_row_int(i-1, 17, mysql);
OrgInfo[i][oRemont] = cache_get_row_int(i-1, 18, mysql);
OrgInfo[i][oMask] = cache_get_row_int(i-1, 19, mysql);
}
cache_delete(result, mysql);
return true;
}