18.01.2015, 23:18
Всем привет. Почему не загружаются дома, в чем ошибка?
PHP код:
stock LoadHouse()
{
if(!fexist("System/Houses.ini"))return print("[Ошибка] Файл System/Houses.ini не найден");
new file = ini_openFile("System/Houses.ini");
new STR[158]; new str[8]; new string[170];
for(new idx = 1; idx < sizeof(HouseInfo); idx++)
{
format(str,sizeof(str),"ID %d", idx);
ini_getString(file,str,STR);
sscanf(STR,"p<|>is[24]iffffffiiiiii", idx,
HouseInfo[idx][hOwner],
HouseInfo[idx][hOwned],
HouseInfo[idx][hEnterX],
HouseInfo[idx][hEnterY],
HouseInfo[idx][hEnterZ],
HouseInfo[idx][hExitX],
HouseInfo[idx][hExitY],
HouseInfo[idx][hExitZ],
HouseInfo[idx][hInt],
HouseInfo[idx][hWirtMir],
HouseInfo[idx][hPrice],
HouseInfo[idx][hLevel],
HouseInfo[idx][hRent],
HouseInfo[idx][hRentabil]);
printf("%i %s %i %f %f %f %f %f %f %i %i %i %i %i %i", idx,
HouseInfo[idx][hOwner],
HouseInfo[idx][hOwned],
HouseInfo[idx][hEnterX],
HouseInfo[idx][hEnterY],
HouseInfo[idx][hEnterZ],
HouseInfo[idx][hExitX],
HouseInfo[idx][hExitY],
HouseInfo[idx][hExitZ],
HouseInfo[idx][hInt],
HouseInfo[idx][hWirtMir],
HouseInfo[idx][hPrice],
HouseInfo[idx][hLevel],
HouseInfo[idx][hRent],
HouseInfo[idx][hRentabil]);
if(HouseInfo[idx][hOwned] == 0)
{
format(string, sizeof(string), "{FF6347}* Дом *{FFFFFF}\nАдрес: {7CFC00}Diamond City %i{FFFFFF}\nЦена: {7CFC00}$%i{FFFFFF}\nУровень: {7CFC00}%d{FFFFFF}", HouseInfo[idx][hID], HouseInfo[idx][hPrice], HouseInfo[idx][hLevel]);
HouseInfo[idx][hPickup] = CreatePickup(1273, 23, HouseInfo[idx][hEnterX], HouseInfo[idx][hEnterY], HouseInfo[idx][hEnterZ],-1);
HouseInfo[idx][hMIcon] = CreateDynamicMapIcon(HouseInfo[idx][hEnterX], HouseInfo[idx][hEnterY], HouseInfo[idx][hEnterZ], 31, COLOR_WHITE, 0, -1, -1, 400.0);
}
if(HouseInfo[idx][hOwned] == 1)
{
if(HouseInfo[idx][hRentabil] == 0) format(string, sizeof(string), "{FF6347}* Дом *{FFFFFF}\nАдрес: {7CFC00}Diamond City %i{FFFFFF}\nВладелец: {7CFC00}%s{FFFFFF}", HouseInfo[idx][hID], HouseInfo[idx][hOwner]);
else if(HouseInfo[idx][hRentabil] == 1) format(string, sizeof(string), "{FF6347}* Дом *{FFFFFF}\nАдрес: {7CFC00}Diamond City %i{FFFFFF}\nВладелец: {7CFC00}%s{FFFFFF}\nАренда: {7CFC00}$%d{FFFFFF}", HouseInfo[idx][hID], HouseInfo[idx][hOwner], HouseInfo[idx][hRent]);
HouseInfo[idx][hMIcon] = CreateDynamicMapIcon(HouseInfo[idx][hEnterX], HouseInfo[idx][hEnterY], HouseInfo[idx][hEnterZ], 32, COLOR_WHITE, 0, -1, -1, 400.0);
HouseInfo[idx][hPickup] = CreatePickup(1272, 23, HouseInfo[idx][hEnterX], HouseInfo[idx][hEnterY], HouseInfo[idx][hEnterZ],-1);
}
HouseInfo[idx][hLabel] = Create3DTextLabel(string,0xFFFFFFFF,HouseInfo[idx][hEnterX],HouseInfo[idx][hEnterY],HouseInfo[idx][hEnterZ]+1,20.0,0,1);
}
ini_closeFile(file);
return 1;
}