Gzones.cFg problem
#1

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"


Код:
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;
}
Who can give me a example how to make in gzones.cfg a turf ? please help me
Reply
#2

You need to add GangZoneCreate during the loading of variables.

So in your code, under "ZoneInfo[idx][zTeam] = strval(arrCoords[5]);" you would place:

Код:
ZoneInfo[idx][zGangZone] = GangZoneCreate(ZoneInfo[idx][zMinX], ZoneInfo[idx][zMinY], ZoneInfo[idx][zMaxX], ZoneInfo[idx][zMaxY]);
You might need to define the variable "zGangZone" or it might exist already in your array.
Reply
#3

No don't need to add gangzonecreate bla bla ! On the origial gamemode don't have have gangzone create during load variable! need a example how to create gzones.cfg
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)