forward LoadHouseExecute(playerid);
public LoadHouseExecute(playerid)
{
new rows;
cache_get_row_count(rows);
for(new i,idh,string[128]; i<rows; i++)
{
idh=GetFreeHouseID();
cache_get_value_name_int(i,"id",HausInfo[idh][h_ID]);
cache_get_value_name(i,"hbesitzer",HausInfo[idh][hbesitzer]);
cache_get_value_name_float(i,"h_x",HausInfo[idh][h_x]);
cache_get_value_name_float(i,"h_y",HausInfo[idh][h_y]);
cache_get_value_name_float(i,"h_z",HausInfo[idh][h_z]);
cache_get_value_name_float(i,"hi_x",HausInfo[idh][ih_x]);
cache_get_value_name_float(i,"hi_y",HausInfo[idh][ih_y]);
cache_get_value_name_float(i,"hi_z",HausInfo[idh][ih_z]);
cache_get_value_name_int(i,"h_int",HausInfo[idh][h_int]);
cache_get_value_name_int(i,"h_world",HausInfo[idh][h_int]);
cache_get_value_name_int(i,"hpid",HausInfo[idh][hpid]);
cache_get_value_name_int(i,"hpreis",HausInfo[idh][hpreis]);
if(!HausInfo[idh][hbesitzer][0])
{
HausInfo[idh][hpid]=CreatePickup(1273,1,HausInfo[idh][h_x],HausInfo[idh][h_y],HausInfo[idh][h_z],0);
format(string,sizeof(string),"Dieses Haus steht zum Verkauf\nKosten:%d$\nTippe /buyhouse",HausInfo[idh][hpreis]);
HausInfo[idh][htext]=Create3DTextLabel(string,COLOR_WHITE,HausInfo[idh][h_x],HausInfo[idh][h_y],HausInfo[idh][h_z],10,0,1);
}
else
{
HausInfo[idh][hpid]=CreatePickup(1239,1,HausInfo[idh][h_x],HausInfo[idh][h_y],HausInfo[idh][h_z],0);
format(string,sizeof(string),"Besitzer:%s",HausInfo[idh][hbesitzer]);
HausInfo[idh][htext]=Create3DTextLabel(string,COLOR_WHITE,HausInfo[idh][h_x],HausInfo[idh][h_y],HausInfo[idh][h_z],10,0,1);
}
}
return 1;
}
Alles anzeigen