08.10.2012, 17:42
pawn Код:
enum bInfo
{
bName[128],
bLock,
bHours,
bPrice,
Float:bEnterX,
Float:bEnterY,
Float:bEnterZ,
Float:bExitX,
Float:bExitY,
Float:bExitZ,
bOwner[64],
bOwned,
bInterior,
bPickupID,
bType, // 0: None, 1: Gun Shop, 2: Bar, 3: Restaurant, 4: Store
bMoney,
};
new BizzInfo[58][bInfo];
}
public LoadBizz()
{
new arrCoords[23][64];
new strFromFile2[256];
new File: file = fopen("bizz.cfg", io_read);
if (file)
{
new idx;
while (idx < sizeof(BizzInfo))
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, '|');
BizzInfo[idx][bName] = strval(arrCoords[0]);
BizzInfo[idx][bLock] = strval(arrCoords[1]);
BizzInfo[idx][bHours] = strval(arrCoords[2]);
BizzInfo[idx][bPrice] = strval(arrCoords[3]);
BizzInfo[idx][bPrice] = strval(arrCoords[3]);
BizzInfo[idx][bEnterX] = floatstr(arrCoords[4]);
BizzInfo[idx][bEnterY] = floatstr(arrCoords[5]);
BizzInfo[idx][bEnterZ] = floatstr(arrCoords[6]);
BizzInfo[idx][bExitX] = floatstr(arrCoords[7]);
BizzInfo[idx][bExitY] = floatstr(arrCoords[8]);
BizzInfo[idx][bExitZ] = floatstr(arrCoords[9]);
strmid(BizzInfo[idx][bOwner], arrCoords[10], 0, strlen(arrCoords[1]), 255);
BizzInfo[idx][bOwned] = strval(arrCoords[11]);
BizzInfo[idx][bInterior] = strval(arrCoords[12]);
BizzInfo[idx][bType] = strval(arrCoords[13]);
BizzInfo[idx][bMoney] = strval(arrCoords[14]);
idx++;
}
fclose(file);
}
return 1;
}