SA-MP Forums Archive
Can't create big string variables? Running out of memory? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Can't create big string variables? Running out of memory? (/showthread.php?tid=578382)



Can't create big string variables? Running out of memory? - Shetch - 19.06.2015

My server has been acting up lately. I have a player data save function, but when it gets to a big query string size, it stop working completely and doesn't axacute anything after the variable decleration.

Code:
print("saving data");

new savename[24];
GetPlayerName(playerid, savename, 24);

print("saving data 0.1"); // This gets executed
new query[4096]; // This does NOT executed
print("saving data 0.2"); // This does NOT executed nor does anything after this line.
What is wrong here? I remember it used to work perfectly fine a while back, but now it just breaks and doesn't execute any command that the player data save function is in.


Re: Can't create big string variables? Running out of memory? - Shetch - 19.06.2015

I have managed to fix the problem.


Re: Can't create big string variables? Running out of memory? - SickAttack - 19.06.2015

You could either use "#pragma dynamic" or decrease the amount of cells you're using. Why do you even use that much? I know most roleplay servers have heaps of player data to save, but overall not much of it is actually noticeable. In my opion, large amounts of data isn't really required; but in some cases, it is (not all of the time). You could also separate users' preferences from the actual player data; well, if you have any.