Creating TextDraws when showed to a player... - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Creating TextDraws when showed to a player... (
/showthread.php?tid=129446)
Creating TextDraws when showed to a player... -
Nekom - 22.02.2010
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?
Re: Creating TextDraws when showed to a player... -
GhoulSlayeR - 22.02.2010
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.
Re: Creating TextDraws when showed to a player... -
Nekom - 22.02.2010
Ok, thanks