change color scoreboard
Posted: 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
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" );
}
I will try it and see what it does_MoMo_ wrote: ↑15 Sep 2020 11:47 Your tips helped me a lot and I found this and tested it and it worked :
_scoreboard.gschttps://file.io/e7FweTw3haN3Code: 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" ); }
I hope it works for you
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.