fread() issue with object material text
#1

I have a mapping system on my server that also saves material text, but if a player uses a new line (\n) in the text, it writes this to the file causing the script to think it's reading a new line.

How can I fix this? I tried extracting the \n's and turning them in to ~N~ for the file write, but failed. Any other ideas?
Reply
#2

Quote:
Originally Posted by MP2
View Post
I have a mapping system on my server that also saves material text, but if a player uses a new line (\n) in the text, it writes this to the file causing the script to think it's reading a new line.

How can I fix this? I tried extracting the \n's and turning them in to ~N~ for the file write, but failed. Any other ideas?
Make it write to the file like "\ n" then while loading strdel that space
I don't know if that would work TBH...
Reply
#3

Ah fixed it, I put the wrong string in the 'replace' function! I also had to replace spaces in font names with underscores (as spaces separate the params).

I've managed to make "\n" convert to "~N~" when being written and back when being read.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)