Creating TextDraws when showed to a player...
#1

I need to create some textdraws for each player but I think they will be more than 1024.
Can I create TextDraws only when showed and destroy them when hidden or the player disconnects?
I think it is possible and sample but it works?
Reply
#2

In 0.3a the limit has been beefed up to 2048.

Your best bet is to create a textdraw array by MAX_PLAYERS.

Код:
new Text:TextdrawName[MAX_PLAYERS];
Then create/destory/show with per id.

Код:
TextdrawName[playerid] = TextDrawCreate(87.000000, 319.000000, "Example");
TextDrawShowForPlayer(playerid,TextdrawName[playerid]);
TextDrawHideForPlayer(playerid,TextdrawName[playerid]);
TextDrawDestroy(TextdrawName[playerid]);
Note: It's not a c+p example, you still have to put the textdraw functions in the correct positions.

It depends on what your textdraw shows though, if it's global, then make a single global variable, but if it's shows a item that needs to be dynamic, then use the above example, but if it doesn't change, and stays static, then just make a global variable and show to the player when exactly needed.
Reply
#3

Ok, thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)