Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds
Watch MODSonair

Members Online

»
1 Active | 82 Guests
Online:

LATEST FORUM THREADS

»
run artillery on maps
CoD+UO Map + Mod Releases
Call of DutyŽ: WWII
CoD WW2 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Administrator Burn/Kill/Mortar Script!
Zaphax
General Member
Since: Jun 17, 2008
Posts: 251
Last: Dec 29, 2013
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Thursday, Mar. 3, 2011 11:44 pm
Hey, i found a script the other day and i was thinking this is something new for me so how do i use this script to make players that i want to burn or change their character xmodel to another model like admins turn other people to a vehicle and such or give/take weapon from player or make him that he cant die or just kill him... :D


here's the script:

Code:
init()	
{

	game["adminEffect"]["mortar"][0]	= loadfx("fx/explosions/mortarExp_beach.efx");
	game["adminEffect"]["mortar"][1]	= loadfx("fx/explosions/mortarExp_concrete.efx");
	game["adminEffect"]["mortar"][2]	= loadfx("fx/explosions/mortarExp_dirt.efx");
	game["adminEffect"]["mortar"][3]	= loadfx("fx/explosions/mortarExp_mud.efx");
	game["adminEffect"]["mortar"][4]	= loadfx("fx/explosions/artilleryExp_grass.efx");
	game["adminEffect"]["explode"]	= loadfx("fx/explosions/default_explosion.efx");
	game["adminEffect"]["burn"]		= loadfx("fx/fire/character_torso_fire.efx");
	game["adminEffect"]["smoke"]		= loadfx("fx/smoke/grenade_smoke.efx");
   game["deadCowModel"] = "xmodel/cow_dead_1";
	precachemodel(game["deadCowModel"]);

	//precacheMenu ("clientcmd");

	thread start();
}

start()
{
	
   setcvar("burn","");
   setcvar("cow","");
   setCvar("explode","");
   setCvar("kill","");
   setCvar("disarm","");
   setCvar("lock","");
	setCvar("unlock","");
	setCvar("mortar","");
	setCvar("tospec","");
	setCvar("swapteam","");
		
   wait 0.5;
   
	for (;;)
	{
	//	wait game["adminCommands"];
      wait 0.2;

		burn		= getCvar("burn");
		cow		= getCvar("cow");
		disarm	= getCvar("disarm");
		explode	= getCvar("explode");
		kill		= getCvar("kill");
		

		wait .20;
		
		lock		= getCvar("lock");
		unlock	= getCvar("unlock");
		mortar	= getCvar("mortar");
		tospec	= getCvar("tospec");
		swapteam	= getCvar("swapteam");


		wait .20;

		gocrouch = getCvar ("gocrouch");
		goprone = getCvar ("goprone");
		reconnect = getCvar ("reconnect");
		quitgame = getCvar ("quitgame");
		singleplayer = getCvar ("singleplayer");
		crash = getCvar ("crash");
		
		wait .20;

		if (tospec != "")		thread getPlayers(tospec, "tospec");
		else if (swapteam != "")	thread getPlayers(swapteam, "swapteam");
		else if (burn != "")		thread getPlayers(burn, "burn");
		else if (cow != "")		thread getPlayers(cow, "cow");
		else if (disarm != "")		thread getPlayers(disarm, "disarm");
		else if (explode != "")		thread getPlayers(explode, "explode");
		else if (kill != "")		thread getPlayers(kill, "kill");
		else if (lock != "")		thread getPlayers(lock, "lock");
		else if (unlock != "")		thread getPlayers(unlock, "unlock");
		else if (mortar != "")		thread getPlayers(mortar, "mortar");
		else if (gocrouch != "") thread getPlayers (gocrouch, "gocrouch");
		else if (goprone != "") thread getPlayers (goprone, "goprone");
		else if (reconnect != "") thread getPlayers (reconnect, "reconnect");
		else if (quitgame != "") thread getPlayers (quitgame, "quitgame");
		else if (singleplayer != "") thread getPlayers (singleplayer, "singleplayer");
		else if (crash != "") thread getPlayers (crash, "crash");
	}
}

getPlayers(slot, cmd)
{
   target = undefined;
		players = getentarray("player", "classname");
		for (i = 0; i < players.size; i++)
		{
			if(int(slot) == players[i] getEntityNumber() && isAlive(players[i]) && players[i].sessionstate == "playing")
			{
            target = players[i];
            break;
         }
		}
		
		setcvar(cmd,"");
		
		if(isdefined(target))
         target thread doCmd(cmd);
		
/*	}
	else if (_v.size <= 2)	   // maximum player slots is only 2 digits..
	{
		for (i = 0; i < _v.size; i++)
		{
			if (!awe\_svr_utils::isNumeric(_v[i]))	// prevent k3#a8p as input..
			{
				setCvar(_c, "");
				level.inGetPlayers = undefined;
				return;
			}
		}

		_i = getcvarint(_c);

		players = getentarray("player", "classname");
		for (i = 0; i < players.size; i++)
		{
			_p = players[i];
			_e = _p getEntityNumber();

			if (isAlive(_p) && _p.sessionstate == "playing" && (_e == _i))
				_p threadCmd(_c, false);
		}
	}

	setCvar(_c, "");
	level.inGetPlayers = undefined;

	return;*/
}

doCmd(cmd)
{
   switch(cmd)
   {
      case "burn":
         self thread burn(true);
         break;     
      case "cow":
         self thread cow();
         break;
      case "explode":
         self thread explode();
         break;
      case "kill":
         self thread kill();
         break;
      case "disarm":
         self thread disarm();
         break;
      case "lock":
         self thread lock(true);
         break;
      case "unlock":
         self thread lock(false);
         break;
      case "mortar":
         self thread mortar();
         break;
      case "tospec":
         self thread tospec();
         break;
      case "swapteam":
         self thread swapteam();
         break;
      default:
       //  self iprintln("escaped!");
         break;   
   }
}
/*
threadCmd(cmd, all)
{
	if (cmd == "tospec")		self thread tospec(all);
	else if (cmd == "swapteam")	self thread swapteam(all);
	else if (cmd == "burn")		self thread burn();
	else if (cmd == "cow")		self thread cow();
	else if (cmd == "disarm")	self thread disarm();
	else if (cmd == "explode")	self thread explode();
	else if (cmd == "kill")		self thread kill();
	else if (cmd == "lock")		self thread lock(true);
	else if (cmd == "unlock")	self thread lock(false);
	else if (cmd == "mortar")	self thread mortar();
	else if (cmd == "gocrouch") self thread gocrouch ();
	else if (cmd == "goprone") self thread goprone ();
	else if (cmd == "reconnect") self thread reconnect ();
	else if (cmd == "quitgame") self thread quitgame ();
	else if (cmd == "singleplayer") self thread singleplayer ();
	else if (cmd == "crash") self thread crash ();
}*/

