16.10.2010, 22:49
Well that won't work like I said, since strval will just give you the integer value of the string, not extract numbers from it.
Although you could use a split function, to split the string by spaces, a rough example using sscanf by ******.
You could also use sscanf to immediately store the score as an integer, like this:
Although you could use a split function, to split the string by spaces, a rough example using sscanf by ******.
pawn Код:
new string[2][10], score;
File: hsfile = fopen("/Top5/Top5.ini", io_read);
fread(hsfile, tmp, 128);
sscanf(tmp,"s[10]s[10]",string[0],string[1]);
printf("MyName: %s || MyScore: %d",string[0],strval(string[1]));
pawn Код:
sscanf(tmp,"s[10]d",string,score);