17.08.2015, 15:06
pawn Код:
stock FUcitajNiz(a[][], nizfile[], &n, a_size = sizeof(a), a_len = sizeof(a[]))
{
new UpisData[128];
new File: UpisFajl;
UpisFajl = fopen(nizfile, io_read);
if(UpisFajl)
{
n = 0;
while ( n < a_size && fread( UpisFajl , UpisData ) )
strcat(a[n++], UpisData, a_len);
fclose(UpisFajl);
}
}
pawn Код:
new a[5][20],n;
FUcitajNiz(a, "file_name_here", n);
for(new i=0; i < n; i++)
print(a[i]);