EAX Sort
Умник
Вот у меня есть такая загрузка домов:
Помогите мне, пожалуйста, сделать сток сохранения одного дома и всех домов. Не нужно делать мне готовое, просто объясните как (какую функцию использовать и какая должна быть структура).
Грубо говоря, дайте мне пример одной строчки. Допустим как сохранить ид дома.
Код:
publics: LoadHouse()
{
static rows, fields;
cache_get_data(rows, fields);
new maximum[160];
new time = GetTickCount();
new i=0;
if(rows)
{
for(new he = 0;he < rows; he++)
{
cache_get_field_content(0, "hID", maximum), HouseInfo[he][hID] = strval(maximum);
cache_get_field_content(0, "hEntrancex", maximum), HouseInfo[he][hEntrancex] = floatstr(maximum);
cache_get_field_content(0, "hEntrancey", maximum), HouseInfo[he][hEntrancey] = floatstr(maximum);
cache_get_field_content(0, "hEntrancez", maximum), HouseInfo[he][hEntrancez] = floatstr(maximum);
cache_get_field_content(0, "hExitx", maximum), HouseInfo[he][hExitx] = floatstr(maximum);
cache_get_field_content(0, "hExity", maximum), HouseInfo[he][hExity] = floatstr(maximum);
cache_get_field_content(0, "hExitz", maximum), HouseInfo[he][hExitz] = floatstr(maximum);
cache_get_field_content(0, "hOwner", maximum), strmid(HouseInfo[he][hOwner], maximum, 0, strlen(maximum), 160);
cache_get_field_content(0, "hValue", maximum), HouseInfo[he][hValue] = strval(maximum);
cache_get_field_content(0, "hInt", maximum), HouseInfo[he][hInt] = strval(maximum);
cache_get_field_content(0, "hLock", maximum), HouseInfo[he][hLock] = strval(maximum);
cache_get_field_content(0, "hOwned", maximum), HouseInfo[he][hOwned] = strval(maximum);
cache_get_field_content(0, "hTakings", maximum), HouseInfo[he][hTakings] = strval(maximum);
cache_get_field_content(0, "hKlass", maximum), HouseInfo[he][hKlass] = strval(maximum);
cache_get_field_content(0, "hMats", maximum), HouseInfo[he][hMats] = strval(maximum);
cache_get_field_content(0, "hStyle", maximum), HouseInfo[he][hStyle] = strval(maximum);
i++;
if(HouseInfo[he][hOwned] == 0)
{
HouseInfo[he][hPickup] = CreatePickupAC(1273, 23, HouseInfo[he][hEntrancex], HouseInfo[he][hEntrancey], HouseInfo[he][hEntrancez],-1);
HouseInfo[he][hMIcon] = CreateDynamicMapIcon(HouseInfo[he][hEntrancex], HouseInfo[he][hEntrancey], HouseInfo[he][hEntrancez], 31, COLOR_WHITE, 0, -1, -1, 50.0);
}
if(HouseInfo[he][hOwned] == 1)
{
HouseInfo[he][hPickup] = CreatePickupAC(1272, 23, HouseInfo[he][hEntrancex], HouseInfo[he][hEntrancey], HouseInfo[he][hEntrancez],-1);
HouseInfo[he][hMIcon] = CreateDynamicMapIcon(HouseInfo[he][hEntrancex], HouseInfo[he][hEntrancey], HouseInfo[he][hEntrancez], 32, COLOR_WHITE, 0, -1, -1, 50.0);
}
}
printf("\n- Äîìîâ çàêðóæåíî: %d. | Ïîòðà÷åíî: %d ms.", i, GetTickCount() - time);
}
else printf("Äîìà íå çàãðóæåíû.");
return true;
}
Грубо говоря, дайте мне пример одной строчки. Допустим как сохранить ид дома.
