Textdraw hiding/showing
#3

Quote:
Originally Posted by Schneider
Посмотреть сообщение
pawn Код:
stock HideWeaponShop(playerid)
{
    for(new i; i<sizeof(WebShop); i++)
    {
        TextDrawHideForPlayer(playerid, WebShop[i]);
    }
    CancelSelectTextDraw(playerid);
    return 1;
}
This is just hiding the Textdraw, If i can read correctly He wanted a fast way to Show and Hide the textdraws (from the title), but you're on the right track.

Heres an example, actually its basically what I use, after pushing the function (under it) place 'CancelSelectTextDraw(playerid);', theres no need to include this in the Stock as you may not always be selecting from the WepShop (if you're just showing it without clicking, ect).

pawn Код:
stock HideTextdraw_WeaponShop(playerid, bool:show = true)
{
    if(show)
    {
        for(new i; i < sizeof(WepShop); i ++)
        {
            TextDrawShowForPlayer(playerid, WebShop[i]);
        }
    } else {
        for(new i; i < sizeof(WepShop); i ++)
        {
            TextDrawHideForPlayer(playerid, WebShop[i]);
        }
    }
}
An example of using this.

pawn Код:
public {some function}({some parameters})
{

       HideTextdraw_WeaponShop(playerid); // this will show it, as by default the Boolean is set to true and doesn't need a value.
       HideTextdraw_WeaponShop(playerid, false); // this will hide it, as by default the Boolean is set to true, and to hide it then it'll require a value of 'False'.
}
Reply


Messages In This Thread
Textdraw hiding/showing - by vassilis - 22.01.2015, 01:24
Re: Textdraw hiding/showing - by Schneider - 22.01.2015, 01:57
Re: Textdraw hiding/showing - by zT KiNgKoNg - 22.01.2015, 02:04
Re: Textdraw hiding/showing - by vassilis - 22.01.2015, 02:04

Forum Jump:


Users browsing this thread: 1 Guest(s)