PDA

View Full Version : cod2 hunter script



wizzardjanni
6th April 2014, 17:29
hello.

does anybody know a script that when you kill 2 hunter as zombie that you become hunter?

IzNoGoD
6th April 2014, 17:36
Cant you write such a script yourself? It is quite trivial...

wizzardjanni
6th April 2014, 17:51
add my xf please. wizzardjanni

Rocky
6th April 2014, 19:56
Somewhere at playerkilled..


Attacker thread CheckValue();

Put this somewhere in gametype.


checkValue()
{
level endon("endmap");
if(self.killed >= 2)
{
self iprintlnbold("You killed enoguh Hunters!");
self.killed = 0;
self thread moveAttacker();
}
}
Here is code for checkValue.

And moveAttacker

moveAttacker()
{
level endon("endmap");
newTeam = "axis";

if(self.pers["team"] == "axis")
newTeam = "allies";

if(isAlive(self))
{
self unlink();
wait 0.05;
self suicide();
wait 0.05;
}

self notify("end_respawn");

self.pers["team"] = newTeam;
self.pers["weapon"] = undefined;
self.pers["weapon1"] = undefined;
self.pers["weapon2"] = undefined;
self.pers["spawnweapon"] = undefined;
self.pers["savedmodel"] = undefined;
self.pers["secondary_weapon"] = undefined;
self.maxhealth = 100;
self.health = self.maxhealth;

self setClientCvar("ui_allow_weaponchange", "1");

if(newTeam == "allies")
{
self openMenu(game["menu_weapon_allies"]);
scriptMainMenu = game["menu_weapon_allies"];
}
self waittill("joined_team");
iprintln(self.name + " Killed Enough Hunters!");
}

And i forgot.. at playerconnect() put this: self.killed = 0;


Here is all what u need!

IzNoGoD
6th April 2014, 21:57
Shouldnt you also reset the .killed var when you restart round...

Edit: i also dont see where you increment the .killed var...

Mitch
6th April 2014, 22:51
hello.

does anybody know a script that when you kill 2 hunter as zombie that you become hunter?

In the default zombie mod you have got a cvar for it. But it requires scr_zom_lastManStanding to be 0.



scr_zom_returnkills The number of kills needed to return to being an Allied player - default: 2

http://callofduty.filefront.com/file/Zombies_Gametype_for_CoD2;53241



//LAST MAN STANDING
if(getcvar("scr_zom_lastManStanding") == "1")
{
//attacker.score++;
if (!(thread checkRestart(self)))
{
self thread blackScreen("killed");
}

}
else
{
self thread blackScreen("killed");

attacker.killcount++;

if (attacker.killcount > GetCvarInt("scr_zom_returnkills")-1)
{
attacker thread blackScreen("return");
attacker thread movePlayer("allies",3);
wait 0.01;
thread checkRestart();

noRespawn = true;
}
}