Hallo!
Und zwar frage ich mich, wieso mein "Haus System" nicht Funktionieren will...
Hier ist mal der Code, in der DB wird ein Eintrag gemacht aber das Pickup erstellt er nicht wirklich, das gleiche gilt für das TextLabel!
Function OnHouseCreated(template_id, house_x, house_y, house_z, house_ix, house_iy, house_iz, house_ir, h_price, h_score, h_int)
{
hInfo[template_id][h_x] = house_x;
hInfo[template_id][h_y] = house_y;
hInfo[template_id][h_z] = house_z;
hInfo[template_id][h_ix] = house_ix;
hInfo[template_id][h_iy] = house_iy;
hInfo[template_id][h_iz] = house_iz;
hInfo[template_id][h_ir] = house_ir;
hInfo[template_id][h_preis] = h_price;
hInfo[template_id][h_level] = h_score;
hInfo[template_id][h_interior] = h_int;
CallLocalFunction("updateHouse", "ii", template_id, 0);
printf("OnHouseCreated: %i", cache_insert_id(Handle));
return hInfo[template_id][h_id] = cache_insert_id(Handle);
}
Function OnHouseLoad()
{
for(new i;i<cache_get_row_count(Handle);i++)
{
/*
h_level,
h_preis,
h_interior,
Text3D:h_text,
h_pickup,
h_besitzer[MAX_PLAYER_NAME],
h_rentable,
*/
if(cache_get_field_content_float(0, "h_x", Handle) == 0.0)continue;
//new id=getFreeHausID();
hInfo[i][h_x] = cache_get_field_content_float(i, "h_x", Handle);
hInfo[i][h_y] = cache_get_field_content_float(i, "h_y", Handle);
hInfo[i][h_z] = cache_get_field_content_float(i, "h_z", Handle);
hInfo[i][h_ix] = cache_get_field_content_float(i, "h_ix", Handle);
hInfo[i][h_iy] = cache_get_field_content_float(i, "h_iy", Handle);
hInfo[i][h_iz] = cache_get_field_content_float(i, "h_iz", Handle);
hInfo[i][h_ir] = cache_get_field_content_float(i, "h_ir", Handle);
hInfo[i][h_level] = cache_get_field_content_int(i, "h_level", Handle);
hInfo[i][h_interior] = cache_get_field_content_int(i, "h_interior", Handle);
hInfo[i][h_rentable] = cache_get_field_content_int(i, "h_rentable", Handle);
new tmp_name[MAX_PLAYER_NAME];
cache_get_field_content(i, "h_besitzer", tmp_name, Handle);
strmid(hInfo[i][h_besitzer], tmp_name, 0, sizeof(tmp_name), sizeof(tmp_name));
hInfo[i][h_id]=cache_get_field_content_int(i, "h_id", Handle);
CallLocalFunction("updateHouse","");
}
return 1;
}
Function updateHouse()
{
new string[256];
for(new houseid;houseid<sizeof hInfo;houseid++)
{
DestroyPickup(hInfo[houseid][h_pickup]);
Delete3DTextLabel(hInfo[houseid][h_text]);
if(!strlen(hInfo[houseid][h_besitzer]))
{
format(string, sizeof string, "[{0091FF}Haus zum Verkaufen{FFFFFF}]\n\nPreis: %i{0FFF00}$\n{FFFFFF}Level: %i\n\nGebe '{EBFF00}/buyhouse{FFFFFF}' ein um das Haus zu kaufen!",
hInfo[houseid][h_preis], hInfo[houseid][h_level]);
}
else if(strlen(hInfo[houseid][h_besitzer])>0)
{
if(!hInfo[houseid][h_rentable])
{
format(string, sizeof string, "[{0091FF}Haus zum Betrachten{FFFFFF}]\n\nBesitzer: %s\n\nDrücke '{EBFF00}ENTER{FFFFFF}' um das Haus zu betreten",
hInfo[houseid][h_besitzer]);
}
}
hInfo[houseid][h_pickup] = CreateDynamicPickup(1273, 1, hInfo[houseid][h_x], hInfo[houseid][h_y], hInfo[houseid][h_z], 0, hInfo[houseid][h_interior]);
hInfo[houseid][h_text] = Create3DTextLabel(string, COLOR_WHITE, hInfo[houseid][h_x], hInfo[houseid][h_y], hInfo[houseid][h_z], 25.0, 0, 1);
}
return 1;
}
mfg