PDA

View Full Version : Opening files


cdoubleoper
11/10/2015, 11:22 AM
Hey. I wanna open all files that exist in folder which are named by numbers - but it ain't work. What's wrong?


new string[64];
new File:item;
for(new i = 0; i < MAX_ITEMS; i++){
if(item){
format(string, sizeof(string), "scriptfiles\\items\\%i.ini", i);
item=fopen(string, io_read);
printf("file %i", i);}}

AbyssMorgan
11/10/2015, 11:27 AM
new string[64];
new File:item;
for(new i = 0; i < MAX_ITEMS; i++){
format(string, sizeof(string), "/items/%i.ini", i); //in scriptfiles
if(fexist(string)){
item = fopen(string, io_read);
printf("file %i", i);
}
}

cdoubleoper
11/10/2015, 12:04 PM
Awesome, thank you.