Textdraw colours - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Textdraw colours (
/showthread.php?tid=84551)
Textdraw colours -
6tynine - 01.07.2009
Right I want somthing that shows 100% - 76% green 75% to 50% Yellow 49% to 0% Red Anyone have any idea's ?
Re: Textdraw colours -
kaisersouse - 01.07.2009
well you'll need a to check against a variable and then use another variable to store the color.
Код:
if(variable >= 0 && variable < 50) tdcolor = COLOR_RED;
else if(variable >= 50 && variable < 76) tdcolor = COLOR_YELLOW;
else if(variable >= 75 and variable <= 100) tdcolor = COLOR_GREEN;
TextDrawColor(TextDrawName, tdcolor);
Re: Textdraw colours -
6tynine - 01.07.2009
Thanks fella
Re: Textdraw colours -
kaisersouse - 01.07.2009
Not a problem. Just don't be a noob and copy/paste what I wrote. What I put down was a theory...you'll have to declare the variables and define the colors yourself