Hallo Brotfische,
Bei dem Haussystem wird beim laden immer die MysqlID 0 ausgelesen.
OnGameModeInit:
new querye[256];
format(querye, sizeof(querye), "SELECT * FROM haus");
mysql_function_query(dbhandle, querye, true, "OnHausesLoad", "");
Public:
public OnHausesLoad()
{
new num_fields,num_rows;
cache_get_data(num_rows,num_fields,dbhandle);
printEx("Numrows: %d Numfields: %d",num_rows,num_fields);
if(!num_rows)return 0;
for(new i=0; i<num_rows; i++)
{
new id=getFreeHausID();
hInfo[id][h_x] = cache_get_field_content_float(i, "h_x", dbhandle);
hInfo[id][h_y] = cache_get_field_content_float(i, "h_y", dbhandle);
hInfo[id][h_z] = cache_get_field_content_float(i, "h_z", dbhandle);
hInfo[id][ih_x] = cache_get_field_content_float(i, "ih_x", dbhandle);
hInfo[id][ih_y] = cache_get_field_content_float(i, "ih_y", dbhandle);
hInfo[id][ih_z] = cache_get_field_content_float(i, "ih_z", dbhandle);
hInfo[id][h_interior] = cache_get_field_content_int(i, "h_interior", dbhandle);
new tmp_name[MAX_PLAYER_NAME];
cache_get_field_content(i, "besitzer", tmp_name, dbhandle);
format(hInfo[id][h_besitzer],25,tmp_name);
hInfo[id][h_id] = cache_get_field_content_int(i, "id", dbhandle);
hInfo[id][h_preis] = cache_get_field_content_int(i, "h_preis", dbhandle);
hInfo[id][h_mietpreis] = cache_get_field_content_int(i, "h_mietpreis", dbhandle);
hInfo[id][h_maxmieter] = cache_get_field_content_int(i, "h_maxmieter", dbhandle);
hInfo[id][h_geschlossen] = cache_get_field_content_int(i, "h_geschlossen", dbhandle);
updateHaus(id);
printEx("i = %d - id = %d - MySQLID: %d - Besitzer: %s", i, id, hInfo[id][h_id],hInfo[id][h_besitzer]);
}
return 1;
}
Ich hoffe ihr könnt mir helfen
MfG German_ScripterHD