23.11.2010, 14:12
How can I turn the following code into a .cfg ?
Something like
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);
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;
}