12.04.2013, 17:58
You need to add a File tag to filehandle
That should fix it
Код:
stock INI_GetInt(File:filehandle, Key[], &dest) { new pos, line[MAX_FILE_STRING]; while( fread(filehandle, line) ) { if( (pos = strfind(line, Key, false)) != -1 ) {//-1 would be not find new idx = pos + strlen(Key) + 1; if(line[idx] == ' ') {//the value is nothing idx = pos + strlen(Key) + 2;//if the = sign is further across if(idx > strlen(line)) return -1; //there was no value found dest = (idx < sizeof(line)) ? strval(line[idx]) : 0; return 1; } dest = (idx < sizeof(line)) ? strval(line[idx]) : 0; return 1; } } return 0; }