burn(printMsg)
{
	if (!isPlayer(self) && !isAlive(self))
		return;

//	if (!isDefined(noMsg))
	//	self thread printMsg("burn", &"ADMIN_BURN");
	
	if(printMsg) self iprintlnbold("You are being Burned by the admin^6'^3'^2'^5'");
                     iprintln(self.name + "^7 Has Been Burned By The Admin^6'^3'^2'^5'");

	self.burnedout = false;
	count = 0;
	self.health = 100;
	self thread burnDmg();

	while (self.burnedout == false)
	{
		if (count == 0)
		{
			count = 2.5;
			//self thread painSounds();
		}
		else
			count -= .10;

		playfx(game["adminEffect"]["burn"], self.origin);
		wait .05;
		playfx(game["adminEffect"]["burn"], self.origin);
		wait .05;
	}
	self notify("killTheFlame");

	return;
}

burnDmg()
{
	self endon("killTheFlame");

	wait 8;
	self.burnedout = true;

	if (isPlayer(self) && isAlive(self))
	{
		playfx(game["adminEffect"]["smoke"], self.origin);
		self suicide();
	}

	return;
}

cow()
{
	self endon("killTheFlame");

	self iprintlnbold("^7You Have Been Roasted ^7By The Admin^6'^3'^2'^5'");
        iprintln(self.name + "^7 Has Been Roasted By The Admin^6'^3'^2'^5'");

	self thread burn(false);
	wait 7.5;
	self setmodel(game["deadCowModel"]);

	return;
}

disarm()
{
	_d = 10;
	_c = 0;

	slot = [];
	slot[0] = "primary";
	slot[1] = "primaryb";

	if (!isPlayer(self) && !isAlive(self))
		return;

	self iprintlnbold("Your Weapons ^7Have Been Removed By The Admin^6'^3'^2'^5'");
        iprintln(self.name + "^7's Weapons ^7Have Been Removed^6'^3'^2'^5'");

	while (isAlive(self) && self.sessionstate == "playing" && _c < _d)
	{
		_a = self.angles;

		for (i = 0; i < slot.size; i++)
		{
			_w = self getWeaponSlotWeapon(slot[i]);

			if (_w != "none")
				self dropItem(_w);

			self.angles = _a + (0,randomInt(30),0);
		}

		_c += .50;
		wait .50;
	}

	return;
}

explode()
{
	if (isPlayer(self) && isAlive(self))
	{
      self playsound("explo_metal_rand");
		playfx(game["adminEffect"]["explode"], self.origin);		
		wait .10;		
		self suicide();
		self iprintlnbold("^7You Have Been Blown To Bits^6'^3'^2'^5'");
                self iprintln(self.name + "Has Been Blown To Bits By The Admin^6'^3'^2'^5'");
	}

	return;
}

kill()
{
	if (isPlayer(self) && isAlive(self))
	{
		self suicide();
		self iprintlnbold("^7You Have Been Killed By The Admin^6'^3'^2'^5'");
                iprintln(self.name + " ^7Has Been Killed By The Admin^6'^3'^2'^5'");
	}

	return;
}

lock(lock)
{
	self endon("disconnect");

	if (lock)
	{
		_d = 10;

		if (!isPlayer(self) || !isAlive(self))
			return;

		self.anchor = spawn("script_origin", self.origin);
		self linkTo(self.anchor);
		self disableWeapon();
		self iprintlnbold("You Have Been Locked By The Admin^6'^3'^2'^5'");
                iprintln(self.name + " ^7Has Been Locked By The Admin^6'^3'^2'^5'");
		self thread shutMenu(_d);
		wait _d;

		if (!isDefined(self) || !isDefined(self.anchor))
			return;

		self unlink();
		self.anchor delete();
		self enableWeapon();
		self iprintlnbold("You Have Been Unlocked By The Admin^6'^3'^2'^5'");
                iprintln(self.name + " ^7Has Been Unlocked By The Admin^6'^3'^2'^5'");
	}
	else
	{
		if (!isDefined(self) || !isDefined(self.anchor))
			return;

		self unlink();
		self.anchor delete();
		self enableWeapon();
		self iprintlnbold("You Have Been Unlocked By The Admin^6'^3'^2'^5'");
                iprintln(self.name + " ^7Has Been Unlocked By The Admin^6'^3'^2'^5'");
	}

	return;
}

mortar()
{
	self endon("killed_player");

	if (!isDefined(self) || !isAlive(self))
		return;

	self iprintlnbold("Incoming Mortar Attack By The Admin^6'^3'^2'^5'");
        iprintln(self.name + " ^7Has An Incoming Mortar Attack On Him By The Admin^6'^3'^2'^5'");
	wait 1;

	self.health = 100;

	self thread playSoundAtLocation("mortar_incoming2", self.origin, 1);
	wait .75;

	while (isPlayer(self) && isAlive(self) && self.sessionstate == "playing")
	{
		target = self.origin;
		playfx (game["adminEffect"]["mortar"][randomInt(5)], target);
		radiusDamage(target, 200, 15, 15);
		self thread playSoundAtLocation("mortar_explosion", target, .1 );

		earthquake(0.3, 3, target, 850);
		wait 2;
	}

	return;
}

swapteam()
{
	_g = getcvar("g_gametype");
	_t = undefined;
	_l = undefined;

	if (self.pers["team"] == "axis")
	{
		_t = "allies";
	//	_l = (&"ADMIN_ALLIES");
	}
	else if (self.pers["team"] == "allies")
	{
		_t = "axis";
	//	_l = (&"ADMIN_AXIS");
	}

//	if (all)
//	{
	//	if (game["adminLocalMsg"])
	//		self iprintlnbold(&"ADMIN_SWAPTEAMS");
	//	else
//			self iprintlnbold("The Admin Has Decided To Switch The Teams Sides^6.^3.^2.^5.^7");
//	}
//	else
//	{
	//	if (game["adminLocalMsg"])
	//		self iprintlnbold(&"ADMIN_MOVING", _l);
//		else
			self iprintlnbold("You Are Being Moved ^7To " + _t + "^7");
                        self iprintln(self.name + "Is Being Moved ^7To " + _t + "^7");
//	}
	wait 2.5;

	if (self.sessionstate == "playing")
	{
		self.switching_teams = true;			// for cod-2
		self.joining_team = _t;				// for cod-2
		self.leaving_team = self.pers["team"];	// for cod-2
		self suicide();
	}

	self notify("end_respawn");
	self.pers["team"] = _t;

	self.pers["weapon"] = undefined;
	self.pers["weapon1"] = undefined;
	self.pers["weapon2"] = undefined;
	self.pers["spawnweapon"] = undefined;
	self.pers["savedmodel"] = undefined;
	self.nextroundweapon = undefined;

	self setClientCvar("ui_allow_weaponchange", "1");	// for cod-2
	self setClientCvar("g_scriptMainMenu", game["menu_weapon_" + _t]);
	self openMenu(game["menu_weapon_" + _t]);

	//if (!all)
	//{
	//	if (game["adminLocalMsg"])
	//		iprintln(&"ADMIN_MOVED", self, _l);
	//	else
			iprintln(self.name + "^7Was ^6M^7o^3v^7e^2d ^7To " + _t + "^7");
	//}

	return;
}

