Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: How to change colors ingame?

  1. #11
    Private First Class
    Join Date
    Oct 2013
    Posts
    219
    Thanks
    56
    Thanked 105 Times in 66 Posts
    Yup just did a test.

    You can edit _scoreboard.gsc and change both g_TeamColor_Allies & g_TeamName_Axis to custom colors. You will see the changes in colors with both ^8 and ^9.

  2. The Following User Says Thank You to filthy_freak_ For This Useful Post:

    kung foo man (5th April 2014)

  3. #12
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by Rocky View Post
    where is that rgb?

    Omg.. aha.. can i change that color to it stay with script? i need that
    RGB is Red Green Blue. Use this site to find out the value you need:
    http://www.rapidtables.com/web/color/RGB_Color.htm

    Last edited by Mitch; 5th April 2014 at 15:25.

  4. The Following 2 Users Say Thank You to Mitch For This Useful Post:

    kung foo man (5th April 2014),Rocky (5th April 2014)

  5. #13
    Private
    Join Date
    Oct 2012
    Posts
    10
    Thanks
    2
    Thanked 22 Times in 8 Posts
    HTML and Decimal support:
    Code:
    setHtmlColor(code)
    {
    	if(!isDefined(code) || isDefined(code) && (code[0]=="#" && code.size!=7 || code[0]!="#" && code.size!=6))
    		return (1,1,1);
    	
    	if(code[0]=="#")
    		code=getSubStr(code,1,code.size);
    	hex=[];
    	for(i=0;i<code.size;i++)
    		hex[hex.size]=""+code[i];
    	for(i=0;i<hex.size;i++)
    	{
    		switch(toLower(hex[i]))
    		{
    			case "a":
    				hex[i]=10;
    				break;
    			case "b":
    				hex[i]=11;
    				break;
    			case "c":
    				hex[i]=12;
    				break;
    			case "d":
    				hex[i]=13;
    				break;
    			case "e":
    				hex[i]=14;
    				break;
    			case "f":
    				hex[i]=15;
    				break;
    			default:
    				hex[i]=int(hex[i]);
    				break;
    		}
    	}
    	r=(hex[0]*16)+hex[1];
    	g=(hex[2]*16)+hex[3];
    	b=(hex[4]*16)+hex[5];
    	
    	return setDecimalColor((r,g,b));
    }
    
    setDecimalColor(rgb)
    {
    	if(!isDefined(rgb))
    		return (1,1,1);
    	
    	if(rgb[0]<0 || rgb[0]>255)
    		rgb[0]=255;
    	if(rgb[1]<0 || rgb[1]>255)
    		rgb[1]=255;
    	if(rgb[2]<0 || rgb[2]>255)
    		rgb[2]=255;
    	
    	return (1/(255/rgb[0]),1/(255/rgb[1]),1/(255/rgb[2]));
    }
    Examples:
    Code:
    rgb=setHtmlColor("#1A1B1C");
    setCvar("g_TeamColor_Allies", rgb[0]+" "+rgb[1]+" "+rgb[2]);
    Code:
    rgb=setHtmlColor("#1A1B1C");
    
    new_hud=newHudElem();
    new_hud.horzAlign="center_safearea";
    new_hud.vertAlign="center_safearea";
    new_hud.alignX="center";
    new_hud.alignY="center";
    new_hud.x=0;
    new_hud.y=0;
    new_hud.color=rgb;
    new_hud.alpha=1;
    new_hud setText(&"HUD Example");
    Have fun!^^
    Last edited by DisSle; 5th April 2014 at 16:16.

  6. The Following 6 Users Say Thank You to DisSle For This Useful Post:

    Jeplaa (5th April 2014),kung foo man (5th April 2014),Mitch (5th April 2014),Ni3ls (5th April 2014),RobsoN (5th April 2014),Rocky (5th April 2014)

  7. #14
    Private First Class
    Join Date
    Jul 2013
    Posts
    170
    Thanks
    44
    Thanked 16 Times in 11 Posts
    Thanks.. but how to change color ^8 to it be some other color?

  8. #15
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Dude... Do you even read the comments?
    You can edit _scoreboard.gsc and change both g_TeamColor_Allies & g_TeamName_Axis to custom colors. You will see the changes in colors with both ^8 and ^9.

  9. #16
    Private First Class
    Join Date
    Jul 2013
    Posts
    170
    Thanks
    44
    Thanked 16 Times in 11 Posts
    OMG.. haven't read this 1


    HAHA its working!
    Last edited by Rocky; 5th April 2014 at 18:17.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •