Help with string size.
#10

The reason for the "Unknown Command" message could be because you use many big arrays.
That's 8 times 256 cells plus the playerScores array which is at least 2 * 1000 cells.

These are declared locally so there isn't unlimited space.

Try to assemble each string for each textdraw seperately, like this:

- loop with format
- textdrawsetstring
- loop with format
- textdrawsetstring

and reuse the string for each of them - remember to clear the string before formatting the next one, simply by doing

Code:
string[0] = EOS;
The overhead from 7 additional loops is negligible if working with such big strings anyway. You'll have 7 less big arrays.

The other way would be not to blindly declare them with 256 cells. Calculate how big each of the Arrays can possibly get at maximum number of players and text length for each entry, and declare them based on that.

Also you can save some characters by taking out all the color codes (~r~~h~~h~) etc and use TextDrawColor. You only use one color per TextDraw anyway (you'll save a lot of characters).
Reply


Messages In This Thread
Help with string size. - by m1kas - 09.03.2018, 16:37
Re: Help with string size. - by jasperschellekens - 09.03.2018, 16:47
Re: Help with string size. - by m1kas - 09.03.2018, 16:53
Re: Help with string size. - by Meller - 09.03.2018, 17:15
Re: Help with string size. - by m1kas - 09.03.2018, 17:25
Re: Help with string size. - by Meller - 09.03.2018, 17:31
Re: Help with string size. - by m1kas - 09.03.2018, 17:40
Re: Help with string size. - by Meller - 09.03.2018, 17:41
Re: Help with string size. - by m1kas - 09.03.2018, 17:44
Re: Help with string size. - by NaS - 10.03.2018, 01:10

Forum Jump:


Users browsing this thread: 2 Guest(s)