help eith files
#1

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
Reply
#2

HELP?
Reply
#3

Some one?
Reply
#4

I didnt get it well what are you saying?
Reply
#5

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.
Reply
#6

i Have dir whit Usrs file.
i need to count hoe match files i have..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)