15.01.2012, 19:15
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:
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:
However whenever I try to pass my 2d array it into fwrite or format another string:
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
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++; }
Code:
SendClientMessageToAll(red, highscore[0]);
Code:
fwrite(location, highscore[0]); format(text,sizeof(text),"%s", highscore[0]); SendClientMessageToAll(orange, text);
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