Reading files - 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: Reading files (
/showthread.php?tid=288610)
Reading files -
Edga - 08.10.2011
Hello i am transfering my player files which are DINI to MYSQL DB and i was wondering if there is a way to loop through 20,000+ files without actually knowing the file names because every file is named differently.
For example:
Код:
new file[60];
for(new i=0; i<20000; i++)
{
format(file,sizeof(file),"( i can't tell you what this part is because all 20,000+ files are named differently ).ini");
if(!fexist(file)){ continue; }
else
{
//Transfer everythying to MYSQL
}
}
Re: Reading files -
BaubaS - 08.10.2011
I think this way is better:
In OnPlayerConnect (I think), check is there is a .ini file. If yes, re-write everything to mysql and delete the file.
Re: Reading files -
Edga - 08.10.2011
Quote:
Originally Posted by BaubaS
I think this way is better:
In OnPlayerConnect (I think), check is there is a .ini file. If yes, re-write everything to mysql and delete the file.
|
Yeah, but that will cause lag and i will have to always check for the ini file
Respuesta: Reading files -
OPremium - 08.10.2011
Y_Files:
https://sampforum.blast.hk/showthread.php?tid=177028
pawn Код:
new idxlol = 0, file[60];
while(ffind("*.ini", file, sizeof(file), idxlol))
{
//Transfer everything to MYSQL
}
Re: Reading files -
Tomejus - 20.10.2011
Quote:
Originally Posted by Edga
Yeah, but that will cause lag and i will have to always check for the ini file
|
Done that about a year ago (with old grp mode...) and that not causes lag. About a month later we removed the code and everything was okey! This is best way no doubt.