Schick mir mal deine TeamViewer Daten, ich will mir das mal ansehen, was du wirklich machst. Der Code sieht an sich eigentlich gut aus, zumindest auf den ersten Blick.
EDIT:
Das Problem war, dass er die Häuser zu nahe nebeneinander gesetzt hatte, somit hat es mehrere auf einmal gekauft.
Erledigt.
EDIT2:
Code sieht nun so aus, um weitere Fehler zu beheben:
case _SQL_HOUSE_LOAD:
{
cache_get_data(rows,fields);
if(rows)
{
new hcount = 0, HouseText[300], h;
while(hcount<rows)
{
cache_get_field_content(hcount,"hID",result);
h = strval(result);
if(h < 0 || h >= sizeof(HouseInfo))
{
hcount++;
continue;
}
HouseInfo[h][hID] = h;
cache_get_field_content(hcount,"Owner",result);
format( HouseInfo[h][hOwner], 35, "%s",result);
printf("Haus id: %d",HouseInfo[h][hID]);
cache_get_field_content(hcount,"Sell",result);
HouseInfo[h][hSell] = strval(result);
cache_get_field_content(hcount,"hcreate",result);
HouseInfo[h][hcreate] = strval(result);
cache_get_field_content(hcount,"Rent",result);
HouseInfo[h][hRent] = strval(result);
cache_get_field_content(hcount,"Price",result);
HouseInfo[h][hPrice] = strval(result);
cache_get_field_content(hcount,"Locked",result);
HouseInfo[h][hLocked] = strval(result);
cache_get_field_content(hcount,"Rentcount",result);
HouseInfo[h][hRentcount] = strval(result);
HouseInfo[h][hPos][0] = cache_get_field_content_float(hcount, "Posx");
HouseInfo[h][hPos][1] = cache_get_field_content_float(hcount, "Posy");
HouseInfo[h][hPos][2] = cache_get_field_content_float(hcount, "Posz");
HouseInfo[h][hiPos][0] = cache_get_field_content_float(hcount, "Posix");
HouseInfo[h][hiPos][1] = cache_get_field_content_float(hcount, "Posiy");
HouseInfo[h][hiPos][2] = cache_get_field_content_float(hcount, "Posiz");
cache_get_field_content(hcount,"hLevel",result);
HouseInfo[h][hLevel] = strval(result);
cache_get_field_content(hcount,"vworld",result);
HouseInfo[h][hvWorld] = strval(result);
cache_get_field_content(hcount,"hint",result);
HouseInfo[h][hint] = strval(result);
cache_get_field_content(hcount,"Bank",result);
HouseInfo[h][hBank] = strval(result);
cache_get_field_content(hcount,"Muell",result);
HouseInfo[h][hMuell] = strval(result);
cache_get_field_content(hcount,"waterprice",result);
HouseInfo[h][hWaterprice] = strval(result);
cache_get_field_content(hcount,"stromprice",result);
HouseInfo[h][hStromprice] = strval(result);
cache_get_field_content(hcount,"heizprice",result);
HouseInfo[h][hHeizprice] = strval(result);
cache_get_field_content(hcount,"MaxRentcount",result);
HouseInfo[h][hMaxRent] = strval(result);
cache_get_field_content(hcount,"Upgrade1",result);
HouseInfo[h][hUpgrade][0] = strval(result);
cache_get_field_content(hcount,"Upgrade2",result);
HouseInfo[h][hUpgrade][1] = strval(result);
cache_get_field_content(hcount,"Mietpreis",result);
HouseInfo[h][hMietPreis] = strval(result);
if(HouseInfo[h][hPos][0] != 0)
{
if(HouseInfo[h][hSell] == 0)
{
HouseInfo[h][hPickup] = CreateDynamicPickup(1272,1, HouseInfo[h][hPos][0], HouseInfo[h][hPos][1], HouseInfo[h][hPos][2],0);
format(HouseText,sizeof(HouseText),""#HTML_LOGIN"HausID: "#HTML_WHITE"%i\n"#HTML_LOGIN"Preis: "#HTML_WHITE"%i$ "#HTML_LOGIN"Level: "#HTML_WHITE"%d\n"#HTML_LOGIN"Müll: "#HTML_WHITE"%d\n"#HTML_WHITE"Haus steht zum "#HTML_GREEN"Verkauf \n"#HTML_WHITE"/hauskaufen",hcount, HouseInfo[h][hPrice], HouseInfo[h][hLevel],HouseInfo[h][hMuell]);
HouseInfo[h][hText] = Create3DTextLabel(HouseText, WEISS, HouseInfo[h][hPos][0], HouseInfo[h][hPos][1], HouseInfo[h][hPos][2], 10, 0);
}
else if(HouseInfo[h][hSell] == 1)
{
HouseInfo[h][hPickup] = CreateDynamicPickup(1273,1,HouseInfo[h][hPos][0], HouseInfo[h][hPos][1], HouseInfo[h][hPos][2],0);
HouseInfo[h][hiPickup] = CreateDynamicPickup(1272,1,HouseInfo[h][hiPos][0], HouseInfo[h][hiPos][1], HouseInfo[h][hiPos][2], HouseInfo[h][hvWorld], HouseInfo[h][hint]);
format(HouseText,sizeof(HouseText),""#HTML_LOGIN"HausID: %i\n"#HTML_LOGIN"Hausbesitzer: "#HTML_WHITE"%s\n"#HTML_LOGIN"Mietpreis: "#HTML_WHITE"%i$\n"#HTML_LOGIN"Mieter: "#HTML_WHITE"%i/%i\n"#HTML_LOGIN"Müll: "#HTML_WHITE"%d\n\nUm dich einzumieten benutze /einmieten"#HTML_WHITE" ein!\nZum Betreten 'F'", hcount, HouseInfo[h][hOwner], HouseInfo[h][hMietPreis], HouseInfo[h][hRentcount], HouseInfo[h][hMaxRent], HouseInfo[h][hMuell]);
HouseInfo[h][hText] = Create3DTextLabel(HouseText, WEISS, HouseInfo[h][hPos][0], HouseInfo[h][hPos][1], HouseInfo[h][hPos][2], 10, 0);
}
}
hcount++;
}
printf(""#SERVERNAME" Häuser geladen %d/%d geladen!",rows, MAX_HOUSE);
}
return true;
}
{
cache_get_data(rows,fields);
if(rows)
{
new hcount = 0, HouseText[300], h;
while(hcount<rows)
{
cache_get_field_content(hcount,"hID",result);
h = strval(result);
if(h < 0 || h >= sizeof(HouseInfo))
{
hcount++;
continue;
}
HouseInfo[h][hID] = h;
cache_get_field_content(hcount,"Owner",result);
format( HouseInfo[h][hOwner], 35, "%s",result);
printf("Haus id: %d",HouseInfo[h][hID]);
cache_get_field_content(hcount,"Sell",result);
HouseInfo[h][hSell] = strval(result);
cache_get_field_content(hcount,"hcreate",result);
HouseInfo[h][hcreate] = strval(result);
cache_get_field_content(hcount,"Rent",result);
HouseInfo[h][hRent] = strval(result);
cache_get_field_content(hcount,"Price",result);
HouseInfo[h][hPrice] = strval(result);
cache_get_field_content(hcount,"Locked",result);
HouseInfo[h][hLocked] = strval(result);
cache_get_field_content(hcount,"Rentcount",result);
HouseInfo[h][hRentcount] = strval(result);
HouseInfo[h][hPos][0] = cache_get_field_content_float(hcount, "Posx");
HouseInfo[h][hPos][1] = cache_get_field_content_float(hcount, "Posy");
HouseInfo[h][hPos][2] = cache_get_field_content_float(hcount, "Posz");
HouseInfo[h][hiPos][0] = cache_get_field_content_float(hcount, "Posix");
HouseInfo[h][hiPos][1] = cache_get_field_content_float(hcount, "Posiy");
HouseInfo[h][hiPos][2] = cache_get_field_content_float(hcount, "Posiz");
cache_get_field_content(hcount,"hLevel",result);
HouseInfo[h][hLevel] = strval(result);
cache_get_field_content(hcount,"vworld",result);
HouseInfo[h][hvWorld] = strval(result);
cache_get_field_content(hcount,"hint",result);
HouseInfo[h][hint] = strval(result);
cache_get_field_content(hcount,"Bank",result);
HouseInfo[h][hBank] = strval(result);
cache_get_field_content(hcount,"Muell",result);
HouseInfo[h][hMuell] = strval(result);
cache_get_field_content(hcount,"waterprice",result);
HouseInfo[h][hWaterprice] = strval(result);
cache_get_field_content(hcount,"stromprice",result);
HouseInfo[h][hStromprice] = strval(result);
cache_get_field_content(hcount,"heizprice",result);
HouseInfo[h][hHeizprice] = strval(result);
cache_get_field_content(hcount,"MaxRentcount",result);
HouseInfo[h][hMaxRent] = strval(result);
cache_get_field_content(hcount,"Upgrade1",result);
HouseInfo[h][hUpgrade][0] = strval(result);
cache_get_field_content(hcount,"Upgrade2",result);
HouseInfo[h][hUpgrade][1] = strval(result);
cache_get_field_content(hcount,"Mietpreis",result);
HouseInfo[h][hMietPreis] = strval(result);
if(HouseInfo[h][hPos][0] != 0)
{
if(HouseInfo[h][hSell] == 0)
{
HouseInfo[h][hPickup] = CreateDynamicPickup(1272,1, HouseInfo[h][hPos][0], HouseInfo[h][hPos][1], HouseInfo[h][hPos][2],0);
format(HouseText,sizeof(HouseText),""#HTML_LOGIN"HausID: "#HTML_WHITE"%i\n"#HTML_LOGIN"Preis: "#HTML_WHITE"%i$ "#HTML_LOGIN"Level: "#HTML_WHITE"%d\n"#HTML_LOGIN"Müll: "#HTML_WHITE"%d\n"#HTML_WHITE"Haus steht zum "#HTML_GREEN"Verkauf \n"#HTML_WHITE"/hauskaufen",hcount, HouseInfo[h][hPrice], HouseInfo[h][hLevel],HouseInfo[h][hMuell]);
HouseInfo[h][hText] = Create3DTextLabel(HouseText, WEISS, HouseInfo[h][hPos][0], HouseInfo[h][hPos][1], HouseInfo[h][hPos][2], 10, 0);
}
else if(HouseInfo[h][hSell] == 1)
{
HouseInfo[h][hPickup] = CreateDynamicPickup(1273,1,HouseInfo[h][hPos][0], HouseInfo[h][hPos][1], HouseInfo[h][hPos][2],0);
HouseInfo[h][hiPickup] = CreateDynamicPickup(1272,1,HouseInfo[h][hiPos][0], HouseInfo[h][hiPos][1], HouseInfo[h][hiPos][2], HouseInfo[h][hvWorld], HouseInfo[h][hint]);
format(HouseText,sizeof(HouseText),""#HTML_LOGIN"HausID: %i\n"#HTML_LOGIN"Hausbesitzer: "#HTML_WHITE"%s\n"#HTML_LOGIN"Mietpreis: "#HTML_WHITE"%i$\n"#HTML_LOGIN"Mieter: "#HTML_WHITE"%i/%i\n"#HTML_LOGIN"Müll: "#HTML_WHITE"%d\n\nUm dich einzumieten benutze /einmieten"#HTML_WHITE" ein!\nZum Betreten 'F'", hcount, HouseInfo[h][hOwner], HouseInfo[h][hMietPreis], HouseInfo[h][hRentcount], HouseInfo[h][hMaxRent], HouseInfo[h][hMuell]);
HouseInfo[h][hText] = Create3DTextLabel(HouseText, WEISS, HouseInfo[h][hPos][0], HouseInfo[h][hPos][1], HouseInfo[h][hPos][2], 10, 0);
}
}
hcount++;
}
printf(""#SERVERNAME" Häuser geladen %d/%d geladen!",rows, MAX_HOUSE);
}
return true;
}