Count # of files (dini)
#4

if you have files with names: 1.ini , 2.ini .......n.ini

you can do this:


put your max files value
pawn Код:
#define MAX_FILES 100//you can add more, 100 for example

then function:

pawn Код:
stock FilesCount()
{
    new fCount = 0, str[128];
    for(new i=0; i<MAX_FILES; i++)
    {
        format(str, sizeof str,"%s.ini",i);
        if(dini_Exists(str))
        {
            fCount++;
        }
    }
    return printf("i have %i files",fCount);
}
and put this function into GM init!
Reply


Messages In This Thread
Count # of files (dini) - by sciman001 - 24.04.2011, 01:05
Re: Count # of files (dini) - by Ricop522 - 24.04.2011, 02:34
Re: Count # of files (dini) - by sciman001 - 24.04.2011, 02:43
Re: Count # of files (dini) - by Nexotronix - 24.04.2011, 03:47
Re: Count # of files (dini) - by sciman001 - 24.04.2011, 03:53
Re: Count # of files (dini) - by Nexotronix - 24.04.2011, 03:55
Re: Count # of files (dini) - by sciman001 - 24.04.2011, 21:49
Re: Count # of files (dini) - by Jefff - 24.04.2011, 21:58
Re: Count # of files (dini) - by sciman001 - 24.04.2011, 22:17
Re: Count # of files (dini) - by Desertsoulz - 25.04.2011, 06:19

Forum Jump:


Users browsing this thread: 1 Guest(s)