Page 1 of 1

change color scoreboard

Posted: 14 Sep 2020 17:28
by _MoMo_
Hello, Can u help me how can i change scoreboard properties like colors and fonts using server side script?

Re: change color scoreboard

Posted: 15 Sep 2020 09:53
by Gen Stranger
_MoMo_ wrote: 14 Sep 2020 17:28 Hello, Can u help me how can i change scoreboard properties like colors and fonts using server side script?
I am not sure but I think that was talked about on cod4x.me
it's far out of my understanding and programing skill.

see https://cod4x.me/index.php?/forums/topi ... oard-code/

Re: change color scoreboard

Posted: 15 Sep 2020 11:47
by _MoMo_
Your tips helped me a lot and I found this and tested it and it worked :

_scoreboard.gsc

Code: Select all

init()
{
	switch(game["allies"])
	{
	case "sas":
		setdvar("g_TeamName_Allies", &"MPUI_SAS_SHORT");

		precacheShader("faction_128_sas");
		setdvar("g_TeamIcon_Allies", "faction_128_sas");
		setdvar("g_TeamColor_Allies", ".5 .5 .5");
		setdvar("g_ScoresColor_Allies", "0 0 0");

		break;
	
	case "marines":
		setdvar("g_TeamName_Allies", &"MPUI_MARINES_SHORT");

		precacheShader("faction_128_usmc");
		setdvar("g_TeamIcon_Allies", "faction_128_usmc");
		setdvar("g_TeamColor_Allies", "1 0 0 1");
		setdvar("g_ScoresColor_Allies", "1 0 0 1");
		break;
	}

	switch(game["axis"])
	{
	case "opfor":
	case "arab":
		setdvar("g_TeamName_Axis", &"MPUI_OPFOR_SHORT");

		precacheShader("faction_128_arab");
		setdvar("g_TeamIcon_Axis", "faction_128_arab");
		setdvar("g_TeamColor_Axis", "1 0 0 1");		
		setdvar("g_ScoresColor_Axis", "1 0 0 1");
		break;
	
	default:
		setdvar("g_TeamName_Axis", &"MPUI_SPETSNAZ_SHORT");

		precacheShader("faction_128_ussr");
		setdvar("g_TeamIcon_Axis", "faction_128_ussr");
		setdvar("g_TeamColor_Axis", "0.890196 1 0.184314 1");		
		setdvar("g_ScoresColor_Axis", "0.890196 1 0.184314 1");
		break;
	}
	setdvar("g_ScoresColor_Spectator", ".25 .25 .25");
	setdvar("g_ScoresColor_Free", ".76 .78 .10");
	setdvar("g_teamColor_MyTeam", ".6 .8 .6" );
	setdvar("g_teamColor_EnemyTeam", "1 .45 .5" );	
}
https://file.io/e7FweTw3haN3

I hope it works for you :)

Re: change color scoreboard

Posted: 15 Sep 2020 13:32
by Gen Stranger
_MoMo_ wrote: 15 Sep 2020 11:47 Your tips helped me a lot and I found this and tested it and it worked :

_scoreboard.gsc

Code: Select all

init()
{
	switch(game["allies"])
	{
	case "sas":
		setdvar("g_TeamName_Allies", &"MPUI_SAS_SHORT");

		precacheShader("faction_128_sas");
		setdvar("g_TeamIcon_Allies", "faction_128_sas");
		setdvar("g_TeamColor_Allies", ".5 .5 .5");
		setdvar("g_ScoresColor_Allies", "0 0 0");

		break;
	
	case "marines":
		setdvar("g_TeamName_Allies", &"MPUI_MARINES_SHORT");

		precacheShader("faction_128_usmc");
		setdvar("g_TeamIcon_Allies", "faction_128_usmc");
		setdvar("g_TeamColor_Allies", "1 0 0 1");
		setdvar("g_ScoresColor_Allies", "1 0 0 1");
		break;
	}

	switch(game["axis"])
	{
	case "opfor":
	case "arab":
		setdvar("g_TeamName_Axis", &"MPUI_OPFOR_SHORT");

		precacheShader("faction_128_arab");
		setdvar("g_TeamIcon_Axis", "faction_128_arab");
		setdvar("g_TeamColor_Axis", "1 0 0 1");		
		setdvar("g_ScoresColor_Axis", "1 0 0 1");
		break;
	
	default:
		setdvar("g_TeamName_Axis", &"MPUI_SPETSNAZ_SHORT");

		precacheShader("faction_128_ussr");
		setdvar("g_TeamIcon_Axis", "faction_128_ussr");
		setdvar("g_TeamColor_Axis", "0.890196 1 0.184314 1");		
		setdvar("g_ScoresColor_Axis", "0.890196 1 0.184314 1");
		break;
	}
	setdvar("g_ScoresColor_Spectator", ".25 .25 .25");
	setdvar("g_ScoresColor_Free", ".76 .78 .10");
	setdvar("g_teamColor_MyTeam", ".6 .8 .6" );
	setdvar("g_teamColor_EnemyTeam", "1 .45 .5" );	
}
https://file.io/e7FweTw3haN3

I hope it works for you :)
I will try it and see what it does
thanks and I am glad you found what you needed.

Re: change color scoreboard

Posted: 15 Sep 2020 15:18
by _MoMo_
Tnx Bro .

Re: change color scoreboard

Posted: 15 Sep 2020 22:40
by Gen Stranger
_MoMo_ wrote: 15 Sep 2020 15:18Tnx Bro .
Hmm I haven't tried it yet but that does look good

Re: change color scoreboard

Posted: 16 Sep 2020 14:03
by _MoMo_
Yes, it is good for beautifying and coloring the scoreboard . :)

Re: change color scoreboard

Posted: 20 Sep 2020 05:16
by _MoMo_
Hello. Can Somebody Tell me How can i run client console command from server using b3?
For example i want to connect the player into another server using a command
is it possible? I saw in some servers

Re: change color scoreboard

Posted: 20 Sep 2020 11:32
by Gen Stranger
_MoMo_ wrote: 20 Sep 2020 05:16 Hello. Can Somebody Tell me How can i run client console command from server using b3?
For example i want to connect the player into another server using a command
is it possible? I saw in some servers
almost anything is possible with a b3 plugin however I never saw one to do that - I guess you will have to learn to make one.
and since I no longer use b3 I could not even write one at this time.