11.02.2015, 03:59
can you try this and tell me what did it print?:
pawn Код:
forward LoadFurn(id);
public LoadFurn(id)
{
new arrCoords[8][64], strFromFile2[255], string[255];
format(string, sizeof(string), "housedata/%d.ini", id);
if(!DOF2_FileExists(string)) return true;
new File: file = fopen(string, io_read);
if (file)
{
new idx;
while (idx < MAX_HOUSE_OBJ)
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
if(strval(arrCoords[0]) >= 1)
{
HouseInfo[id][hoID][idx] = strval(arrCoords[0]);
HouseInfo[id][hoX][idx] = floatstr(arrCoords[1]);
HouseInfo[id][hoY][idx] = floatstr(arrCoords[2]);
HouseInfo[id][hoZ][idx] = floatstr(arrCoords[3]);
HouseInfo[id][horX][idx] = floatstr(arrCoords[4]);
HouseInfo[id][horY][idx] = floatstr(arrCoords[5]);
HouseInfo[id][horZ][idx] = floatstr(arrCoords[6]);
HouseInfo[id][hoInt][idx] = strval(arrCoords[7]);
//==========//
HouseInfo[id][hObject][idx] = CreateDynamicObject(HouseInfo[id][hoID][idx], HouseInfo[id][hoX][idx], HouseInfo[id][hoY][idx], HouseInfo[id][hoZ][idx], HouseInfo[id][horX][idx], HouseInfo[id][horY][idx], HouseInfo[id][horZ][idx], id);
}
print("Object Created!");
printf("ID:%d",id);
idx++;
}
}
fclose(file);
return 1;
}