Extreme+ MOD Timeannouncer in Admiral MOD einscripten

Nightwing
Hi!

Noch ein letzter Wunsch:

Ich hätte das folgende Script gern in meinem Admiral MOD drin, in einem globalen File

Und zwar nur die Funktion Zeitansage via Sound und das farbige Layout der Uhr

Hier das originalscript vom Exreme+ MOD

Ist ein Scripter hier, der sich freundlicherweise meiner annimmt?

Danke schonmal im Voraus für kommende antworten!!!

ToM

hier das Script:

Code einblendenCode angehängt. Klicke hier zum Ein-/Ausblenden

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
main()
{
	shouldcount = true;
	color = (0,1,0);
	clcolch = 0;
	
	while(shouldcount)
	{
		anscore = false;
		antime = undefined;
		passedtime = (getTime() - level.starttime) / 1000;
		secondsleft = int((level.timelimit*60) - (passedtime));
		wait 1;

		if(level.ex_timeannouncer != 2 && isDefined(level.clock) && clcolch == 0)
		{
			level.clock.color = (0,1,0);
			clcolch = 1;
		}

		if(level.scorelimit != 0 && level.ex_teamplay)
		{
			alliescore = getTeamScore("allies");
			axisscore = getTeamScore("axis");

			if(axisscore >= level.scorelimit || alliescore >= level.scorelimit) shouldcount = false;
		}

		if (secondsleft < 5) shouldcount = false;
		
		if(level.mapended) return;

		if(secondsleft > 300) continue;

		if (secondsleft == 300) { antime = "fivemins"; color = (0,1,1); anscore = true; } 		// 5 mins
		if (secondsleft == 120) { antime = "twomins"; color = (.1,.6,.5); anscore = true; }	// 2 mins
		if (secondsleft == 60) { antime = "onemin"; color = (.7,.2,.2); anscore = true; }		// 1 min
		if (secondsleft == 30) { antime = "thirtysecs"; color = (.7,.7,.7); anscore = true; }	// 30 secs
		if (secondsleft == 20) { antime = "twentysecs"; color = (1,1,0); }								// 20 secs
		if (secondsleft == 10) { antime = "tensecs"; color = (1,0,0); anscore = true; }			// 10 secs
		if (secondsleft == 5) antime = "fftto";																		//   5 secs

		if(isDefined(antime))
		{
			if(level.ex_timeannouncer != 2 && isDefined(level.clock)) level.clock.color = color;
			
			players = getEntArray("player", "classname");

			for(ta=0;ta<players.size;ta++)
				if(isplayer(players[ta])) players[ta] thread announce(antime,anscore);
		}
	}
}

announce(antime,anscore)
{
	// announce time
	if(level.ex_antime) self playLocalSound(antime);
	
	if(!anscore || !level.ex_anscore || level.scorelimit <= 0 || !level.ex_teamplay)
		return;

	alliescore = getTeamScore("allies");
	axisscore = getTeamScore("axis");
	team = undefined;
	txt = undefined;
	aname = undefined;
	closetowin = false;

	if(axisscore == alliescore)
	{
		self iprintln(&"SCORES_LEVEL");
		return;
	}

	if(axisscore < alliescore)
	{
		ascore = level.scorelimit - alliescore;
		team = "allies";
	}
	else
	{
		ascore = level.scorelimit - axisscore;
		team = "axis";
	}

	if(ascore > (level.scorelimit - 10))
	 	closetowin = true;
	
	if( self.pers["team"] == "allies") // if teams are not near winning, show scores
	{
		aname = &"SCORES_GERMAN";
		
		if(!closetowin)
		{
			if(alliescore < axisscore)
				self iprintln(&"SCORES_YOUR_TEAM", (axisscore - alliescore), &"SCORES_BEHIND", aname);
			else if(alliescore > axisscore)
				self iprintln(&"SCORES_YOUR_TEAM", (alliescore - axisscore), &"SCORES_AHEAD", aname);
		}
	}
	else
	{
		switch(game["allies"])
		{
			case "american":
				aname = &"SCORES_AMERICAN";
				break;
	
			case "british":
				aname = &"SCORES_BRITISH";
				break;
		
			case "russian":
				aname = &"SCORES_RUSSIAN";
				break;
		}
		
		if(!closetowin)
		{	
			if(axisscore < alliescore)
				self iprintln(&"SCORES_YOUR_TEAM", (axisscore - alliescore), &"SCORES_BEHIND", aname);
			else if(axisscore > alliescore)
				self iprintln(&"SCORES_YOUR_TEAM", (alliescore - axisscore), &"SCORES_AHEAD", aname);
		}
	}

	if(!closetowin) return;

	// a team is close to winning
	if(self.pers["team"] != team) self iprintln(&"SCORES_TEAM_LOSING_MSGA", aname, &"SCORES_TEAM_LOSING_MSGB", ascore, &"SCORES_TEAM_WINNING");
	else self iprintln(&"SCORES_YOUR_TEAM", ascore, &"SCORES_TEAM_WINNING");
}

Nightwing
Ok hab die Lösung mit n bissle Hilfe gefunden, hier die Anleitung:

eine neue Datei erstellen, name _myaddon.gsc

(oder die bestehende vom Addon erweitern siehe link)

hier der Code für die _myaddon.gsc

Code einblendenCode angehängt. Klicke hier zum Ein-/Ausblenden

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
Timeannouncer()
{
	shouldcount = true;
	color = (0,1,0);
	
	while( shouldcount )
	{
		anscore = false;
		sound = undefined;
		passedtime = (getTime() - level.starttime) / 1000;
		secondsleft = int((level.timelimit*60) - (passedtime));
		wait 1;

		if ( secondsleft < 5 ) shouldcount = false;
		
		if( level.mapended ) return;

		if( secondsleft > 300 ) continue;

		if ( secondsleft == 300 ) { sound = "5min"; color = (0,1,1);}
		if ( secondsleft == 120 ) { sound = "2min"; color = (.1,.6,.5);}
		if ( secondsleft == 60 ) { sound = "1min"; color = (.7,.2,.2);}
		if ( secondsleft == 30 ) { sound = "30sec"; color = (.7,.7,.7);}
		if ( secondsleft == 20 ) { sound = "20sec"; color = (1,1,0); }	
		if ( secondsleft == 10 ) { sound = "10sec"; color = (1,0,0);}
		if ( secondsleft == 5 ) sound = "54321sec";	

		if( isDefined (sound) )
		{
			level.clock.color = color;
			
			players = getentarray("player", "classname");
					
			for(i=0;i<players.size;i++)
				{
				if(isplayer(players[i]))
					players[i] playLocalSound (sound);
				}
		}
	}

}




nur noch in der _admiral_mod.gsc folgendes nach Zeile 124 einfügen:

Code einblendenCode angehängt. Klicke hier zum Ein-/Ausblenden

code:
1:
2:
3:
4:
5:
6:
7:
//** hinzugefügt für XXXXX **//

	thread maps\mp\gametypes\_myaddon::Timeannouncer();
	level.clock.color = (0,1,0); //** Farbe Clock **//
	
//** ---Ende für XXXXX--- **//



so, das wars schon.

wer die farben ändern möchte, die angaben sind in rot grün blau in prozent, 1 = 100%, 0.2 = 20%

in microsoft paint ne farbe öffnen und die farbwerte auf die 100 % umrechnen, fertig