08.02.2011, 01:05
PHP код:
enum GangZone
{
gzID,
Float:gzMinX,
Float:gzMinY,
Float:gzMaxX,
Float:gzMaxY,
gzOwner,
gzColor[ 64 ]
}
new GangZones[10][GangZone];
PHP код:
public LoadZones()
{
new arrCoords[7][64];
new strFromFile2[256];
new File: file = fopen("zone.cfg", io_read);
if (file)
{
new idx;
while (idx < sizeof(GangZones))
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
GangZones[idx][ gzID ] = floatstr(arrCoords[0]);
GangZones[idx][ gzMinX ] = floatstr(arrCoords[1]);
GangZones[idx][ gzMinY ] = floatstr(arrCoords[2]);
GangZones[idx][ gzMaxX ] = floatstr(arrCoords[3]);
GangZones[idx][ gzMaxY ] = floatstr(arrCoords[4]);
GangZones[idx][gzOwner] = floatstr(arrCoords[5]);
strmid(GangZones[idx][gzColor], arrCoords[6], 0, strlen(arrCoords[6]), 255);
//printf("Turf:%d Name: %s Owner:%s MinX:%f MinY:%f MinZ:%f MaxX:%f MaxY:%f MaxZ:%f\n",
//idx,TurfInfo[idx][zName],TurfInfo[idx][zOwner],TurfInfo[idx][zMinX],TurfInfo[idx][zMinY],TurfInfo[idx][zMinZ],TurfInfo[idx][zMaxX],TurfInfo[idx][zMaxY],TurfInfo[idx][zMaxZ]);
idx++;
}
fclose(file);
}
return 1;
}