Stehen in der Tabelle "AccTable" bei HouseKey und UserId die richtigen Werte drin, nachdem du das Haus gekauft hast und den Server beendet hast?
Wenn ja, was gibt dir der Code so im Log aus?
Function LoadHouse()
{
new query[256];
HouseAnz = 0;
format(query,sizeof(query),"SELECT * FROM "HouseTable"");
mysql_query(query);
mysql_store_result();
for(new i; i < mysql_num_rows(); i++)
{
mysql_data_seek(i+1);
mysql_fetch_string(query);
mysql_fetch_field("HouseId",query); HouseInfo[i][hId] = strval(query);
mysql_fetch_field("EnterX",query); HouseInfo[i][hEntX] = floatstr(query);
mysql_fetch_field("EnterY",query); HouseInfo[i][hEntY] = floatstr(query);
mysql_fetch_field("EnterZ",query); HouseInfo[i][hEntZ] = floatstr(query);
HouseInfo[i][hOwnerId] = -1;
mysql_fetch_field("Level",query); HouseInfo[i][hLevel] = strval(query);
mysql_fetch_field("Inte",query); HouseInfo[i][hInt] = strval(query);
mysql_fetch_field("VWorld",query); HouseInfo[i][hVWorld] = strval(query);
mysql_fetch_field("Price",query); HouseInfo[i][hPrice] = strval(query);
mysql_fetch_field("hLock",query); HouseInfo[i][hLock] = strval(query);
mysql_fetch_field("Rent",query); HouseInfo[i][hRent] = strval(query);
mysql_fetch_field("Rentable",query); HouseInfo[i][hRent] = strval(query);
mysql_fetch_field("Money",query); HouseInfo[i][hMoney] = strval(query);
mysql_fetch_field("Health",query); HouseInfo[i][hHealth] = strval(query);
HouseInfo[i][hExists] = true;
new tmp[2][4];
mysql_fetch_field("Gun1",query);
splitter(query,tmp,',');
if(strlen(tmp[0]) != 0 && strlen(tmp[1]) != 0)
{
HouseInfo[i][hGun1] = strval(tmp[0]); HouseInfo[i][hGun1Ammo] = strval(tmp[1]);
}
mysql_fetch_field("Gun2",query);
splitter(query,tmp,',');
if(strlen(tmp[0]) != 0 && strlen(tmp[1]) != 0)
{
HouseInfo[i][hGun2] = strval(tmp[0]); HouseInfo[i][hGun2Ammo] = strval(tmp[1]);
}
mysql_fetch_field("Gun3",query);
splitter(query,tmp,',');
if(strlen(tmp[0]) != 0 && strlen(tmp[1]) != 0)
{
HouseInfo[i][hGun3] = strval(tmp[0]); HouseInfo[i][hGun3Ammo] = strval(tmp[1]);
}
HouseAnz++;
}
mysql_free_result();
printf("Starte Laden der Besitzer");
new houseId;
format(query,sizeof(query),"SELECT HouseKey,UserId FROM "AccTable" WHERE HouseKey IS NOT NULL AND NOT '-1'");
mysql_query(query);
mysql_store_result();
printf("%d rows", mysql_num_rows());
for(new a; a < mysql_num_rows(); a++)
{
mysql_data_seek(a);
houseId = mysql_fetch_int();
printf("House ID: %i",houseId);
for(new h; h < HouseAnz; h++)
{
printf("House %d hat ID: %d", h, HouseInfo[h][hId]);
if(HouseInfo[h][hId] == houseId)
{
printf("Match. Setze User zu: %d", HouseInfo[h][hOwnerId]);
mysql_fetch_field("UserId",query);
HouseInfo[h][hOwnerId] = strval(query);
h = HouseAnz;
break;
}
}
}
mysql_free_result();
for(new house; house < HouseAnz ; house++) HouseUpdate(house,"Icon");
printf("Fertig.");
return 1;
}