How to count the number of files in a directory?
#1

I want to count how many registered player the server currently has.
Now my user accounts are on (/scriptfiles/UserAccounts/)

And I want to count how many files exist in that folder, so if I have 4 accounts, the message should return 4

Example:
pawn Code:
public OnPlayerConnect(playerid)
{
    new filecount;
    filecount = // dunno what to do here
    SendClientMessage(playerid, 0xFFFFFF, "Welcome to the server. Database has %i registered accounts",filecount);
    return 1;
}
I don't know what I just did there^ but you got the point.
Oh and by the way I use y_ini to load and save my userfiles if that helps
Reply


Messages In This Thread
How to count the number of files in a directory? - by Neil. - 16.01.2013, 03:56
Re: How to count the number of files in a directory? - by Vince - 16.01.2013, 05:11
Re: How to count the number of files in a directory? - by Neil. - 16.01.2013, 05:33
Re: How to count the number of files in a directory? - by RajatPawar - 16.01.2013, 05:35
Re: How to count the number of files in a directory? - by Neil. - 16.01.2013, 05:44
Re: How to count the number of files in a directory? - by Babul - 16.01.2013, 06:06

Forum Jump:


Users browsing this thread: 1 Guest(s)