How to reduce the data size. It's about 100M [Need Help]
#4

Here is a way to reduce memory usage:
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, ...);

In your case, if you have large constant arrays/strings which you use to display, just convert to "static".
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)