06.02.2018, 03:58
Here is a way to reduce memory usage:
In your case, if you have large constant arrays/strings which you use to display, just convert to "static".
PHP код:
CMD:commands(playerid) {
new list[1500];
strcat(list, ...); // you put tons of text into "list"
ShowPlayerDialog(playerid, ..., list, ...);
}
/*
Now this is another way of doing things! And this way is faster too!
NOTE: you should use this only for constant texts i.e. strings/arrays that never change.
*/
CMD:commands(playerid) {
static list[1500];
if (list[0] == EOS) { // now this will only do the strcat part one time: first time when this callback is called
strcat(list, ...); // you put tons of text into "list"
}
ShowPlayerDialog(playerid, ..., list, ...);
}