21.09.2013, 13:54
I wanna know how to get number of files in a directory using FileManager. I did this but it don't work ...
Код:
stock NumFiles(type2) { new string[50]; if(type2 == 1) format(string, sizeof(string), "Vehicles/normal/"); else if(type2 == 3) format(string, sizeof(string), "Vehicles/personal/"); else if(type2 == 4) format(string, sizeof(string), "Vehicles/faction/"); else if(type2 == 5) format(string, sizeof(string), "Vehicles/job/"); else if(type2 == 6) format(string, sizeof(string), "Vehicles/biz/"); new dir:dHandle = dir_open(string); new item[40], type, contor = -1; while(dir_list(dHandle, item, type)) { if(type == FM_FILE) contor++; } dir_close(dHandle); return contor; }