Color Transparency
#12

Quote:
Originally Posted by JaKe Elite
View Post
I have tried understanding what you have just explained above and this is what happens, I coded & followed your instruction exceptions to some parts.

PHP Code:
stock ShowPlayerObjective(playeridcolorstring[], time)
{
    
PlayerTextDrawSetString(playeridplayer_Textdraw[playerid][0], string);
    
PlayerTextDrawColor(playeridplayer_Textdraw[playerid][0], color);
    
PlayerTextDrawShow(playeridplayer_Textdraw[playerid][0]);
    
PlayerInfo[playerid][ptdTimer] = SetTimerEx("TextdrawFadeOut"100true"ddds"playeridcolortimestring);
    print(
"ShowPlayerObjective");
    return 
1;
}
public 
TextdtawFadeOut(playeridcolortimestring[])
{
    
PlayerInfo[playerid][ptdCount] += 100;
    
PlayerTextDrawColor(playeridplayer_Textdraw[playerid][0], color 255 floatround(float(100) / float(time) * 255.0));
    if(
floatround((time 100)) >= floatround(PlayerInfo[playerid][ptdCount]))
    {
        
PlayerTextDrawHide(playeridplayer_Textdraw[playerid][0]);
        
KillTimer(PlayerInfo[playerid][ptdTimer]);
    }
    return 
1;
}
// EG
ShowPlayerObjective(playerid0x33AA3300"Test my nigga"4000); 
And it just displayed a black colored textdraw.
Code:
float(100) / float(time)
is not quite correct. This will indeed always give a low value, and after the full calculation it will be black. You must replace 100 with the time already passed, which will result in

Code:
float(PlayerInfo[playerid][ptdCount]) / float(time)
You should also make sure that PlayerInfo[playerid][ptdCount] never grows higher than time before inserting it into that calculation, that will result in a totally different color.
Reply


Messages In This Thread
Color Transparency - by JaKe Elite - 26.09.2017, 12:51
Re: Color Transparency - by Skream - 26.09.2017, 12:53
Re: Color Transparency - by JaKe Elite - 26.09.2017, 12:55
Re: Color Transparency - by GustavoKarasek - 26.09.2017, 12:55
Re: Color Transparency - by AbyssMorgan - 26.09.2017, 12:57
Re: Color Transparency - by Skream - 26.09.2017, 12:57
Re: Color Transparency - by JaKe Elite - 26.09.2017, 13:11
Re: Color Transparency - by OneDay - 26.09.2017, 13:18
Re: Color Transparency - by JaKe Elite - 26.09.2017, 13:25
Re: Color Transparency - by NaS - 26.09.2017, 13:54
Re: Color Transparency - by JaKe Elite - 26.09.2017, 14:16
Re: Color Transparency - by NaS - 26.09.2017, 15:00
Re: Color Transparency - by JaKe Elite - 27.09.2017, 05:13
Re: Color Transparency - by NaS - 27.09.2017, 07:15
Re: Color Transparency - by JaKe Elite - 27.09.2017, 11:18
Re: Color Transparency - by JaKe Elite - 27.09.2017, 11:37

Forum Jump:


Users browsing this thread: 1 Guest(s)