SnOoWmaN
Новичок
Суть вот в чём, перевел пикапы на MySQL, создаётся пикап нормально, работает прекрасно всё. После рестарта сервера - создаётся только один пикап, самый первый в базе MySQL, хоть и выдает, что загружены все созданные.:
Всю ночь не спал, голова не соображает, решил проблему. ;D
PHP:
new rows, fields;
cache_get_data(rows, fields);
if(rows > MAX_TELEPORT) return print("Количество пикапов превышает разрешимое.");
if(rows > 0)
{
for(new t = 0; t < rows; t++)
{
PickupsInfo[t][tID] = cache_get_field_content_int(0, "ID");
PickupsInfo[t][tType] = cache_get_field_content_int(0, "Type");
PickupsInfo[t][tX] = cache_get_field_content_float(0, "X");
PickupsInfo[t][tY] = cache_get_field_content_float(0, "Y");
PickupsInfo[t][tZ] = cache_get_field_content_float(0, "Z");
PickupsInfo[t][tVW] = cache_get_field_content_int(0, "VW");
PickupsInfo[t][tInterior] = cache_get_field_content_int(0, "Interior");
PickupsInfo[t][tXs] = cache_get_field_content_float(0, "Xs");
PickupsInfo[t][tYs] = cache_get_field_content_float(0, "Ys");
PickupsInfo[t][tZs] = cache_get_field_content_float(0, "Zs");
PickupsInfo[t][tVWs] = cache_get_field_content_int(0, "VWs");
PickupsInfo[t][tInteriors] = cache_get_field_content_int(0, "Interiors");
PickupsInfo[t][tPickup] = CreateDynamicPickup(PickupsInfo[t][tType], 1, PickupsInfo[t][tX], PickupsInfo[t][tY], PickupsInfo[t][tZ]);
TOTAL_PICKUPS++;
}
}
printf("Загружено пикапов: %d.", TOTAL_PICKUPS);
return true;
PHP:
new rows, fields;
cache_get_data(rows, fields);
if(rows > MAX_TELEPORT) return print("Количество пикапов превышает разрешимое.");
if(rows > 0)
{
for(new t = 0; t < rows; t++)
{
PickupsInfo[t][tID] = cache_get_field_content_int(t, "ID");
PickupsInfo[t][tType] = cache_get_field_content_int(t, "Type");
PickupsInfo[t][tX] = cache_get_field_content_float(t, "X");
PickupsInfo[t][tY] = cache_get_field_content_float(t, "Y");
PickupsInfo[t][tZ] = cache_get_field_content_float(t, "Z");
PickupsInfo[t][tVW] = cache_get_field_content_int(t, "VW");
PickupsInfo[t][tInterior] = cache_get_field_content_int(t, "Interior");
PickupsInfo[t][tXs] = cache_get_field_content_float(t, "Xs");
PickupsInfo[t][tYs] = cache_get_field_content_float(t, "Ys");
PickupsInfo[t][tZs] = cache_get_field_content_float(t, "Zs");
PickupsInfo[t][tVWs] = cache_get_field_content_int(t, "VWs");
PickupsInfo[t][tInteriors] = cache_get_field_content_int(t, "Interiors");
PickupsInfo[t][tPickup] = CreateDynamicPickup(PickupsInfo[t][tType], 1, PickupsInfo[t][tX], PickupsInfo[t][tY], PickupsInfo[t][tZ]);
TOTAL_PICKUPS++;
}
}
printf("Загружено пикапов: %d.", TOTAL_PICKUPS);
return true;
Последнее редактирование:
