SA-MP Forums Archive
Loadturfs 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: Loadturfs problem (/showthread.php?tid=615440)



Loadturfs problem - AlexuTzVs - 22.08.2016

I have this problem where, is creating the territories from turfs.cfg but doesn't show them with the right color. Those are the codes and a picture so you can see
pawn Код:
for(new i = 0; i < sizeof(TurfInfo); i++)
{
     GangZoneShowForPlayer(playerid, Turfs[i], TurfInfo[i][zColor]);
}






public SaveTurfs()
{
    new idx;
    new File: file2;
    while (idx < sizeof(TurfInfo))
    {
        new coordsstring[128];
        format(coordsstring, sizeof(coordsstring), "%s|%s|%f|%f|%f|%f|%f|%f\n",
        TurfInfo[idx][zOwner],
        TurfInfo[idx][zColor],
        TurfInfo[idx][zMinX],
        TurfInfo[idx][zMinY],
        TurfInfo[idx][zMaxX],
        TurfInfo[idx][zMaxY]);
        if(idx == 0)
        {
            file2 = fopen("cfg/turfs.cfg", io_write);
        }
        else
        {
            file2 = fopen("cfg/turfs.cfg", io_append);
        }
        fwrite(file2, coordsstring);
        idx++;
        fclose(file2);
    }
    return 1;
}



Re: Loadturfs problem - Marricio - 22.08.2016

Hexadecimal colors are not strings, save them as integers and treat them as such.

Also, you're given the incorrect use to a .cfg file. That's a configuration type file, not to store gang zone data.


Re: Loadturfs problem - AlexuTzVs - 22.08.2016

i changed them, what should i do with the incorrect use of the .cfg files? how can i change it to work?