lonin
Компетентный
I need a help :bc:
Вот как создаю GzInfo:
Вот сам паблик загрузки:
При этом printf не рисует ничего в консоль, а лишь выбивает ошибку которую указал в первом теге PHP
Вот как вызываю загрузку:
Помогите правильно посчитать всё. Всего в базе 68 зон)
---------- Сообщение добавлено в 20:17 ---------- Предыдущее сообщение добавлено в 20:14 ----------
И при вызове SaveGZ происходит тот же error от debag`a:
PHP:
[18:58:27] [debug] Run time error 4: "Array index out of bounds"
[18:58:27] [debug] Attempted to read/write array element at index 67 in array of size 67
[18:58:27] [debug] AMX backtrace:
[18:58:27] [debug] #0 0034fdac in public Loading_GangZones () from Explosive.amx
PHP:
enum GzoneInfo
{
gID,
ZoneName[150],
Float:gCoords[4],
gFrakVlad,
gNapad
}
new GZInfo[68][GzoneInfo];
PHP:
forward Loading_GangZones();
public Loading_GangZones()
{
new r,f;
cache_get_data(r,f);
new maxGZ;
for (new i = 0;i < r;i ++)
{
GZInfo[i][gID]=cache_get_field_content_int(i,"ID");
cache_get_field_content(i,"NameGZ", GZInfo[i][ZoneName],mMysql,150);
GZInfo[i][gCoords][0]=cache_get_field_content_float(i,"PosXM");
GZInfo[i][gCoords][1]=cache_get_field_content_float(i,"PosYM");
GZInfo[i][gCoords][2]=cache_get_field_content_float(i,"PosXMAX");
GZInfo[i][gCoords][3]=cache_get_field_content_float(i,"PosYMAX");
GZInfo[i][gFrakVlad]=cache_get_field_content_int(i,"ZoneOwner");
GZInfo[i][gID] = GangZoneCreate(GZInfo[i][gCoords][0],GZInfo[i][gCoords][1],GZInfo[i][gCoords][2],GZInfo[i][gCoords][3]);
ZoneOnBattle[i] = 0;
GZSafeTime[i] = 0;
maxGZ++;
}
printf("UNLOAD: %d Gang Zone [TRUE]", maxGZ);
return true;
}
Вот как вызываю загрузку:
PHP:
mysql_function_query(mMysql,"SELECT * FROM `gangzone` ORDER BY `gangzone`.`ID` ASC ", true, "Loading_GangZones", "");
---------- Сообщение добавлено в 20:17 ---------- Предыдущее сообщение добавлено в 20:14 ----------
И при вызове SaveGZ происходит тот же error от debag`a:
PHP:
publics: SaveGZ()
{
for(new i = 0; i <= 67; i++)
{
new string[400];
format(string, sizeof(string), "UPDATE gangzone SET ZoneOwner = '%d' WHERE ID = '%d'", GZInfo[i][gFrakVlad], GZInfo[i+1][gID]);
mysql_function_query(mMysql,string,false,"","");
}
}
