10.03.2018, 01: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
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).
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 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).