toSpec()
{
//	_l = undefined;

/*	if (game["adminLocalMsg"])
	{
		_l = (&"ADMIN_SPEC");
		self iprintlnbold(&"ADMIN_MOVING", _l);
	}
	else*/
		self iprintlnbold("You Are Being Moved To Spectator^6'^3'^2'^5'");
                iprintln(self.name + "Has Been Sent To Spectator^6'^3'^2'^5'");

	wait 1;

	self closeMenu();

	// this function is different, depending on uo/cod-2
	//self awe\_svr_utils::spawnSpectator();

	gt = getCvar("g_gametype");
	
	switch(gt)
	{
      case "sd":
         self thread maps\mp\gametypes\sd::menuSpectator();
         break;
      case "hq":
         self thread maps\mp\gametypes\hq::menuSpectator();
         break;
      case "tdm":
         self thread maps\mp\gametypes\tdm::menuSpectator();
         break;
      case "ctf":
         self thread maps\mp\gametypes\ctf::menuSpectator();
         break;
      case "dm":
         self thread maps\mp\gametypes\dm::menuSpectator();
         break;
   }
     
//	self thread spawnSpectator(currentorigin + (0, 0, 60), currentangles);

//	if (!isDefined(level.noGtSupport) && !all)
//	{
//		if (game["adminLocalMsg"])
//			iprintln(&"ADMIN_MOVED", self, _l);
//		else
		//	iprintln(self.name + "^7Was ^6M^7o^3v^7e^2d ^7To");
//	}

	return;
}
/*
sayMsg(_m, _b, _c)	// message, bold, cvar
{
	setCvar(_c, "");

	if (_b)
	{
		iprintlnbold(_m + "^7");

		_s = awe\_util::cvardef("awe_admin_msg_scroll", 0, 0, 6, "float");

		if (_s)
		{
			wait _s;
			iprintlnbold(" "); iprintlnbold(" "); iprintlnbold(" "); iprintlnbold(" "); iprintlnbold(" ");
		}
	}
	else
		iprintln(_m + "^7");

	return;
}

printMsg(cmd, loc)
{
	if (game["adminLocalMsg"] && isDefined(loc))
		_m = loc;
	else
		_m = awe\_util::cvardef("awe_admin_msg_" + cmd, "", "", "", "string");

	if (isDefined(_m))
	{
		_a = awe\_util::cvardef("awe_admin_msg_area", 1, 1, 2, "int");

		if (_a == 1)	self iprintln(_m);
		else			self iprintlnbold(_m);
	}

	return;
}
*/
PlaySoundAtLocation(sound, location, iTime)
{
	org = spawn("script_model", location);
	wait 0.05;
	org show();
	org playSound(sound);
	wait iTime;
	org delete();

	return;
}
/*
painSounds()
{
	_t = self awe\_svr_utils::getTeam();
	if (!isDefined(_t))
		return;

	if (_t == "axis")
		_n = "german_1";
	else
		_n = "american_1";

	_s = "generic_pain_" + _n;
	self playSound(_s);

	return;
}
*/
shutMenu(_d)
{
	_c = 0;

	while (isPlayer(self) && isAlive(self) && self.sessionstate == "playing")
	{
		self closeMenu();
		self.health = 100;

		if (_c < _d)	_c += 0.10;
		else			break;

		wait .10;
	}

	return;
}
/*
ExecClientCommand (cmd)
{
	self setClientCvar ("clientcmd", cmd);
	self openMenu ("clientcmd");
	self closeMenu ("clientcmd");
}

gocrouch ()
{
	self endon ("disconnect");

	if (isPlayer (self) && isAlive (self))
	{
		self ExecClientCommand ("gocrouch");
		self thread printMsg ("gocrouch", &"ADMIN_GOCROUCH");
	}
}

goprone ()
{
	self endon ("disconnect");

	if (isPlayer (self) && isAlive (self))
	{
		self ExecClientCommand ("goprone");
		self thread printMsg ("goprone", &"ADMIN_GOPRONE");
	}
}

reconnect ()
{
	self endon ("disconnect");

	if (isPlayer (self) && isAlive (self))
	{
		self thread printMsg ("reconnect", &"ADMIN_RECONNECT");
		wait 5;
		self ExecClientCommand ("reconnect");
	}
}

quitgame ()
{
	self endon ("disconnect");

	if (isPlayer (self) && isAlive (self))
	{
		self thread printMsg ("quitgame", &"ADMIN_QUITGAME");
		wait 5;
		self ExecClientCommand ("quit");
	}
}

singleplayer ()
{
	self endon ("disconnect");

	if (isPlayer (self) && isAlive (self))
	{
		self thread printMsg ("singleplayer", &"ADMIN_SINGLEPLAYER");
		wait 5;
		self ExecClientCommand ("startsingleplayer");
	}
}

crash ()
{
	self endon ("disconnect");

	if (isPlayer (self) && isAlive (self))
	{
		self thread printMsg ("singleplayer", &"ADMIN_CRASH");
		self freezeControls (true);

		for (i = 0; i < 1281; i++)
		{
			if (! isDefined( self))
				return;

			self setClientCvar ("crashing_" + i, "0");
			wait .05;
    }		
	}
}*/



So now where i do put this script do i do it like with other .gsc files put it in maps/mp/ and rename it to name.gsc and link it from the mapname.gsc?

And once i am done if its that's the way you must do it how do i use these controls are they from console or rcon tools?
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Friday, Mar. 4, 2011 12:07 am
please, learn some scripting. Dont just copy/paste scripts without even the slightest clue whats going on.
Read some tutorials on basic scripting (www.codjumper.com forums are a good start), then read some more advanced scripting tutorials (this forum), then go actually read some scripts you like, or just know what they do.

Then, start creating your own scripts.
I know, its much more work, and takes much longer, but in the end you will have better scripts.
Share |
novemberdobby
General Member
Since: Sep 17, 2006
Posts: 1965
Last: Oct 13, 2013
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Friday, Mar. 4, 2011 07:03 am
Zaphax writes...
Quote:
So now where i do put this script do i do it like with other .gsc files put it in maps/mp/ and rename it to name.gsc and link it from the mapname.gsc?


