Remove all textdraws?
#1

How can I make it remove all textdraws? Not just a single one? Do I have to use a loop or something?
Reply
#2

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)
Reply
#3

Try this,not tested
Код:
for(new i = 0; i < MAX_TEXT_DRAWS; i++) TextDrawHideForPlayer(playerid, Text:i);
Reply
#4

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
Reply
#5

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.
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)