Remove all textdraws? -
Mento - 08.05.2012
How can I make it remove all textdraws? Not just a single one? Do I have to use a loop or something?
Re: Remove all textdraws? -
DeathTone - 08.05.2012
Depends what you mean by "remove all textdraws"
Just keep track of which textdraws you wish to show to the player, and hide them whenever you want,
TextDrawHideForPlayer(playerid, textdraw)
or
TextDrawDestroy(textdraw)
Re: Remove all textdraws? -
TzAkS. - 08.05.2012
Try this,not tested
Код:
for(new i = 0; i < MAX_TEXT_DRAWS; i++) TextDrawHideForPlayer(playerid, Text:i);
Re: Remove all textdraws? -
$$inSane - 08.05.2012
use this line where u want the command work:
pawn Код:
TextDrawHideForPlayer(playerid, /*your textdraw*/); //Just put ur textdraw name here and paste it where u want.. :D
Re: Remove all textdraws? -
2KY - 08.05.2012
Quote:
Originally Posted by TzAkS.
Try this,not tested
Код:
for(new i = 0; i < MAX_TEXT_DRAWS; i++) TextDrawHideForPlayer(playerid, Text:i);
|
That would work assuming all of his textdraws are named "Text0", "Text1", ect.
You just have to keep a list of the textdraws you have.
Something like... (From my mode)
pawn Код:
/*
Available Textdraws:
literaltextdrawname, [ DESCRIPTION ] ((clickable?))
startup1, [ LOGIN ] (clickable)
startup2, [ REGISTER ] (clickable)
startup3, [ BOX ]
startup4, [ PLAYER COUNT ]
startup5, [ INFORMATION ]
news1, [ WELCOME ]
news2, [ ACTUAL NEWS ]
news3, [ NEWS BOX ]
XPLVL[playerid][0-5], [ XP METER ]
XPLevelUp, [ Show "LEVEL UP!" above the XP meter ]
Available Dialogs:
DIALOG_BLANK - Possible uses: Notifications, messages not requiring a response.
DIALOG_REGISTER - Registration dialog. Shouldn't have to add this / delete this anywhere in the script.
DIALOG_LOGIN - Login dialog. Possible uses: Temporary logout?
DIALOG_STATS - Statistics dialog.
*/
It's good to stay organized.
Re: Remove all textdraws? -
Jonny5 - 08.05.2012
Quote:
Originally Posted by 2KY
That would work assuming all of his textdraws are named "Text0", "Text1", ect.
|
not his code, it just loops threw all possible TextDraw Id's
not the name.
he adds the Text: tag to the id so no tag mismatch.....
His code will work assuming you dont crash when you hide/destroy a textdraw with an invalid id.