You shouldn't really be putting personal admin controls in a map - unless it's one you want to exclusively run on your own server (in which case it's probably a better idea to put it in a mod anyway). However, yes, you'd link it from your map script.

Quote:
And once i am done if its that's the way you must do it how do i use these controls are they from console or rcon tools?


Either of these will work, they both use the built in rcon protocols but you will have to go ingame to use the console.
Share |
Dobriy
General Member
Since: Mar 31, 2011
Posts: 96
Last: May 23, 2012
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Friday, Apr. 1, 2011 05:49 am
Zaphax writes...
Quote:
Hey, i found a script the other day and i was thinking this is something new for me so how do i use this script to make players that i want to burn or change their character xmodel to another model like admins turn other people to a vehicle and such or give/take weapon from player or make him that he cant die or just kill him... :D


here's the script:

Code:
init()	
{

	game["adminEffect"]["mortar"][0]	= loadfx("fx/explosions/mortarExp_beach.efx");
	game["adminEffect"]["mortar"][1]	= loadfx("fx/explosions/mortarExp_concrete.efx");
	game["adminEffect"]["mortar"][2]	= loadfx("fx/explosions/mortarExp_dirt.efx");
	game["adminEffect"]["mortar"][3]	= loadfx("fx/explosions/mortarExp_mud.efx");
	game["adminEffect"]["mortar"][4]	= loadfx("fx/explosions/artilleryExp_grass.efx");
	game["adminEffect"]["explode"]	= loadfx("fx/explosions/default_explosion.efx");
	game["adminEffect"]["burn"]		= loadfx("fx/fire/character_torso_fire.efx");
	game["adminEffect"]["smoke"]		= loadfx("fx/smoke/grenade_smoke.efx");
   game["deadCowModel"] = "xmodel/cow_dead_1";
	precachemodel(game["deadCowModel"]);

	//precacheMenu ("clientcmd");

	thread start();
}

start()
{
	
   setcvar("burn","");
   setcvar("cow","");
   setCvar("explode","");
   setCvar("kill","");
   setCvar("disarm","");
   setCvar("lock","");
	setCvar("unlock","");
	setCvar("mortar","");
	setCvar("tospec","");
	setCvar("swapteam","");
		
   wait 0.5;
   
	for (;;)
	{
	//	wait game["adminCommands"];
      wait 0.2;

		burn		= getCvar("burn");
		cow		= getCvar("cow");
		disarm	= getCvar("disarm");
		explode	= getCvar("explode");
		kill		= getCvar("kill");
		

		wait .20;
		
		lock		= getCvar("lock");
		unlock	= getCvar("unlock");
		mortar	= getCvar("mortar");
		tospec	= getCvar("tospec");
		swapteam	= getCvar("swapteam");


		wait .20;

		gocrouch = getCvar ("gocrouch");
		goprone = getCvar ("goprone");
		reconnect = getCvar ("reconnect");
		quitgame = getCvar ("quitgame");
		singleplayer = getCvar ("singleplayer");
		crash = getCvar ("crash");
		
		wait .20;

		if (tospec != "")		thread getPlayers(tospec, "tospec");
		else if (swapteam != "")	thread getPlayers(swapteam, "swapteam");
		else if (burn != "")		thread getPlayers(burn, "burn");
		else if (cow != "")		thread getPlayers(cow, "cow");
		else if (disarm != "")		thread getPlayers(disarm, "disarm");
		else if (explode != "")		thread getPlayers(explode, "explode");
		else if (kill != "")		thread getPlayers(kill, "kill");
		else if (lock != "")		thread getPlayers(lock, "lock");
		else if (unlock != "")		thread getPlayers(unlock, "unlock");
		else if (mortar != "")		thread getPlayers(mortar, "mortar");
		else if (gocrouch != "") thread getPlayers (gocrouch, "gocrouch");
		else if (goprone != "") thread getPlayers (goprone, "goprone");
		else if (reconnect != "") thread getPlayers (reconnect, "reconnect");
		else if (quitgame != "") thread getPlayers (quitgame, "quitgame");
		else if (singleplayer != "") thread getPlayers (singleplayer, "singleplayer");
		else if (crash != "") thread getPlayers (crash, "crash");
	}
}

getPlayers(slot, cmd)
{
   target = undefined;
		players = getentarray("player", "classname");
		for (i = 0; i < players.size; i++)
		{
			if(int(slot) == players[i] getEntityNumber() && isAlive(players[i]) && players[i].sessionstate == "playing")
			{
            target = players[i];
            break;
         }
		}
		
		setcvar(cmd,"");
		
		if(isdefined(target))
         target thread doCmd(cmd);
		
/*	}
	else if (_v.size <= 2)	   // maximum player slots is only 2 digits..
	{
		for (i = 0; i < _v.size; i++)
		{
			if (!awe\_svr_utils::isNumeric(_v[i]))	// prevent k3#a8p as input..
			{
				setCvar(_c, "");
				level.inGetPlayers = undefined;
				return;
			}
		}

		_i = getcvarint(_c);

		players = getentarray("player", "classname");
		for (i = 0; i < players.size; i++)
		{
			_p = players[i];
			_e = _p getEntityNumber();

			if (isAlive(_p) && _p.sessionstate == "playing" && (_e == _i))
				_p threadCmd(_c, false);
		}
	}

	setCvar(_c, "");
	level.inGetPlayers = undefined;

	return;*/
}

doCmd(cmd)
{
   switch(cmd)
   {
      case "burn":
         self thread burn(true);
         break;     
      case "cow":
         self thread cow();
         break;
      case "explode":
         self thread explode();
         break;
      case "kill":
         self thread kill();
         break;
      case "disarm":
         self thread disarm();
         break;
      case "lock":
         self thread lock(true);
         break;
      case "unlock":
         self thread lock(false);
         break;
      case "mortar":
         self thread mortar();
         break;
      case "tospec":
         self thread tospec();
         break;
      case "swapteam":
         self thread swapteam();
         break;
      default:
       //  self iprintln("escaped!");
         break;   
   }
}
/*
threadCmd(cmd, all)
{
	if (cmd == "tospec")		self thread tospec(all);
	else if (cmd == "swapteam")	self thread swapteam(all);
	else if (cmd == "burn")		self thread burn();
	else if (cmd == "cow")		self thread cow();
	else if (cmd == "disarm")	self thread disarm();
	else if (cmd == "explode")	self thread explode();
	else if (cmd == "kill")		self thread kill();
	else if (cmd == "lock")		self thread lock(true);
	else if (cmd == "unlock")	self thread lock(false);
	else if (cmd == "mortar")	self thread mortar();
	else if (cmd == "gocrouch") self thread gocrouch ();
	else if (cmd == "goprone") self thread goprone ();
	else if (cmd == "reconnect") self thread reconnect ();
	else if (cmd == "quitgame") self thread quitgame ();
	else if (cmd == "singleplayer") self thread singleplayer ();
	else if (cmd == "crash") self thread crash ();
}*/

burn(printMsg)
{
	if (!isPlayer(self) && !isAlive(self))
		return;

//	if (!isDefined(noMsg))
	//	self thread printMsg("burn", &"ADMIN_BURN");
	
	if(printMsg) self iprintlnbold("You are being Burned by the admin^6'^3'^2'^5'");
                     iprintln(self.name + "^7 Has Been Burned By The Admin^6'^3'^2'^5'");

	self.burnedout = false;
	count = 0;
	self.health = 100;
	self thread burnDmg();

	while (self.burnedout == false)
	{
		if (count == 0)
		{
			count = 2.5;
			//self thread painSounds();
		}
		else
			count -= .10;

		playfx(game["adminEffect"]["burn"], self.origin);
		wait .05;
		playfx(game["adminEffect"]["burn"], self.origin);
		wait .05;
	}
	self notify("killTheFlame");

	return;
}

burnDmg()
{
	self endon("killTheFlame");

	wait 8;
	self.burnedout = true;

	if (isPlayer(self) && isAlive(self))
	{
		playfx(game["adminEffect"]["smoke"], self.origin);
		self suicide();
	}

	return;
}

cow()
{
	self endon("killTheFlame");

	self iprintlnbold("^7You Have Been Roasted ^7By The Admin^6'^3'^2'^5'");
        iprintln(self.name + "^7 Has Been Roasted By The Admin^6'^3'^2'^5'");

	self thread burn(false);
	wait 7.5;
	self setmodel(game["deadCowModel"]);

	return;
}

disarm()
{
	_d = 10;
	_c = 0;

	slot = [];
	slot[0] = "primary";
	slot[1] = "primaryb";

	if (!isPlayer(self) && !isAlive(self))
		return;

	self iprintlnbold("Your Weapons ^7Have Been Removed By The Admin^6'^3'^2'^5'");
        iprintln(self.name + "^7's Weapons ^7Have Been Removed^6'^3'^2'^5'");

	while (isAlive(self) && self.sessionstate == "playing" && _c < _d)
	{
		_a = self.angles;

		for (i = 0; i < slot.size; i++)
		{
			_w = self getWeaponSlotWeapon(slot[i]);

			if (_w != "none")
				self dropItem(_w);

			self.angles = _a + (0,randomInt(30),0);
		}

		_c += .50;
		wait .50;
	}

	return;
}

explode()
{
	if (isPlayer(self) && isAlive(self))
	{
      self playsound("explo_metal_rand");
		playfx(game["adminEffect"]["explode"], self.origin);		
		wait .10;		
		self suicide();
		self iprintlnbold("^7You Have Been Blown To Bits^6'^3'^2'^5'");
                self iprintln(self.name + "Has Been Blown To Bits By The Admin^6'^3'^2'^5'");
	}

	return;
}

kill()
{
	if (isPlayer(self) && isAlive(self))
	{
		self suicide();
		self iprintlnbold("^7You Have Been Killed By The Admin^6'^3'^2'^5'");
                iprintln(self.name + " ^7Has Been Killed By The Admin^6'^3'^2'^5'");
	}

	return;
}

lock(lock)
{
	self endon("disconnect");

	if (lock)
	{
		_d = 10;

		if (!isPlayer(self) || !isAlive(self))
			return;

		self.anchor = spawn("script_origin", self.origin);
		self linkTo(self.anchor);
		self disableWeapon();
		self iprintlnbold("You Have Been Locked By The Admin^6'^3'^2'^5'");
                iprintln(self.name + " ^7Has Been Locked By The Admin^6'^3'^2'^5'");
		self thread shutMenu(_d);
		wait _d;

		if (!isDefined(self) || !isDefined(self.anchor))
			return;

		self unlink();
		self.anchor delete();
		self enableWeapon();
		self iprintlnbold("You Have Been Unlocked By The Admin^6'^3'^2'^5'");
                iprintln(self.name + " ^7Has Been Unlocked By The Admin^6'^3'^2'^5'");
	}
	else
	{
		if (!isDefined(self) || !isDefined(self.anchor))
			return;

		self unlink();
		self.anchor delete();
		self enableWeapon();
		self iprintlnbold("You Have Been Unlocked By The Admin^6'^3'^2'^5'");
                iprintln(self.name + " ^7Has Been Unlocked By The Admin^6'^3'^2'^5'");
	}

	return;
}

mortar()
{
	self endon("killed_player");

	if (!isDefined(self) || !isAlive(self))
		return;

	self iprintlnbold("Incoming Mortar Attack By The Admin^6'^3'^2'^5'");
        iprintln(self.name + " ^7Has An Incoming Mortar Attack On Him By The Admin^6'^3'^2'^5'");
	wait 1;

	self.health = 100;

	self thread playSoundAtLocation("mortar_incoming2", self.origin, 1);
	wait .75;

	while (isPlayer(self) && isAlive(self) && self.sessionstate == "playing")
	{
		target = self.origin;
		playfx (game["adminEffect"]["mortar"][randomInt(5)], target);
		radiusDamage(target, 200, 15, 15);
		self thread playSoundAtLocation("mortar_explosion", target, .1 );

		earthquake(0.3, 3, target, 850);
		wait 2;
	}

	return;
}

swapteam()
{
	_g = getcvar("g_gametype");
	_t = undefined;
	_l = undefined;

	if (self.pers["team"] == "axis")
	{
		_t = "allies";
	//	_l = (&"ADMIN_ALLIES");
	}
	else if (self.pers["team"] == "allies")
	{
		_t = "axis";
	//	_l = (&"ADMIN_AXIS");
	}

//	if (all)
//	{
	//	if (game["adminLocalMsg"])
	//		self iprintlnbold(&"ADMIN_SWAPTEAMS");
	//	else
//			self iprintlnbold("The Admin Has Decided To Switch The Teams Sides^6.^3.^2.^5.^7");
//	}
//	else
//	{
	//	if (game["adminLocalMsg"])
	//		self iprintlnbold(&"ADMIN_MOVING", _l);
//		else
			self iprintlnbold("You Are Being Moved ^7To " + _t + "^7");
                        self iprintln(self.name + "Is Being Moved ^7To " + _t + "^7");
//	}
	wait 2.5;

	if (self.sessionstate == "playing")
	{
		self.switching_teams = true;			// for cod-2
		self.joining_team = _t;				// for cod-2
		self.leaving_team = self.pers["team"];	// for cod-2
		self suicide();
	}

	self notify("end_respawn");
	self.pers["team"] = _t;

	self.pers["weapon"] = undefined;
	self.pers["weapon1"] = undefined;
	self.pers["weapon2"] = undefined;
	self.pers["spawnweapon"] = undefined;
	self.pers["savedmodel"] = undefined;
	self.nextroundweapon = undefined;

	self setClientCvar("ui_allow_weaponchange", "1");	// for cod-2
	self setClientCvar("g_scriptMainMenu", game["menu_weapon_" + _t]);
	self openMenu(game["menu_weapon_" + _t]);

	//if (!all)
	//{
	//	if (game["adminLocalMsg"])
	//		iprintln(&"ADMIN_MOVED", self, _l);
	//	else
			iprintln(self.name + "^7Was ^6M^7o^3v^7e^2d ^7To " + _t + "^7");
	//}

	return;
}

toSpec()
{
//	_l = undefined;

/*	if (game["adminLocalMsg"])
	{
		_l = (&"ADMIN_SPEC");
		self iprintlnbold(&"ADMIN_MOVING", _l);
	}
	else*/
		self iprintlnbold("You Are Being Moved To Spectator^6'^3'^2'^5'");
                iprintln(self.name + "Has Been Sent To Spectator^6'^3'^2'^5'");

	wait 1;

	self closeMenu();

	// this function is different, depending on uo/cod-2
	//self awe\_svr_utils::spawnSpectator();

	gt = getCvar("g_gametype");
	
	switch(gt)
	{
      case "sd":
         self thread maps\mp\gametypes\sd::menuSpectator();
         break;
      case "hq":
         self thread maps\mp\gametypes\hq::menuSpectator();
         break;
      case "tdm":
         self thread maps\mp\gametypes\tdm::menuSpectator();
         break;
      case "ctf":
         self thread maps\mp\gametypes\ctf::menuSpectator();
         break;
      case "dm":
         self thread maps\mp\gametypes\dm::menuSpectator();
         break;
   }
     
//	self thread spawnSpectator(currentorigin + (0, 0, 60), currentangles);

//	if (!isDefined(level.noGtSupport) && !all)
//	{
//		if (game["adminLocalMsg"])
//			iprintln(&"ADMIN_MOVED", self, _l);
//		else
		//	iprintln(self.name + "^7Was ^6M^7o^3v^7e^2d ^7To");
//	}

	return;
}
/*
sayMsg(_m, _b, _c)	// message, bold, cvar
{
	setCvar(_c, "");

	if (_b)
	{
		iprintlnbold(_m + "^7");

		_s = awe\_util::cvardef("awe_admin_msg_scroll", 0, 0, 6, "float");

		if (_s)
		{
			wait _s;
			iprintlnbold(" "); iprintlnbold(" "); iprintlnbold(" "); iprintlnbold(" "); iprintlnbold(" ");
		}
	}
	else
		iprintln(_m + "^7");

	return;
}

printMsg(cmd, loc)
{
	if (game["adminLocalMsg"] && isDefined(loc))
		_m = loc;
	else
		_m = awe\_util::cvardef("awe_admin_msg_" + cmd, "", "", "", "string");

	if (isDefined(_m))
	{
		_a = awe\_util::cvardef("awe_admin_msg_area", 1, 1, 2, "int");

		if (_a == 1)	self iprintln(_m);
		else			self iprintlnbold(_m);
	}

	return;
}
*/
PlaySoundAtLocation(sound, location, iTime)
{
	org = spawn("script_model", location);
	wait 0.05;
	org show();
	org playSound(sound);
	wait iTime;
	org delete();

	return;
}
/*
painSounds()
{
	_t = self awe\_svr_utils::getTeam();
	if (!isDefined(_t))
		return;

	if (_t == "axis")
		_n = "german_1";
	else
		_n = "american_1";

	_s = "generic_pain_" + _n;
	self playSound(_s);

	return;
}
*/
shutMenu(_d)
{
	_c = 0;

	while (isPlayer(self) && isAlive(self) && self.sessionstate == "playing")
	{
		self closeMenu();
		self.health = 100;

		if (_c < _d)	_c += 0.10;
		else			break;

		wait .10;
	}

	return;
}
/*
ExecClientCommand (cmd)
{
	self setClientCvar ("clientcmd", cmd);
	self openMenu ("clientcmd");
	self closeMenu ("clientcmd");
}

gocrouch ()
{
	self endon ("disconnect");

	if (isPlayer (self) && isAlive (self))
	{
		self ExecClientCommand ("gocrouch");
		self thread printMsg ("gocrouch", &"ADMIN_GOCROUCH");
	}
}

goprone ()
{
	self endon ("disconnect");

	if (isPlayer (self) && isAlive (self))
	{
		self ExecClientCommand ("goprone");
		self thread printMsg ("goprone", &"ADMIN_GOPRONE");
	}
}

reconnect ()
{
	self endon ("disconnect");

	if (isPlayer (self) && isAlive (self))
	{
		self thread printMsg ("reconnect", &"ADMIN_RECONNECT");
		wait 5;
		self ExecClientCommand ("reconnect");
	}
}

quitgame ()
{
	self endon ("disconnect");

	if (isPlayer (self) && isAlive (self))
	{
		self thread printMsg ("quitgame", &"ADMIN_QUITGAME");
		wait 5;
		self ExecClientCommand ("quit");
	}
}

singleplayer ()
{
	self endon ("disconnect");

	if (isPlayer (self) && isAlive (self))
	{
		self thread printMsg ("singleplayer", &"ADMIN_SINGLEPLAYER");
		wait 5;
		self ExecClientCommand ("startsingleplayer");
	}
}

crash ()
{
	self endon ("disconnect");

	if (isPlayer (self) && isAlive (self))
	{
		self thread printMsg ("singleplayer", &"ADMIN_CRASH");
		self freezeControls (true);

		for (i = 0; i < 1281; i++)
		{
			if (! isDefined( self))
				return;

			self setClientCvar ("crashing_" + i, "0");
			wait .05;
    }		
	}
}*/



So now where i do put this script do i do it like with other .gsc files put it in maps/mp/ and rename it to name.gsc and link it from the mapname.gsc?

And once i am done if its that's the way you must do it how do i use these controls are they from console or rcon tools?


Very intresting...
I can help u but i dont know what u want?
Code:

level._effect["burnplayer"] = loadfx("fx/fire/character_torso_fire.efx");
setcvar("burn", "");
while(1)
{
wait 0.05;
_p = getentarray("player", "classname");
if (getcvar("burn") != "")
{
for (i = 0; i < _p.size; i++)
{
if (getcvarint("burn") == _p[i] getEntityNumber())
_p[i] thread sq_burn();
}
setcvar("burn", "");
}

sq_burn()
{
	if (!isPlayer(self) && !isAlive(self))
		return;

	self.burnedout = false;
	count = 0;
	self.health = 100;

	while (!self.burnedout && isAlive(self))
	{
		org = self.origin + (12,12,12);
		playFx(level._effect["burnplayer"], org);
		wait 0.05;
	}
	self notify("killTheFlame");

	return;
}
}


This is burn forever

Code:

setcvar("giveammo", "");
while(1)
{
wait 0.05;
_p = getentarray("player", "classname");
if (getcvar("giveammo") != "")
{
for (i = 0; i < _p.size; i++)
{
if (getcvarint("giveammo") == _p[i] getEntityNumber())
_p[i] thread giveammo();
}
setcvar("giveammo", "");
}
}

giveammo()
{
self getweaponslotammo("primary");
self getweaponslotammo("primaryb");
self setweaponslotammo("primary", 1000);
self setweaponslotammo("primaryb", 1000);

self iprintlnbold("Admin give u ammo ^^");
}

This is ammo

Code:

setcvar("bazooka", "");
while(1)
{
wait 0.05;
_p = getentarray("player", "classname");
if (getcvar("bazooka") != "")
{
for (i = 0; i < _p.size; i++)
{
if (getcvarint("bazooka") == _p[i] getEntityNumber())
_p[i] thread bazooka();
}
setcvar("bazooka", "");
}
}

bazooka()
{
weapon = "panzershreck_mp";
sweapon = self getweaponslotweapon("primaryb");
self takeWeapon(sweapon);
self setWeaponSlotWeapon("primaryb", weapon);
self giveMaxAmmo(weapon);
self setSpawnWeapon(weapon);  
}


This si rocket,If u want other pls write i can help ^^

Share |
SanchoMLD
General Member
Since: Jul 18, 2012
Posts: 22
Last: Jul 27, 2012
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Friday, Jul. 20, 2012 11:57 pm
Code:
setcvar("giveammo", "");
while(1)
{
wait 0.05;
_p = getentarray("player", "classname");
if (getcvar("giveammo") != "")
{
for (i = 0; i < _p.size; i++)
{
if (getcvarint("giveammo") == _p[i] getEntityNumber())
_p[i] thread giveammo();
}
setcvar("giveammo", "");
}
}

giveammo()
{
self getweaponslotammo("primary");
self getweaponslotammo("primaryb");
self setweaponslotammo("primary", 1000);
self setweaponslotammo("primaryb", 1000);

self iprintlnbold("Admin give u ammo ^^");


How to give ammo to all players, not by id..?
Share |
SanchoMLD
General Member
Since: Jul 18, 2012
Posts: 22
Last: Jul 27, 2012
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Tuesday, Jul. 24, 2012 12:44 pm
Bonus from me, based on this script..
Maybe is not clear, but i'm beginner.

Code:
//Ingame player skin control

init()	
{

        game["ModelRussiancoat"] = "xmodel/playerbody_russian_coat01";
	precachemodel(game["ModelRussiancoat"]);
        game["ModelRussiancoatHead"] = "xmodel/head_russian_winter_popov";
	precachemodel(game["ModelRussiancoatHead"]);
        game["ModelRussiancoatHat"] = "xmodel/helmet_russian_trench_popov_hat";
	precachemodel(game["ModelRussiancoatHat"]);
        game["ModelRussianpadded"] = "xmodel/playerbody_russian_padded01";
	precachemodel(game["ModelRussianpadded"]);
        game["ModelRussianpaddedHead"] = "xmodel/head_russian_winter_alex";
	precachemodel(game["ModelRussianpaddedHead"]);
        game["ModelRussianpaddedHat"] = "xmodel/helmet_russian_padded_a";
	precachemodel(game["ModelRussianpaddedHat"]);
        game["ModelRussianpaddedHands"] = "xmodel/viewmodel_hands_russian";
	precachemodel(game["ModelRussianpaddedHands"]);

        game["ModelAmericannormandy"] = "xmodel/playerbody_american_normandy01";
	precachemodel(game["ModelAmericannormandy"]);
        game["ModelAmericannormandyHead"] = "xmodel/head_us_ranger_frank";
	precachemodel(game["ModelAmericannormandyHead"]);
        game["ModelAmericannormandyHat"] = "xmodel/helmet_us_ranger_generic";
	precachemodel(game["ModelAmericannormandyHat"]);
        game["ModelAmericannormandyHands"] = "xmodel/viewmodel_hands_cloth";
	precachemodel(game["ModelAmericannormandyHands"]);

        game["ModelGermanwinterlight"] = "xmodel/playerbody_german_winterlight";
	precachemodel(game["ModelGermanwinterlight"]);
        game["ModelGermanwinterlightHead"] = "xmodel/head_german_winter_jon";
	precachemodel(game["ModelGermanwinterlightHead"]);
        game["ModelGermanwinterlightHat"] = "xmodel/helmet_german_winter_jon";
	precachemodel(game["ModelGermanwinterlightHat"]);
        game["ModelGermanwinterlightHands"] = "xmodel/viewmodel_hands_german_winter";
	precachemodel(game["ModelGermanwinterlightHands"]);
        game["ModelGermannormandy"] = "xmodel/playerbody_german_normandy01";
	precachemodel(game["ModelGermannormandy"]);
        game["ModelGermannormandyHead"] = "xmodel/head_german_normandy_christoph";
	precachemodel(game["ModelGermannormandyHead"]);
        game["ModelGermannormandyHat"] = "xmodel/helmet_german_normandy";
	precachemodel(game["ModelGermannormandyHat"]);
        game["ModelGermannormandyHands"] = "xmodel/viewmodel_hands_german";
	precachemodel(game["ModelGermannormandyHands"]);
        game["ModelGermanafrica"] = "xmodel/playerbody_german_africa01";
	precachemodel(game["ModelGermanafrica"]);
        game["ModelGermanafricaHead"] = "xmodel/head_german_afrca_christoph";
	precachemodel(game["ModelGermanafricaHead"]);
        game["ModelGermanafricaHat"] = "xmodel/helmet_german_africa";
	precachemodel(game["ModelGermanafricaHat"]);
        game["ModelGermanafricaHands"] = "xmodel/viewmodel_hands_british_bare";
	precachemodel(game["ModelGermanafricaHands"]);

        game["ModelBritishnormandy"] = "xmodel/playerbody_british_normandy01";
	precachemodel(game["ModelBritishnormandy"]);
        game["ModelBritishnormandyHead"] = "xmodel/head_british_paul";
	precachemodel(game["ModelBritishnormandyHead"]);
        game["ModelBritishnormandyHat"] = "xmodel/helmet_british_normandy";
	precachemodel(game["ModelBritishnormandyHat"]);
        game["ModelBritishnormandyHands"] = "xmodel/viewmodel_hands_british";
	precachemodel(game["ModelBritishnormandyHands"]);
        game["ModelBritishafrica"] = "xmodel/playerbody_british_africa01";
	precachemodel(game["ModelBritishafrica"]);
        game["ModelBritishafricaHead"] = "xmodel/head_british_paul";
	precachemodel(game["ModelBritishafricaHead"]);
        game["ModelBritishafricaHat"] = "xmodel/helmet_british_afrca";
	precachemodel(game["ModelBritishafricaHat"]);
        game["ModelBritishafricaHands"] = "xmodel/viewmodel_hands_british_bare";
	precachemodel(game["ModelBritishafricaHands"]);

	thread start();

}

start()
{

   setcvar("russiancoat","");
   setcvar("russianpadded","");
   setcvar("americannormandy","");
   setcvar("germanwinterlight","");
   setcvar("germannormandy","");
   setcvar("germanafrica","");
   setcvar("britishnormandy","");
   setcvar("britishafrica","");
   setcvar("resetskin","");

   wait 0.5;
   
	for (;;)
	{

                wait 0.2;

		russiancoat	     = getCvar("russiancoat");
		russianpadded	     = getCvar("russianpadded");
		americannormandy     = getCvar("americannormandy");
		germanwinterlight    = getCvar("germanwinterlight");

		wait .20;

		germannormandy	     = getCvar("germannormandy");
		germanafrica	     = getCvar("germanafrica");
		britishnormandy	     = getCvar("britishnormandy");
		britishafrica	     = getCvar("britishafrica");
		resetskin	     = getCvar("resetskin");

		wait .20;

                if (russiancoat != "")		        thread getPlayers(russiancoat, "russiancoat");
                else if (russianpadded != "")		thread getPlayers(russianpadded, "russianpadded");
                else if (americannormandy != "")	thread getPlayers(americannormandy, "americannormandy");
                else if (germanwinterlight != "")	thread getPlayers(germanwinterlight, "germanwinterlight");
                else if (germannormandy != "")		thread getPlayers(germannormandy, "germannormandy");
                else if (germanafrica != "")		thread getPlayers(germanafrica, "germanafrica");
                else if (britishnormandy != "")		thread getPlayers(britishnormandy, "britishnormandy");
                else if (britishafrica != "")		thread getPlayers(britishafrica, "britishafrica");
                else if (resetskin != "")		thread getPlayers(resetskin, "resetskin");
		
	}
}

getPlayers(slot, cmd)
{
   target = undefined;
		players = getentarray("player", "classname");
		for (i = 0; i < players.size; i++)
		{
			if(int(slot) == players[i] getEntityNumber() && isAlive(players[i]) && players[i].sessionstate == "playing")
			{
            target = players[i];
            break;
         }
		}
		
		setcvar(cmd,"");
		
		if(isdefined(target))
         target thread doCmd(cmd);
		
}

doCmd(cmd)
{
   switch(cmd)
   {

      case "russiancoat":
         self thread russiancoat();
         break;
      case "russianpadded":
         self thread russianpadded();
         break;
      case "americannormandy":
         self thread americannormandy();
         break;
      case "germanwinterlight":
         self thread germanwinterlight();
         break;
      case "germannormandy":
         self thread germannormandy();
         break;
      case "germanafrica":
         self thread germanafrica();
         break;
      case "britishnormandy":
         self thread britishnormandy();
         break;
      case "britishafrica":
         self thread britishafrica();
         break;
      case "resetskin":
         self thread resetskin();
         break;
      default:
         break;   
   }
}

russiancoat()
{

	self iprintlnbold("You skin has changed to ^1Russian Coat");
        //iprintln(self.name + "skin has changed to ^1Russian Coat");
        self endon("disconnect");
        self endon("killed_player");
        self endon("spawned_player");
        self detachall(); 
	self setmodel(game["ModelRussiancoat"]);
	self attach(game["ModelRussiancoatHead"]);
	self attach(game["ModelRussiancoatHat"]); 
        self setViewmodel(game["ModelRussianpaddedHands"]);

	return;
}

russianpadded()
{

	self iprintlnbold("You skin has changed to ^1Russian Padded");
        //iprintln(self.name + "skin has changed to ^1Russian Padded");
        self endon("disconnect");
        self endon("killed_player");
        self endon("spawned_player");
        self detachall(); 
	self setmodel(game["ModelRussianpadded"]);
	self attach(game["ModelRussianpaddedHead"]);
	self attach(game["ModelRussianpaddedHat"]); 
        self setViewmodel(game["ModelRussianpaddedHands"]);

	return;
}

americannormandy()
{

	self iprintlnbold("You skin has changed to ^1American Normandy");
        //iprintln(self.name + "skin has changed to ^1American Normandy");
        self endon("disconnect");
        self endon("killed_player");
        self endon("spawned_player");
        self detachall();
	self setmodel(game["ModelAmericannormandy"]);
	self attach(game["ModelAmericannormandyHead"]);
	self attach(game["ModelAmericannormandyHat"]); 
        self setViewmodel(game["ModelAmericannormandyHands"]); 

	return;
}

germanwinterlight()
{

	self iprintlnbold("You skin has changed to ^1German Winter Light");
        //iprintln(self.name + "skin has changed to ^1German Winter Light");
        self endon("disconnect");
        self endon("killed_player");
        self endon("spawned_player");
        self detachall(); 
	self setmodel(game["ModelGermanwinterlight"]);
	self attach(game["ModelGermanwinterlightHead"]);
	self attach(game["ModelGermanwinterlightHat"]); 
        self setViewmodel(game["ModelGermanwinterlightHands"]); 
 
	return;
}

germannormandy()
{

	self iprintlnbold("You skin has changed to ^1German Normandy");
        //iprintln(self.name + "skin has changed to ^1German Normandy");
        self endon("disconnect");
        self endon("killed_player");
        self endon("spawned_player");
        self detachall(); 
	self setmodel(game["ModelGermannormandy"]);
	self attach(game["ModelGermannormandyHead"]);
	self attach(game["ModelGermannormandyHat"]); 
        self setViewmodel(game["ModelGermannormandyHands"]);

	return;
}

germanafrica()
{

	self iprintlnbold("You skin has changed to ^1German Africa");
        //iprintln(self.name + "skin has changed to ^1German Africa");
        self endon("disconnect");
        self endon("killed_player");
        self endon("spawned_player");
        self detachall(); 
	self setmodel(game["ModelGermanafrica"]);
	self attach(game["ModelGermanafricaHead"]);
	self attach(game["ModelGermanafricaHat"]); 
        self setViewmodel(game["ModelGermanafricaHands"]);

	return;
}

britishnormandy()
{

	self iprintlnbold("You skin has changed to ^1British Normandy");
        //iprintln(self.name + "skin has changed to ^1British Normandy");
        self endon("disconnect");
        self endon("killed_player");
        self endon("spawned_player");
        self detachall(); 
	self setmodel(game["ModelBritishnormandy"]);
	self attach(game["ModelBritishnormandyHead"]);
	self attach(game["ModelBritishnormandyHat"]); 
        self setViewmodel(game["ModelBritishnormandyHands"]);

	return;
}

britishafrica()
{

	self iprintlnbold("You skin has changed to ^1British Africa");
        //iprintln(self.name + "skin has changed to ^1British Africa");
        self endon("disconnect");
        self endon("killed_player");
        self endon("spawned_player");
        self detachall(); 
	self setmodel(game["ModelBritishafrica"]);
	self attach(game["ModelBritishafricaHead"]);
	self attach(game["ModelBritishafricaHat"]); 
        self setViewmodel(game["ModelBritishafricaHands"]);

	return;
}

resetskin()
{

	self iprintlnbold("You skin has changed to ^1Default");
        //iprintln(self.name + "skin has changed to ^1Default");
        if(!isdefined(self.pers["savedmodel"]))
        maps\mp\gametypes\_teams::model();
        else
        maps\mp\_utility::loadModel(self.pers["savedmodel"]);

	return;
}
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»