14.03.2014, 11:43
pawn Код:
KucaInfo[i][ID] = cache_get_field_content_int(0,"ID");
KucaInfo[i][hUlazX] = cache_get_field_content_float(0,"UlazX");
KucaInfo[i][hUlazY] = cache_get_field_content_float(0,"UlazY");
KucaInfo[i][hUlazZ] = cache_get_field_content_float(0,"UlazZ");
KucaInfo[i][hIzlazX] = cache_get_field_content_float(0,"IzlazX");
KucaInfo[i][hIzlazY] = cache_get_field_content_float(0,"IzlazY");
KucaInfo[i][hIzlazZ] = cache_get_field_content_float(0,"IzlazZ");
KucaInfo[i][hTip] = cache_get_field_content_int(0,"Tip");
KucaInfo[i][hLevel] = cache_get_field_content_int(0,"Level");
KucaInfo[i][hRooms] = cache_get_field_content_int(0,"BrojSoba");
KucaInfo[i][hInt] = cache_get_field_content_int(0,"Interior");
KucaInfo[i][hHel] = cache_get_field_content_int(0,"hHel");
KucaInfo[i][hArm] = cache_get_field_content_int(0,"hArm");
KucaInfo[i][hImaVlasnika] = cache_get_field_content_int(0,"ImaVlasnika");
KucaInfo[i][hWorld] = cache_get_field_content_int(0,"hWorld");
KucaInfo[i][hCijena] = cache_get_field_content_int(0,"Cijena");
cache_get_field_content(0,"Opis",KucaInfo[i][hOpis],mysql,128);
cache_get_field_content(0,"Vlasnik",KucaInfo[i][hVlasnik],mysql,128);
KucaInfo[i][hRentabil] = cache_get_field_content_int(0,"DostupnoZaRent");
KucaInfo[i][hRent] = cache_get_field_content_int(0,"Rent");
KucaInfo[i][hLock] = cache_get_field_content_int(0,"Zakljucano");
cache_get_field_content(0,"Adresa",KucaInfo[i][hAdresa],mysql,128);
KucaInfo[i][hSef] = cache_get_field_content_int(0,"hSef");
KucaInfo[i][hDroga] = cache_get_field_content_int(0,"hDroga");
KucaInfo[i][hMats] = cache_get_field_content_int(0,"hMats");
KucaInfo[i][Oruzje1] = cache_get_field_content_int(0,"Oruzje1");
KucaInfo[i][Municija1] = cache_get_field_content_int(0,"Municija1");
KucaInfo[i][Oruzje2] = cache_get_field_content_int(0,"Oruzje2");
KucaInfo[i][Municija2] = cache_get_field_content_int(0,"Municija2");
KucaInfo[i][Oruzje3] = cache_get_field_content_int(0,"Oruzje3");
KucaInfo[i][Municija3] = cache_get_field_content_int(0,"Municija3");
Replace the "0" in each line by "i".
This is what causes your code to load the first house and not the rest.
Look at a query-result like you look on a piece of paper with lines.
You asked MySQL to write all house-data on that piece of paper, where every house has it's data on 1 line.
You have 3 houses in your database, so MySQL will return you a piece of paper with 3 lines of data.
The first line has row-number 0, then 1 and 2.
But your code always reads the data from row 0 (the first row = the first house).
pawn Код:
KucaInfo[i][hUlazX] = cache_get_field_content_float(0,"UlazX");
So:
pawn Код:
KucaInfo[i][hUlazX] = cache_get_field_content_float(i,"UlazX");
Since your loop increases "i" for every house, you should also use this "i" to load the rows separately for every house.