24.02.2019, 15:21
Quote:
Neat but I doubt anyone would ever really need this to be honest.
|
With this you just have to worry about the visible limit without constantly creating and destroying player textdraws yourself, I'd argue it to be safer as well (at least it requires less effort to assure the script(s) delete all player TDs).
I have one little suggestion though - could you add an extra id?
Like (Player)TextDrawSet/GetExtraID?
That would be really neat for multiple purposes, for example lists/menus built with TextDraws. Instead of looping through the array of TextDraw IDs to find the list index for the "clickedid", you can just get the extra ID and know the index directly. Saves time and effort. This could also be used to completely avoid allocating arrays for TextDraw IDs if you add 2 extra ids (first for the type of TD, second for the index).
I have some more ideas for useful functions if you plan on expanding it, eg. toggling specific TDs for specific or all players, and toggling all TDs for specific players (seperately from showing/hiding them).
Really good include!