How do you mean?
As in read two files at once? Or just read from a file?
If you mean how to read in general:
PHP Code:
new line,file[128],text[128],length
copy(file,sizeof file -1,"file to read.txt")
while ( ( line = read_file(file,line,text,sizeof text -1 ,length) ) )
{
log_amx(text)
}
The "while" line might confuse you ...
First, the loop itself:
The code in {} after the while () will be executed again and again until the expression after while ( in () ) is no longer true.
And secondly the condition:
( line = x ) has the value of x, and sets line to x.
e.g.
PHP Code:
if ( ( line = 0 ) )
{
log_amx("hello")
}
would set line to 0, but not log anything (since 0 is false).
(without the extra pair of parentheses, you would get a "possibly unintended assignment" warning.
PHP Code:
if ( ( line = 1 ) )
{
log_amx("hello")
}
would set line to 1 and log hello (because 1 is true)