public LoadHouses()
{
new rows, count;
cache_get_row_count(rows);
for(new i=0;i<rows;i++)
{
new houseID = cache_get_value_name_int(i, "id", houseID);
printf("%d", houseID);
if(houseID < MAX_HOUSES)
{
Haus[houseID][hCreated] = 1;
cache_get_value_name_int(i, "id", Haus[houseID][hdbID]);
cache_get_value_name_float(i, "EnterX", Haus[houseID][EnterX]);
cache_get_value_name_float(i, "EnterY", Haus[houseID][EnterY]);
cache_get_value_name_float(i, "EnterZ", Haus[houseID][EnterZ]);
cache_get_value_name_float(i, "ExitX", Haus[houseID][ExitX]);
cache_get_value_name_float(i, "ExitY", Haus[houseID][ExitY]);
cache_get_value_name_float(i, "ExitZ", Haus[houseID][ExitZ]);
cache_get_value_name_int(i, "Interior", Haus[houseID][hInterior]);
cache_get_value_name(i, "Besitzer", Haus[houseID][hBesitzer], 32);
cache_get_value_name(i, "Name", Haus[houseID][hName], 32);
cache_get_value_name_int(i, "Preis", Haus[houseID][hPreis]);
cache_get_value_name_int(i, "Mieten", Haus[houseID][hMieten]);
cache_get_value_name_int(i, "Lock", Haus[houseID][hLock]);
cache_get_value_name_int(i, "MietPreis", Haus[houseID][hMietPreis]);
cache_get_value_name_int(i, "Kasse", Haus[houseID][hKasse]);
cache_get_value_name_int(i, "Owned", Haus[houseID][hOwned]);
cache_get_value_name_int(i, "HealthUpgrade", Haus[houseID][hHealthUpgrade]);
Haus[houseID][hText] = CreateDynamic3DTextLabel("Laedt ...", COLOR_WHITE, Haus[houseID][EnterX], Haus[houseID][EnterY], Haus[houseID][EnterZ], 20.0);
if(Haus[houseID][hOwned] == 1)
{
Haus[houseID][hPickup] = CreatePickup(OWNER_PICKUP, 1, Haus[houseID][EnterX], Haus[houseID][EnterY], Haus[houseID][EnterZ], 0);
}
else if(Haus[houseID][hOwned] == 0)
{
Haus[houseID][hPickup] = CreatePickup(NO_OWNER_PICKUP, 1, Haus[houseID][EnterX], Haus[houseID][EnterY], Haus[houseID][EnterZ], 0);
}
UpdateHouseLabel(houseID, Haus[houseID][hOwned]);
count++;
}
}
printf("[LOAD] Häuser geladen: %d/%d", count, MAX_HOUSES);
return 1;
}
Alles anzeigen