arhan4hel
Компетентный
Вобщем есть проблема с загрузкой авто, а тоесть загружаются немножко не так, как мне надо, у меня есть в моде 618 машин, мне нужно чтобы ID машин, которые загружаются стояли перед теми машинами, которые в моде, а тоесть вот обычная загрузка на файлах, где загружается так как мне надо
А вот na MySQL R7 где загружаются неправильно
PHP:
stock LoadAuto()
{
new arrCoords[28][64];
new strFromFile2[256];
new File: file = fopen("auto.cfg", io_read);
if (file)
{
new idx;
while (idx < 50)
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
AutoInfo[idx+1][aStats] = strval(arrCoords[0]);
AutoInfo[idx+1][aModel] = strval(arrCoords[1]);
AutoInfo[idx+1][aAutoX] = floatstr(arrCoords[2]);
AutoInfo[idx+1][aAutoY] = floatstr(arrCoords[3]);
AutoInfo[idx+1][aAutoZ] = floatstr(arrCoords[4]);
AutoInfo[idx+1][aAutoAngle] = floatstr(arrCoords[5]);
AutoInfo[idx+1][aColor1] = strval(arrCoords[6]);
AutoInfo[idx+1][aColor2] = strval(arrCoords[7]);
strmid(AutoInfo[idx+1][aOwner], arrCoords[8], 0, strlen(arrCoords[8]), 255);
AutoInfo[idx+1][aPrice] = strval(arrCoords[9]);
strmid(AutoInfo[idx+1][aNomer], arrCoords[10], 0, strlen(arrCoords[11]), 255);
idx++;
}
fclose(file);
}
return true;
}
PHP:
public OnLoadAutosCallback()
{
new rows, fields;
cache_get_data(rows, fields);
new temp[100];
new iveh=0;
if(rows)
{
for(new h =1;h <= rows; h++)
{
cache_get_row(iveh, 0, temp), AutoInfo[h][aID] = strval(temp);
cache_get_row(iveh, 1, temp), AutoInfo[h][aStats] = strval(temp);
cache_get_row(iveh, 2, temp), AutoInfo[h][aModel] = strval(temp);
cache_get_row(iveh, 3, temp), AutoInfo[h][aAutoX] = floatstr(temp);
cache_get_row(iveh, 4, temp), AutoInfo[h][aAutoY] = floatstr(temp);
cache_get_row(iveh, 5, temp), AutoInfo[h][aAutoZ] = floatstr(temp);
cache_get_row(iveh, 6, temp), AutoInfo[h][aAutoAngle] = floatstr(temp);
cache_get_row(iveh, 7, temp), AutoInfo[h][aColor1] = strval(temp);
cache_get_row(iveh, 8, temp), AutoInfo[h][aColor2] = strval(temp);
cache_get_row(iveh, 9, AutoInfo[h][aOwner]);
cache_get_row(iveh, 10, temp), AutoInfo[h][aPrice] = strval(temp);
cache_get_row(iveh, 11, AutoInfo[h][aNomer]);
iveh++;
}
}
printf("~ Загружено каров - %i.", iveh);
return true;
}
[За помощь 5 плюсиков)]
Последнее редактирование:
