Thread Rating:
  • 2 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
File Loader v1.0
#9
You're welcome Smile
I'm getting more and more confused with this. This is my code:

Code:
local file = fileOpen("saveFiles/Players/" + name + ".txt", "r+");
local buffer = "";

while(fileRead(file, buffer))
{
   buffer = format("%s", buffer);
}

The formatting seems to crash the server most of the time (Not always) when one of the lines in the file contains a very long string.

"test"

 doesn't crash, but

"ITSC_LIGHTHEAL{equipped{0}amount{1}}ITMI_RAKE{equipped{0}amount{1}}ITFO_APPLE{equipped{0}amount{199}}ITPL_TEMP_HERB{equipped{0}amount{1}}" does.

When I don't format, it doesn't crash and when I print out the buffer-variable, it works fine, concatenation doesn't work properly though. When concatenating it will only use a few letters and cut the rest off for some reason. I need to concatenate though, since there seems to be a maximum length when using fileRead and I am saving the inventory of the players as a big string.

I'm running out of ideas how to work around this, so: What am I doing wrong? O.o I just don't get it.
Reply


Messages In This Thread
File Loader v1.0 - by Nubzior - 09.10.2015, 17:13
RE: File Loader v0.3 - by Axe - 07.12.2015, 07:21
RE: File Loader v0.3 - by Sative - 07.12.2015, 09:53
RE: File Loader v0.3 - by Axe - 07.12.2015, 12:55
RE: File Loader v0.3 - by Sative - 07.12.2015, 12:57
RE: File Loader v0.3 - by Axe - 07.12.2015, 13:06
RE: File Loader v0.3 - by HammelGammel - 07.12.2015, 14:04
RE: File Loader v0.3 - by Axe - 07.12.2015, 17:27
RE: File Loader v0.3 - by HammelGammel - 07.12.2015, 21:22
RE: File Loader v0.3 - by Bimbol - 23.12.2015, 21:49
RE: File Loader v0.3 - by HammelGammel - 23.12.2015, 22:27
RE: File Loader v0.4 - by Nubzior - 12.01.2016, 09:57
RE: File Loader v0.4 - by HammelGammel - 12.01.2016, 13:26
RE: File Loader v0.4 - by Nubzior - 14.01.2016, 08:06
RE: File Loader v0.4 - by HammelGammel - 14.01.2016, 16:31
RE: File Loader v0.4 - by Nubzior - 30.01.2016, 09:13
RE: File Loader v0.4 - by HammelGammel - 30.01.2016, 16:26
RE: File Loader v0.4 - by Nubzior - 09.02.2016, 03:10
RE: File Loader v1.0 - by HammelGammel - 09.02.2016, 20:16
RE: File Loader v1.0 - by Nubzior - 09.02.2016, 20:24

Forum Jump:


Users browsing this thread: 1 Guest(s)