SA-MP Forums Archive
Textdraw - 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)
+--- Thread: Textdraw (/showthread.php?tid=356088)



Textdraw - Dusan01 - 02.07.2012

How to Hide all text draws in one line for one player?


Re: Textdraw - Jarnu - 02.07.2012

TextDrawHideForPlayer


Respuesta: Textdraw - [DOG]irinel1996 - 02.07.2012

You can't.
At least you can do this, a function:
pawn Код:
HideAllTextDraws(playerid)
{
    HideTextDrawForPlayer(playerid, TextDraw1);
    HideTextDrawForPlayer(playerid, TextDraw2);
    HideTextDrawForPlayer(playerid, TextDraw3);
}
And use it as this:
pawn Код:
public OnPlayerDeath(playerid) //Example callback
{
    HideAllTextDraws(playerid);
    return 1;
}
Another way is making an array:
pawn Код:
new Text:TDName[3];

public OnGameModeInit()
{
    TDName[0] = TextDrawCreate(.............);
    //etc.

    TDName[1] = TextDrawCreate(.............);
    //etc.

    TDName[2] = TextDrawCreate(.............);
    //etc.
    return 1;
}

//Example:
public OnPlayerDeath(playerid)
{
    HideAllTD(playerid);
    return 1;
}

//Function:
HideAllTD(playerid)
{
    for(new d = 0; d <= 3; d++)
    {
        TextDrawHideForPlayer(playerid, TDName[d]);
    }
}
Also, you can make a constant (define) to hide them.