Quote:
Originally Posted by __[ShaDoW]__
Can you add this functions ?:
pawn Код:
GetFileInDirectoryByIndex(index,dir[], return_filename[], len); CountFilesInDirectory(dir[]);
For example we have 5 files in directory "mydir" called: file1, lolfile, xfile, nyanfile, evilfile
Function GetFileInDirectoryByIndex will be return this file names by index:
pawn Код:
EXAMPLE 1:
GetFileInDirectoryByIndex(1,"mydir") = file1 GetFileInDirectoryByIndex(2,"mydir") = lolfile GetFileInDirectoryByIndex(3,"mydir") = xfile GetFileInDirectoryByIndex(4,"mydir") = nyanfile GetFileInDirectoryByIndex(5,"mydir") = evilfile
pawn Код:
EXAMPLE 2: new fname[50]; for(new f = 1; f < CountFilesInDirectory("mydir"); f++) { GetFileInDirectoryByIndex(f,"mydir", fname, sizeof(fname)); printf("File index:%d name:%s",f,fname); }
did you understand ?
|
Yes, I will add that. Update will be soon.