Forum Tutorials CoD4x [CoD4x] Farbiges Scoreboard

[CoD4x] Farbiges Scoreboard

Post von IronMan » 27.06.2021 16:11:17


Hallo zusammen,

hier mal ein Code um ein Farbiges Scoreboard in CoD4x zu bekommen.
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", "240,248,255");
setdvar("g_ScoresColor_Allies", "138,43,226");

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", "138,43,255");
setdvar("g_ScoresColor_Allies", "240,248,255");
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", "138,43,255");
setdvar("g_ScoresColor_Axis", "240,248,255");
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", "72,118,255");
break;
}
setdvar("g_ScoresColor_Spectator", "255,0,255");
setdvar("g_ScoresColor_Free", ".76 .78 .10");
setdvar("g_teamColor_MyTeam", "191,62,255" );
setdvar("g_teamColor_EnemyTeam", "205,102,0" );
}
Speichert den Code in einer neuen Datei namens _scoreboard.gsc ab und ladet diese in main_shared/maps/mp/gametypes hoch, hier sollte sich auch die _callbacksetup.gsx befinden, öffnet diese und fügt im oberen Bereich folgendes ein,

level thread maps\mp\gametypes\_scoreboard::init();

so sieht das bei mir aus,
//	Callback Setup
// This script provides the hooks from code into script for the gametype callback functions.

//=============================================================================
// Code Callback functions

/*================
Called by code after the level's main script function has run.
================*/
CodeCallback_StartGameType()
{
// If the gametype has not beed started, run the startup
if(!isDefined(level.gametypestarted) || !level.gametypestarted)
{
[[level.callbackStartGameType]]();

level.gametypestarted = true; // so we know that the gametype has been started up

level thread maps\mp\bots\_bot::init();

level thread maps\mp\gametypes\_scoreboard::init();
}
}
Bitte nicht vergessen nach den Änderungen euren Server neu zu starten!

 

User avatar
IronMan
Administrator
User
Grünschnabel
 
Beiträge: 3
Dabei seit: 2020-10-17 10:56:07