lava172
Умник
Вообщем перевел дома на mysql. В итоге они исчезли. Похоже что-то с загрузкой.
PHP:
#define MAX_HOUSE 800
new totalhouse;
enum hInfo
{
houseid,
Float:hEntrancex,
Float:hEntrancey,
Float:hEntrancez,
Float:hExitx,
Float:hExity,
Float:hExitz,
hOwner[MAX_PLAYER_NAME],
hValue,
hInt,
hLock,
hOwned,
hRentabil,
hDate,
hVirtual,
Name[60],
Money
};
new HouseInfo[MAX_HOUSE][hInfo];
new Text3D:hhh[MAX_HOUSE];
new pph[MAX_HOUSE];
new iih[MAX_HOUSE];
PHP:
stock HouseInit()
{
new string[64];
mysql_format(mysql_connect_ID, string, sizeof(string), "SELECT * FROM `Houses`");
mysql_function_query(mysql_connect_ID, string, true, "UploadHouses","","");
return false;
}
PHP:
publics UploadHouses()
{
new rows, fields, string[128];
cache_get_data(rows, fields);
if(rows)
{
for(new f;f<rows;f++)
{
new temp[64];
cache_get_field_content(0, "houseid", temp), HouseInfo[f][houseid] = strval(temp);
cache_get_field_content(0, "hEntrancex", temp), HouseInfo[f][hEntrancex] = floatstr(temp);
cache_get_field_content(0, "hEntrancey", temp), HouseInfo[f][hEntrancey] = floatstr(temp);
cache_get_field_content(0, "hEntrancez", temp), HouseInfo[f][hEntrancez] = floatstr(temp);
cache_get_field_content(0, "hExitx", temp), HouseInfo[f][hExitx] = floatstr(temp);
cache_get_field_content(0, "hExity", temp), HouseInfo[f][hExity] = floatstr(temp);
cache_get_field_content(0, "hExitz", temp), HouseInfo[f][hExitz] = floatstr(temp);
cache_get_field_content(0, "hOwner", HouseInfo[f][hOwner]);
cache_get_field_content(0, "hValue", temp), HouseInfo[f][hValue] = strval(temp);
cache_get_field_content(0, "hInt", temp), HouseInfo[f][hInt] = strval(temp);
cache_get_field_content(0, "hLock", temp), HouseInfo[f][hLock] = strval(temp);
cache_get_field_content(0, "hOwned", temp), HouseInfo[f][hOwned] = strval(temp);
cache_get_field_content(0, "hRentabil", temp), HouseInfo[f][hRentabil] = strval(temp);
cache_get_field_content(0, "hDate", temp), HouseInfo[f][hDate] = strval(temp);
cache_get_field_content(0, "hVirtual", temp), HouseInfo[f][hVirtual] = strval(temp);
cache_get_field_content(0, "Hname", HouseInfo[f][Name]);
cache_get_field_content(0, "Money", temp), HouseInfo[f][Money] = strval(temp);
if(HouseInfo[f][hOwned] == 0)
{
f(string,"{E2FE23}Дом номер: %d\n{C2FF22}Этот дом продается\n{A7FE23}Цена: %d$",HouseInfo[f][houseid],HouseInfo[f][hValue]);
hhh[f] = CreateDynamic3DTextLabel(string,0x45D14DFF,HouseInfo[f][hEntrancex],HouseInfo[f][hEntrancey],HouseInfo[f][hEntrancez],20);
iih[f] = CreateDynamicMapIcon(HouseInfo[f][hEntrancex],HouseInfo[f][hEntrancey],HouseInfo[f][hEntrancez],31, -1, 0, 0,-1,100);
pph[f] = CreateDynamicPickup(1273, 1, HouseInfo[f][hEntrancex], HouseInfo[f][hEntrancey], HouseInfo[f][hEntrancez]);
if(HouseInfo[f][houseid] == 429)
{
f(string,"{E2FE23}Дом номер: 1488\n{C2FF22}Этот дом продается\n{A7FE23}Цена: %d$",HouseInfo[f][hValue]);
UpdateDynamic3DTextLabelText(hhh[f],0x45D14DFF,string);
}
}
if(HouseInfo[f][hOwned] == 1)
{
iih[f] = CreateDynamicMapIcon(HouseInfo[f][hEntrancex],HouseInfo[f][hEntrancey],HouseInfo[f][hEntrancez],32, -1, 0, 0,-1,100);
pph[f] = CreateDynamicPickup(1272, 1, HouseInfo[f][hEntrancex], HouseInfo[f][hEntrancey], HouseInfo[f][hEntrancez]);
switch(HouseInfo[f][hLock])
{
case 0://закрыт
{
f(string,"{7CA3F3}Номер дома: %d\nНазвание: {FFFFFF}%s\n{7CA3F3}Владелец: %s\nСтатус: {FF0000}Закрыт", HouseInfo[f][houseid], HouseInfo[f][Name], HouseInfo[f][hOwner]);
hhh[f] = CreateDynamic3DTextLabel(string,0x37E3ECFF,HouseInfo[f][hEntrancex],HouseInfo[f][hEntrancey],HouseInfo[f][hEntrancez],20);
if(HouseInfo[f][houseid] == 429)
{
f(string,"{7CA3F3}Номер дома: 1488\nНазвание: {FFFFFF}%s\n{7CA3F3}Владелец: %s\nСтатус: {FF0000}Закрыт", HouseInfo[f][Name], HouseInfo[f][hOwner]);
UpdateDynamic3DTextLabelText(hhh[f],0x45D14DFF,string);
}}
case 1://открыт
{
f(string,"{7CA3F3}Номер дома: %d\nНазвание: {FFFFFF}%s\n{7CA3F3}Владелец: %s\nСтатус: {00FF00}Открыт", HouseInfo[f][houseid], HouseInfo[f][Name], HouseInfo[f][hOwner]);
hhh[f] = CreateDynamic3DTextLabel(string,0x37E3ECFF,HouseInfo[f][hEntrancex],HouseInfo[f][hEntrancey],HouseInfo[f][hEntrancez],20);
if(HouseInfo[f][houseid] == 429)
{
f(string,"{7CA3F3}Номер дома: 1488\nНазвание: {FFFFFF}%s\n{7CA3F3}Владелец: %s\nСтатус: {00FF00}Открыт", HouseInfo[f][Name], HouseInfo[f][hOwner]);
UpdateDynamic3DTextLabelText(hhh[f],0x45D14DFF,string);
}}}
if(HouseInfo[f][hVirtual] == 0)
{
f(string,"{7CA3F3}Номер дома: %d\nНазвание: {FFFFFF}%s\n{7CA3F3}Владелец: %s", HouseInfo[f][houseid], HouseInfo[f][Name], HouseInfo[f][hOwner]);
UpdateDynamic3DTextLabelText(hhh[f],0x45D14DFF,string);
}}
}
totalhouse = rows;
}
return false;
}
