Gzones.cFg problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Gzones.cFg problem (
/showthread.php?tid=455718)
Gzones.cFg problem -
Kapone21 - 02.08.2013
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
Re: Gzones.cFg problem -
SMCentral - 02.08.2013
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.
Re: Gzones.cFg problem -
Kapone21 - 03.08.2013
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