Posts: 288
Threads: 36
Joined: May 2010
Reputation:
0
I want to learn how to do a fading textdraw. I don't want anything like includes or Filterscripts, I want to know the code. What I want to do is make the screen white then fade out to nothing (back to game). If anybody could teach me how to do this I would greatly appreciate it.
Posts: 836
Threads: 107
Joined: Sep 2010
Reputation:
0
Well, this is not the best but, maybe create about 15 textdraws that gets lighter by using a timer.
Example:
Textdraw0 would be full white.
Textdraw1 would be lighter than Textdraw0.
Textdraw2 would be lighter than Textdrea1.
etc.
So every second or so, create a textdraw that is lighter than the one before.
There is an injured system somewhere one the forums that when you get hurt, the screen goes red and I think it fades.
Posts: 555
Threads: 136
Joined: Dec 2010
Reputation:
0
you can use a timer + a counter
use a timer with 1000 ms (infinite loop)
use a couter (count) for example
set count+ 1 in the timer and set a
if(cout == 1) return TextDrawColor(Example,0x000000FF);
if(cout == 2) return TextDrawColor(Example,0x000000BB;
if(cout == 3) return TextDrawColor(Example,0x00000077);
if(cout == 4) return TextDrawColor(Example,0x00000033);
if(cout == 5) return TextDrawColor(Example,0x00000000);
if(cout == 5) return kill your timer ;
that will make your text disapear slowly
Posts: 836
Threads: 107
Joined: Sep 2010
Reputation:
0
That's basically it, but better since you can use TextDrawColor instead of creating a new textdraw.
Posts: 288
Threads: 36
Joined: May 2010
Reputation:
0
@Tee - I found that system but I want to see whether writing out the code is more effective than using the include. Since I write some scripts for another server, I tend to want to keep it as compatible with the server as possible. Also the owner does use that "Red and Fade" system so I'll ask him whether he uses that include or not.
@Amine - could you write out the code for that or put it in [pawn] tags.