28.12.2012, 13:05
I haven't used sscanf for more stuff than the usage on commands, but try something like this
I'm not 100 percent sure about the increasement of the i before the if statement, I mean I am not sure if it works as you'd like to work. And make sure you write on the file like this.
pawn Код:
// --
new i=0;
new File:ftw=fopen("1.txt",io_read);
while(ftw)
{
new string[200];
fread(ftw, string);
if(isnull(string)) return 1;
new integ, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz;
sscanf(string, "p<,>iffffff", integ, x, y, z, rx, ry, rz);
//printf("test");
printf("\nInteger=%d\nx=%f\ny=%f\nz=%f\nrx=%f\nry=%f\nrz=%f\n",integ,x,y,z,rx,ry,rz);
CreateDynamicObject(integ,x,y,z,rx,ry,rz);
i++;
if(i==1) AddPlayerClass(150,x,y,z+4,5.4011,0,0,0,0,0,0);
}
pawn Код:
// An example of 1.txt
2000,5.0,5.0,5.0,5.0,5.0,5.0