[Help] Passing a 2d array (a string array) into fwrite?
#1

I've got some formatting error were only certain characters of my string are successfully passed into fwrite..

I'm working on a statistics script where it stores the top 5 results in a text file, I started by reading from the text file and copying each line of the file into a 2d array:

Code:
new highscore[4][30];

while(fread(read, string))
{
  		strdel(highscore[hsCount], 0, 30);
                strcat(highscore[hsCount], string);
                hsCount++;
}
Now this works fine and when I go to print a line from the file using SendClientMessage it will works perfectly and prints the entire word:

Code:
SendClientMessageToAll(red, highscore[0]);
However whenever I try to pass my 2d array it into fwrite or format another string:

Code:
fwrite(location, highscore[0]);
format(text,sizeof(text),"%s", highscore[0]);
SendClientMessageToAll(orange, text);
it only includes the every 4th character in the string and not the entire word??

I only have this problem when using 2d arrays but it's the easiest way to sort and re-order each word into alphabetical order

Any help would be appreciated
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)