.cfg file help - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: .cfg file help (
/showthread.php?tid=192712)
.cfg file help -
Rainbow_Six - 23.11.2010
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;
}
Re: .cfg file help -
Zh3r0 - 23.11.2010
I guess MySql is made for this.
I guess you can only do this with Y_Ini, Dini, Dudb, etc...