help eith 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: help eith files (
/showthread.php?tid=333210)
help eith files -
Swimor - 10.04.2012
I want to check some files have a specific folder.
For example if there are 10 files in the folder TEST then it will return me the number 10.
How? Thank you Rafael
Re: help eith files -
Swimor - 11.04.2012
HELP?
Re: help eith files -
Swimor - 12.04.2012
Some one?
Re: help eith files -
sanjil_rijal - 12.04.2012
I didnt get it well what are you saying?
Re: help eith files -
antonio112 - 12.04.2012
Well, it all depends ... If the file names are numeric in order (like: 1, 2, 3, 4, etc etc), it's not that hard but if the files are player names, it would be impossible. Let's say you have the file names in numeric order:
pawn Код:
#define FilePath "Test/%i.ini" // Don't forget, "Test" is the folder you want to count the files in. Change it to what you have
#define MAX_FILES 100 // MAX_FILES is the number of maximum files allowed in the folder. You can change it to whatever
CMD:count(playerid, params[])
{
new count = 0, string[64];
for(new f; f<MAX_FILES; f++)
if(fexist(FilePath(f))
count ++;
format(string, sizeof string, "A total of %i files exist.");
SendClientMessage(playerid, -1, string);
return 1;
}
stock FilePath(fileid)
{
new str[20];
format(str,sizeof str, FILEPATH, fileid);
return str;
}
Something like this should be done. But like I said earlier ... This is just in case you saved the files in numerical order.
Re: help eith files -
Swimor - 12.04.2012
i Have dir whit Usrs file.
i need to count hoe match files i have..