13.03.2014, 18:17
Hello I was create 3 houses in my database and turn off server and again turn on and it says in mysql log dat is data fine loaded position owner of the house etc... but I was enter in my server and go to that place where I create house and house isn't on that place where I put it
so this is on ongamemodeinit
and here is LoadHouses
so this is on ongamemodeinit
pawn Код:
format(szString,sizeof szString,"SELECT * FROM `houses`");
mysql_tquery(mysql,szString,"LoadHouses","");
and here is LoadHouses
pawn Код:
public LoadHouses()
{
new rows,fields,str[800];
cache_get_data(rows,fields,mysql);
if(rows)
{
new i = 0;
while(rows > i < MAX_HOUSES)
{
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");
i++;
if(KucaInfo[i][hImaVlasnika] == 0)
{
format(str,sizeof(str),"{0ed400}Na Prodaju\n{0ed400}Opis: {FFFFFF}%s\n{0ed400}Level: {FFFFFF}%d\n{0ed400}Adresa: {FFFFFF}%s\n{0ed400}Cijena: {FFFFFF}%d$",KucaInfo[i][hOpis],KucaInfo[i][hLevel],KucaInfo[i][hAdresa],KucaInfo[i][hCijena]);
UpdateDynamic3DTextLabelText(KucaLabel[i],0x00FFFFFF,str);
DestroyDynamicPickup(KucaPickup[i]);
KucaPickup[i] = CreateDynamicPickup(1273,1,KucaInfo[i][hUlazX],KucaInfo[i][hUlazY],KucaInfo[i][hUlazZ]);
}
if(KucaInfo[i][hImaVlasnika] == 1)
{
if(KucaInfo[i][hRentabil] == 0)
{
format(str,800,"{0ed400}Vlasnik Kuce: {FFFFFF}%s\n{0ed400}Opis: {FFFFFF}%s\n{0ed400}Level: {FFFFFF}%d\n{0ed400}Adresa: {FFFFFF}%s",KucaInfo[i][hVlasnik],KucaInfo[i][hOpis],KucaInfo[i][hLevel],KucaInfo[i][hAdresa]);
}
else if(KucaInfo[i][hRentabil] == 1)
{
format(str,800,"{0ed400}Vlasnik Kuce: {FFFFFF}%s\n{0ed400}Opis: {FFFFFF}%s\n{0ed400}Level: {FFFFFF}%d\n{0ed400}Adresa: {FFFFFF}%s\n{0ed400}Rent: {FFFFFF}%d$\n{0ed400}Najam: {FFFFFF}/rentroom",KucaInfo[i][hVlasnik],KucaInfo[i][hOpis],KucaInfo[i][hLevel],KucaInfo[i][hAdresa],KucaInfo[i][hRent]);
}
UpdateDynamic3DTextLabelText(KucaLabel[i],0x00FF00AA,str);
DestroyDynamicPickup(KucaPickup[i]);
KucaPickup[i] = CreateDynamicPickup(1239,1,KucaInfo[i][hUlazX],KucaInfo[i][hUlazY],KucaInfo[i][hUlazZ]);
}
}
}
return 1;
}