PDA

View Full Version : LoadHouses() public freezes server.


Jack_Leslie
10/10/2011, 05:22 AM
Hi guys.

I have this:

public LoadHouses() {
new arrCoords[21][64];
new strFromFile2[256];
new File: file = fopen("Houses.cfg", io_read);
if (file)
{
new idx;
while (idx < sizeof(HouseInfo))
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, '|');
HouseInfo[idx][hOwned] = strval(arrCoords[0]);
HouseInfo[idx][hPrice] = strval(arrCoords[1]);
strmid(HouseInfo[idx][hOwner], arrCoords[2], 0, strlen(arrCoords[2]), 255);
HouseInfo[idx][hLevel] = strval(arrCoords[3]);
HouseInfo[idx][hLocked] = strval(arrCoords[4]);
HouseInfo[idx][hRentable] = strval(arrCoords[5]);
HouseInfo[idx][hRentPrice] = strval(arrCoords[6]);
HouseInfo[idx][hGun1] = strval(arrCoords[7]);
HouseInfo[idx][hGun2] = strval(arrCoords[8]);
HouseInfo[idx][hGun3] = strval(arrCoords[9]);
HouseInfo[idx][hMoney] = strval(arrCoords[10]);
HouseInfo[idx][hEntranceX] = floatstr(arrCoords[11]);
HouseInfo[idx][hEntranceY] = floatstr(arrCoords[12]);
HouseInfo[idx][hEntranceZ] = floatstr(arrCoords[13]);
HouseInfo[idx][hEntranceA] = floatstr(arrCoords[14]);
HouseInfo[idx][hExitX] = floatstr(arrCoords[15]);
HouseInfo[idx][hExitY] = floatstr(arrCoords[16]);
HouseInfo[idx][hExitZ] = floatstr(arrCoords[17]);
HouseInfo[idx][hExitA] = floatstr(arrCoords[18]);
HouseInfo[idx][hInt] = strval(arrCoords[19]);
HouseInfo[idx][hWorld] = strval(arrCoords[20]);

}
fclose(file);
}
return 1;
}

EDIT:
Fixed, forgot idx++; :P