02.08.2013, 22:18
ok well i have a GF gamemode . today i "STEAL" a Turf War from a gamemode all's ok but! the turfs don't appear on map ! On gamemode don't have to make In-Gamemode turfs , The turfs make from "gzone".cfg"
Who can give me a example how to make in gzones.cfg a turf ? please help me
Код:
ublic LoadZones()
{
new arrCoords[6][64];
new strFromFile2[256];
new File: file = fopen("gzones.cfg", io_read);
if (file)
{
new idx;
while (idx < sizeof(ZoneInfo))
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, '|');
strmid(ZoneInfo[idx][zOwner], arrCoords[0], 0, strlen(arrCoords[0]), 255);
ZoneInfo[idx][zMinX] = floatstr(arrCoords[1]);
ZoneInfo[idx][zMinY] = floatstr(arrCoords[2]);
ZoneInfo[idx][zMaxX] = floatstr(arrCoords[3]);
ZoneInfo[idx][zMaxY] = floatstr(arrCoords[4]);
ZoneInfo[idx][zTeam] = strval(arrCoords[5]);
printf("(%d) Echipa:%d Ownerul:%s",idx,ZoneInfo[idx][zTeam],ZoneInfo[idx][zOwner]);
idx++;
}
fclose(file);
}
return 1;
}
public SaveZones()
{
new idx;
new File: file2;
while (idx < sizeof(ZoneInfo))
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%s|%f|%f|%f|%f|%d\n",
ZoneInfo[idx][zOwner],
ZoneInfo[idx][zMinX],
ZoneInfo[idx][zMinY],
ZoneInfo[idx][zMaxX],
ZoneInfo[idx][zMaxY],
ZoneInfo[idx][zTeam]);
if(idx == 0)
{
file2 = fopen("gzones.cfg", io_write);
}
else
{
file2 = fopen("gzones.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
return 1;
}

