SA-MP Forums Archive
How can I make a textdrawbox to fade? - 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: How can I make a textdrawbox to fade? (/showthread.php?tid=599702)



How can I make a textdrawbox to fade? - radiobizza - 29.01.2016

How can I make a textdrawbox to fade?


Re: How can I make a textdrawbox to fade? - Tamy - 29.01.2016

Set a timer and do something like this with intervals.
Код:
TextDrawColor(TD,0x000000FF);
TextDrawColor(TD,0x000000BB;
TextDrawColor(TD,0x00000077);
TextDrawColor(TD,0x00000033);
TextDrawColor(TD,0x00000000);



Re: How can I make a textdrawbox to fade? - radiobizza - 29.01.2016

Quote:
Originally Posted by Tamy
Посмотреть сообщение
Set a timer and do something like this with intervals.
Код:
TextDrawColor(TD,0x000000FF);
TextDrawColor(TD,0x000000BB;
TextDrawColor(TD,0x00000077);
TextDrawColor(TD,0x00000033);
TextDrawColor(TD,0x00000000);
I have something like this:
PHP код:
        TextDrawBoxColor(Textdraw0, -5963726);
        
TextDrawShowForPlayer(playeridTextdraw0);
        
TextDrawBoxColor(Textdraw0, -5963728);
        
TextDrawShowForPlayer(playeridTextdraw0);
        
TextDrawBoxColor(Textdraw0, -5963730);
        
TextDrawShowForPlayer(playeridTextdraw0);
        
TextDrawBoxColor(Textdraw0, -5963732);
        
TextDrawShowForPlayer(playeridTextdraw0);
        
TextDrawBoxColor(Textdraw0, -5963734);
        
TextDrawShowForPlayer(playeridTextdraw0);
        
TextDrawBoxColor(Textdraw0, -5963736);
        
TextDrawShowForPlayer(playeridTextdraw0);
        
TextDrawBoxColor(Textdraw0, -5963738);
        
TextDrawShowForPlayer(playeridTextdraw0);
        
TextDrawBoxColor(Textdraw0, -5963740);
        
TextDrawShowForPlayer(playeridTextdraw0);
        
TextDrawBoxColor(Textdraw0, -5963742);
        
TextDrawShowForPlayer(playeridTextdraw0);
        
TextDrawBoxColor(Textdraw0, -5963744);
        
TextDrawShowForPlayer(playeridTextdraw0);
        
TextDrawBoxColor(Textdraw0, -5963746);
        
TextDrawShowForPlayer(playeridTextdraw0); 



Re: How can I make a textdrawbox to fade? - Tamy - 29.01.2016

Set a timer for it like this.

Код:
new FadingTextDraw[MAX_PLAYERS];
Use this to call the fading function.

Код:
SetTimerEx("FadePlayerTextdrawBox", 200, false, "i", playerid);
Your fading function.
Код:
forward FadePlayerTextdrawBox(playerid);
public FadePlayerTextdrawBox(playerid)
{
        if(!FadingTextDraw[playerid])
        {
            TextDrawBoxColor(Textdraw0, -5963726);
        }
        else if(FadingTextDraw[playerid] == 1)
        {
            TextDrawBoxColor(Textdraw0, -5963728);

        }
        else if(FadingTextDraw[playerid] == 2)
        {
            TextDrawBoxColor(Textdraw0, -5963730);

        }
        else if(FadingTextDraw[playerid] == 3)
        {
            TextDrawBoxColor(Textdraw0, -5963732);

        }
        else if(FadingTextDraw[playerid] == 4)
        {
            TextDrawBoxColor(Textdraw0, -5963734);

        }
        else if(FadingTextDraw[playerid] == 5)
        {
            TextDrawBoxColor(Textdraw0, -5963736);

        }
        else if(FadingTextDraw[playerid] == 6)
        {
            TextDrawBoxColor(Textdraw0, -5963738);

        }
        else if(FadingTextDraw[playerid] == 7)
        {
            TextDrawBoxColor(Textdraw0, -5963740);

        }
        else if(FadingTextDraw[playerid] == 8)
        {
            TextDrawBoxColor(Textdraw0, -5963742);

        }
        else if(FadingTextDraw[playerid] == 9)
        {
            TextDrawBoxColor(Textdraw0, -5963744);
      
        }
        else if(FadingTextDraw[playerid] == 10)
		{
            TextDrawBoxColor(Textdraw0, -5963746);
        }
        FadingTextDraw[playerid]++;
        TextDrawShowForPlayer(playerid, Textdraw0);
        if(FadingTextDraw[playerid] < 10) SetTimerEx("FadePlayerTextdrawBox", 200, false, "i", playerid);
        return 1;
}



Re: How can I make a textdrawbox to fade? - radiobizza - 29.01.2016

Quote:
Originally Posted by Tamy
Посмотреть сообщение
Set a timer and do something like this with intervals.
Код:
TextDrawColor(TD,0x000000FF);
TextDrawColor(TD,0x000000BB;
TextDrawColor(TD,0x00000077);
TextDrawColor(TD,0x00000033);
TextDrawColor(TD,0x00000000);
Quote:
Originally Posted by Tamy
Посмотреть сообщение
Set a timer for it like this.

Код:
new FadingTextDraw[MAX_PLAYERS];
Use this to call the fading function.

Код:
SetTimerEx("FadePlayerTextdrawBox", 200, false, "i", playerid);
Your fading function.
Код:
forward FadePlayerTextdrawBox(playerid);
public FadePlayerTextdrawBox(playerid)
{
        if(!FadingTextDraw[playerid])
        {
            TextDrawBoxColor(Textdraw0, -5963726);
        }
        else if(FadingTextDraw[playerid] == 1)
        {
            TextDrawBoxColor(Textdraw0, -5963728);

        }
        else if(FadingTextDraw[playerid] == 2)
        {
            TextDrawBoxColor(Textdraw0, -5963730);

        }
        else if(FadingTextDraw[playerid] == 3)
        {
            TextDrawBoxColor(Textdraw0, -5963732);

        }
        else if(FadingTextDraw[playerid] == 4)
        {
            TextDrawBoxColor(Textdraw0, -5963734);

        }
        else if(FadingTextDraw[playerid] == 5)
        {
            TextDrawBoxColor(Textdraw0, -5963736);

        }
        else if(FadingTextDraw[playerid] == 6)
        {
            TextDrawBoxColor(Textdraw0, -5963738);

        }
        else if(FadingTextDraw[playerid] == 7)
        {
            TextDrawBoxColor(Textdraw0, -5963740);

        }
        else if(FadingTextDraw[playerid] == 8)
        {
            TextDrawBoxColor(Textdraw0, -5963742);

        }
        else if(FadingTextDraw[playerid] == 9)
        {
            TextDrawBoxColor(Textdraw0, -5963744);
      
        }
        else if(FadingTextDraw[playerid] == 10)
		{
            TextDrawBoxColor(Textdraw0, -5963746);
        }
        FadingTextDraw[playerid]++;
        TextDrawShowForPlayer(playerid, Textdraw0);
        if(FadingTextDraw[playerid] < 10) SetTimerEx("FadePlayerTextdrawBox", 200, false, "i", playerid);
        return 1;
}
doesn't work man


Re: How can I make a textdrawbox to fade? - Tamy - 29.01.2016

Try out the hexadecimals code I gave.

Код:
forward FadePlayerTextdrawBox(playerid);
public FadePlayerTextdrawBox(playerid)
{
        if(!FadingTextDraw[playerid]) TextDrawColor(Textdraw0,0x000000FF);
        else if(FadingTextDraw[playerid] == 1) TextDrawColor(Textdraw0,0x000000BB;
        else if(FadingTextDraw[playerid] == 2) TextDrawColor(Textdraw0,0x00000077);
        else if(FadingTextDraw[playerid] == 3) TextDrawColor(Textdraw0,0x00000033);
        else if(FadingTextDraw[playerid] == 4) TextDrawColor(Textdraw0,0x00000000);
        FadingTextDraw[playerid]++;
        TextDrawShowForPlayer(playerid, Textdraw0);
        if(FadingTextDraw[playerid] < 4) SetTimerEx("FadePlayerTextdrawBox", 200, false, "i", playerid);
        return 1;
}
Make sure you're calling it on the right time using

Код:
SetTimerEx("FadePlayerTextdrawBox", 200, false, "i", playerid);



Re: How can I make a textdrawbox to fade? - radiobizza - 29.01.2016

can you give me all the hexadecimals code please ascendet please?


Re: How can I make a textdrawbox to fade? - Tamy - 29.01.2016

www.colorpicker.com, I hope you'll find all your hexadecimal codes there


Re: How can I make a textdrawbox to fade? - SumX - 29.01.2016

search for textdraws.inc by gammix.
there you have an already made function TextDrawFade.


Re: How can I make a textdrawbox to fade? - Sew_Sumi - 29.01.2016

This is where you should've been referred to the "Looking for Scripters/Helpers" thread, and not had random attempts to "help" pasted to you.


You learn nothing, and the code doesn't even work.

This is scripting help, not script for you.