PHP код:
forward LoadSBiznes();
public LoadSBiznes()
{
new rows;
cache_get_row_count(rows);
if(rows)
{
static const h_null[] = "{FFDEAD}[ID: {FFFFFF}%d{FFDEAD}]\n%s\n{FFDEAD}Владелец: {FFFFFF}Нет\n{FFDEAD}Стоимость: {FFFFFF}%d\n{FFDEAD}Уровень: {FFFFFF}%d";
static const h_not_null[] = "{FFDEAD}[ID: {FFFFFF}%d{FFDEAD}]\n%s\n{FFDEAD}Владелец: {FFFFFF}%s";
new h_buff[sizeof(h_null) + ((3-2) + (24-2) + (30-2) + (20-2) + (5-2))];
for(new b = 0; b < rows; b++)
{
cache_get_value_name(b,"name_sbiz",SBizInfo[b][sbName], 30);
cache_get_value_name_int(b,"id",SBizInfo[b][sbID]);
cache_get_value_name(b,"owner",SBizInfo[b][sbOwner],MAX_PLAYER_NAME);
cache_get_value_name_int(b, "owned", SBizInfo[b][sbOwned]);
cache_get_value_name_float(b, "enter_pos_x", SBizInfo[b][sbenter_pos_x]);
cache_get_value_name_float(b, "enter_pos_y", SBizInfo[b][sbenter_pos_y]);
cache_get_value_name_float(b, "enter_pos_z", SBizInfo[b][sbenter_pos_z]);
cache_get_value_name_int(b, "price", SBizInfo[b][sbPrice]);
cache_get_value_name_int(b, "level", SBizInfo[b][sbLevel]);
cache_get_value_name_int(b, "profit", SBizInfo[b][sbProfit]);
TOTALSBIZ++;
if(!SBizInfo[b][sbOwned])
{
format(h_buff, sizeof(h_buff), h_null, SBizInfo[b][sbID], SBizInfo[b][sbName], SBizInfo[b][sbPrice],SBizInfo[b][sbLevel]);
SBizInfo[b][sbPickup] = CreatePickup(1239, 1, SBizInfo[b][sbenter_pos_x], SBizInfo[b][sbenter_pos_y], SBizInfo[b][sbenter_pos_z], -1);
SBizInfo[b][sbText] = Create3DTextLabel(h_buff, 0x008080FF, SBizInfo[b][sbenter_pos_x], SBizInfo[b][sbenter_pos_y], SBizInfo[b][sbenter_pos_z], 7, 0);
}
else
{
format(h_buff, sizeof(h_buff), h_not_null, SBizInfo[b][sbID], SBizInfo[b][sbName], SBizInfo[b][sbOwner]);
SBizInfo[b][sbPickup] = CreatePickup(1239, 1, SBizInfo[b][sbenter_pos_x], SBizInfo[b][sbenter_pos_y], SBizInfo[b][sbenter_pos_z], -1);
SBizInfo[b][sbText] = Create3DTextLabel(h_buff, 0xFFFFFF, SBizInfo[b][sbenter_pos_x], SBizInfo[b][sbenter_pos_y], SBizInfo[b][sbenter_pos_z], 7.0, 0);
}
}
}
printf("[ЗАГРУЖЕНО CБИЗНЕСОВ]: <%d>.", TOTALSBIZ);
return 1;
}