.cfg file help
#1

How can I turn the following code into a .cfg ?

pawn Код:
format(string, sizeof(string), "UPDATE points SET owner='%s', vulnerable=%d WHERE id=%d", Points[i][Owner], Points[i][Vulnerable], i+1);
samp_mysql_query(string);
Something like

pawn Код:
public LoadTurfs()
{
    new arrCoords[6][64];
    new strFromFile2[256];
    new File: file = fopen("cfg/turfs.cfg", io_read);
    if (file)
    {
        new idx;
        while (idx < sizeof(TurfInfo))
        {
            fread(file, strFromFile2);
            split(strFromFile2, arrCoords, '|');
            strmid(TurfInfo[idx][zOwner], arrCoords[0], 0, strlen(arrCoords[0]), 255);
            strmid(TurfInfo[idx][zColor], arrCoords[1], 0, strlen(arrCoords[1]), 255);
            TurfInfo[idx][zMinX] = floatstr(arrCoords[2]);
            TurfInfo[idx][zMinY] = floatstr(arrCoords[3]);
            TurfInfo[idx][zMaxX] = floatstr(arrCoords[4]);
            TurfInfo[idx][zMaxY] = floatstr(arrCoords[5]);
            idx++;
        }
        fclose(file);
    }
    return 1;
}
Reply
#2

I guess MySql is made for this.
I guess you can only do this with Y_Ini, Dini, Dudb, etc...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)