Quote:
Originally Posted by Kwarde
Well, I'm not sure if the solution is THAT obvious. Because this guy over here is asking to find something in the file by searching for "4#", and the fread (on the SA:MP Wiki) only shows how to read line-by-line. However, it still should be easy ;p
|
No,actually the point was to direct the pawn to the line I want to extract and pack it into a string without searching for a string.
Quote:
Originally Posted by VincentDunn
There is currently no function to specify which lines to search by, but this may work.
PHP код:
stock readfile()
{
new
File:file = fopen("file.txt", io_read),
string[128],
foundline = 0;
while(fread(file, string, sizeof(string)) {
if((strfind(string, "#4") != -1) && !foundline) {
foundline = 1;
continue;
}
if(foundline) {
printf("%s", string);
}
}
return 1;
}
Very impractical though.
|
Skipping lines ? smart,didn't thought about this.
anyway,found a solution,thanks you all for trying to help.