• New Line using file.Append or file.Write
    2 replies, posted
So im working on a ulx command that when used will write a line of text to a txt file in the data folder and this file will serve as the donations log for my server. This is what i have so far but obviously this will only make it go down to 2 lines, i lack the coding knowledge to make it create a new line everytime, so if anyone could help that would be great. [CODE]local old = file.Read("donationslog.txt","DATA") local new = (old .. target_ply:Nick() .. "(" .. target_ply:SteamID() .. ") Bought a custom trail \n") file.Write("donationslog.txt", new) [/CODE] this would output the following if the command was run 4 times: <Name><SteamID> donated for a custom trail <Name><SteamID> donated for a custom trail<Name><SteamID> donated for a custom trail<Name><SteamID> donated for a custom trail and obviously i want it to output the following: <Name><SteamID> donated for a custom trail <Name><SteamID> donated for a custom trail <Name><SteamID> donated for a custom trail <Name><SteamID> donated for a custom trail
Your code seems to be fine. Maybe it's your editor that's displaying the file incorrectly? [editline]30th April 2017[/editline] try \r\n instead of \n
I'm an idiot :o forgot that notpad is crap at displaying thing properly so i opened it in NP++ and it's fine, tnx :P
Sorry, you need to Log In to post a reply to this thread.