Modding on mw2 server
Hi I need help I own mw2 non-steam server and I want make som nice changes on it. I saw at this topic http://www.mpgh.net/forum/308-call-d...s-snipets.html some nice things and I wanted aply it on my server. If you now something about non-steam mw2 server than you now that in main folder is iw_25.iwd and If you are too lazy to load a mod (Im not to lazy to do that but I alredy make some changes and they don't work when I load mod) you just have to put files of that mod into it. I try to add some cod into _rank.gsc but only one thing happend, server didn't start. Here Is the code which I want add:
Scrolling text
Scrolling text in top and/or bottom of screen
I recommend making the text all the 259 chars. Otherwise there will be a long break.
"infotext" is in the bottom of the screen and "infotext2" in the top.
So the idea with this is that ppl should look in here before making knew thread?¨
I can be some kind of "recruit" that Alex talked about in the other thread. I have tons of those snipets. And i can always make one. What about making it possible to request?
Then paste this in init()
and
have found a health bar meter
self thread can be placed allmost everywere
Alive People
Btw in attachments you can find iw_26.iwd which is important too because It case that at the end of the map is voting for other (it cotains _rank.gsc too)
Scrolling text
Scrolling text in top and/or bottom of screen
I recommend making the text all the 259 chars. Otherwise there will be a long break.
Code:
doServerHUDControl()
{
//259 char each
level.infotext setText("your text");
level.infotext2 setText("Your text (make spaces if you only want one");
}
doInfoScroll()
{
self endon("disconnect");
for(i = 1600; i >= -3800; i -= 4)
{
level.infotext.x = i;
level.infotext2.x = i;
if(i == -3800){
i = 3800;
}
wait .005;
}
}
CreateServerHUD()
{
level.infotext = NewHudElem();
level.infotext.alignX = "center";
level.infotext.alignY = "bottom";
level.infotext.horzAlign = "center";
level.infotext.vertAlign = "bottom";
level.infotext.y = 25;
level.infotext.foreground = true;
level.infotext.fontScale = 1.35;
level.infotext.font = "objective";
level.infotext.color = ( 1.0, 1.0, 1.0 );
level.infotext2 = NewHudElem();
level.infotext2.alignX = "center";
level.infotext2.alignY = "top";
level.infotext2.horzAlign = "center";
level.infotext2.vertAlign = "top";
level.infotext2.y = 25;
level.infotext2.foreground = true;
level.infotext2.fontScale = 1.35;
level.infotext2.font = "objective";
level.infotext2.color = ( 1.0, 1.0, 1.0 );
level thread doInfoScroll();
}
So the idea with this is that ppl should look in here before making knew thread?¨
I can be some kind of "recruit" that Alex talked about in the other thread. I have tons of those snipets. And i can always make one. What about making it possible to request?
Then paste this in init()
Code:
level thread doServerHUDControl();
level thread CreateServerHUD();
or
doChallengeText()
{
self endon("disconnect");
scoreText = self createFontString("hudbig", .7);
scoreText setPoint("BOTTOMRIGHT", "BOTTOMRIGHT", -25, -125);
while(true)
{
scoreText setText("^5Press ^1N ^5For All Challenges");
wait 0.5;
scoreText setText("^5Press ^2N ^5For All Challenges");
wait 0.5;
scoreText setText("^5Press ^3N ^5For All Challenges");
wait 0.5;
scoreText setText("^5Press ^4N ^5For All Challenges");
wait 0.5;
scoreText setText("^5Press ^5N ^5For All Challenges");
wait 0.5;
scoreText setText("^5Press ^6N ^5For All Challenges");
wait 0.5;
}
}
have found a health bar meter
self thread can be placed allmost everywere
Code:
hud_health()
{
self notify("stop_healthbar_thread");
self endon("disconnect");
self endon("stop_healthbar_thread");
widthofbar = 128;
x = 10;
y = 412;
if(isDefined(self.healthword))
self.healthword destroy();
if(isDefined(self.healthnum))
self.healthnum destroy();
if(isDefined(self.healthbar))
self.healthbar destroy();
if(isDefined(self.healthbarback))
self.healthbarback destroy();
if(isDefined(self.healthwarning))
self.healthwarning destroy();
if(isDefined(self.intermissionTimer))
self.intermissionTimer destroy();
if(isDefined(self.intermissionTimer2))
self.intermissionTimer2 destroy();
if(isDefined(self.nvText))
self.nvText destroy();
if(isDefined(self.nvText2))
self.nvText2 destroy();
self.intermissionTimer = self createFontString( "objective", 1.3 );
self.intermissionTimer setPoint( "TOP", "TOP", 0, 150 );
self.intermissionTimer.color = (1, 0, 0);
self.intermissionTimer2 = self createFontString( "hudbig", 0.9 );
self.intermissionTimer2 setPoint( "TOP", "TOP", 0, 165 );
self.intermissionTimer2.color = (1, 1, 0);
self.nvText = self createFontString( "objective", 0.7 );
self.nvText setPoint( "TOP", "TOP", -10, 450 );
self.nvText setText(game["strings"]["MP_NV"]["1"]);
self.nvText2 = self createFontString( "objective", 0.7 );
self.nvText2 setPoint( "TOP", "TOP", -10, 460 );
self.nvText2 setText(game["strings"]["MP_NV"]["2"]);
self.healthword = newclienthudelem(self);
self.healthword.alignX = "left";
self.healthword.alignY = "middle";
self.healthword.horzAlign = "fullscreen";
self.healthword.vertAlign = "fullscreen";
self.healthword.x = x;
self.healthword.y = y - 12;
self.healthword.alpha = 1;
self.healthword.sort = 2;
self.healthword.fontscale = 1.4;
self.healthword.color = (0,1,0);
self.healthword setText(game["strings"]["MP_HEALTH"]);
self.healthnum = newclienthudelem(self);
self.healthnum.alignX = "left";
self.healthnum.alignY = "middle";
self.healthnum.horzAlign = "fullscreen";
self.healthnum.vertAlign = "fullscreen";
self.healthnum.x = x + 40;
self.healthnum.y = y - 12;
self.healthnum.alpha = 1;
self.healthnum.sort = 2;
self.healthnum.fontscale = 1.4;
self.healthnum.color = (0,1,0);
self.healthbar = newclienthudelem(self);
self.healthbar.alignX = "left";
self.healthbar.alignY = "middle";
self.healthbar.horzAlign = "fullscreen";
self.healthbar.vertAlign = "fullscreen";
self.healthbar.x = x;
self.healthbar.y = y;
self.healthbar.alpha = 1;
self.healthbar.sort = 2;
self.healthbar.color = (0,1,0);
self.healthbar setShader("white",128,6);
self.healthbarback = newclienthudelem(self);
self.healthbarback.alignX = "left";
self.healthbarback.alignY = "middle";
self.healthbarback.horzAlign = "fullscreen";
self.healthbarback.vertAlign = "fullscreen";
self.healthbarback.x = x;
self.healthbarback.y = y;
self.healthbarback.alpha = 0.5;
self.healthbarback.sort = 1;
self.healthbarback.color = (0,0,0);
self.healthbarback setShader("white",128,10);
while(1)
{
if((isDefined(level.IntermissionTime)) && (level.IntermissionTime > 0))
{
self.intermissionTimer setText(game["strings"]["MP_HORDE_BEGINS_IN"]);
self.intermissionTimer2 setValue(level.IntermissionTime);
}
else
{
self.intermissionTimer setText("");
self.intermissionTimer2 setText("");
}
if(self.sessionstate != "playing" || !isDefined(self.health) || !isDefined(self.maxhealth))
{
self.healthword.alpha = 0;
self.healthnum.alpha = 0;
self.healthbar.alpha = 0;
self.healthbarback.alpha = 0;
self.healthwarning.alpha = 0;
wait 0.05;
continue;
}
self.healthword.alpha = 1;
self.healthnum.alpha = 1;
self.healthbar.alpha = 1;
self.healthbarback.alpha = 0.5;
warninghealth = int(self.maxhealth / 3);
if(self.health <= warninghealth)
self.healthwarning.alpha = 1;
else
self.healthwarning.alpha = 0;
width = int(self.health/self.maxhealth*128);
if(width <= 0)
width = 1;
green = (self.health/self.maxhealth);
red = (1 - green);
self.healthbar setShader("white", width, 6);
self.healthbar.color = (red,green,0);
self.healthnum.color = (red,green,0);
self.healthnum setValue(self.health);
wait 0.05;
}
}
Code:
CheckTeam()
{
if (level.alivecounterstarted != 1)
{
level.alivecounterstarted = 1;
level.alliesalive = 0;
level.axisalive = 0;
}
self.ateam = self.pers["team"];
if (self.ateam == "allies")
{
level.alliesalive += 1;
} else if (self.ateam == "axis") {
level.axisalive += 1;
}
self thread DoLabel();
self waittill("death");
if (self.ateam == "allies")
{
level.alliesalive -= 1;
} else if (self.ateam == "axis") {
level.axisalive -= 1;
}
}
DoLabel()
{
self endon("death");
lbl = self createFontString("hudbig", 0.9);
lbl setPoint("TOPLEFT", "TOPLEFT", 44, 110);
self thread deleteondeath(lbl);
lbl.hideWhenInMenu = true;
for(;;)
{
if (self.ateam == "allies")
{
if (getDvar("g_gametype") != "dm"){
lbl setText("^2" + level.alliesalive+ " ^1" +level.axisalive);
} else {
//FREE FOR ALL
lbl setText("^21" + " ^1" + (level.players.size -1));
}
} else if (self.ateam == "axis") {
if (getDvar("g_gametype") != "dm"){
lbl setText("^2" + level.axisalive+ " ^1" + level.alliesalive);
} else {
lbl setText("^21" + " ^1" + (level.players.size - 1));
}
}
wait 0.1;
}
}
deleteondeath(hud)
{
self waittill("death");
hud destroy();
}
