Loadturfs problem
#1

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;
}
Reply
#2

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.
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)