Tear grenades in cod4 found!!! (gas grenades) in memory!!!

General chat area for anything whatsoever

Moderator: Core Staff

poltergeistluxx
CJ Wannabe
CJ Wannabe
Posts: 29
Joined: November 25th, 2007, 1:01 pm

Tear grenades in cod4 found!!! (gas grenades) in memory!!!

Post by poltergeistluxx » December 17th, 2007, 2:11 am

Hi i just found something cool ...
there is an teargrenade.gsc ... that does mean that the developpers disbled the gas grenades like it looks :P
now we try to reactivate and put it in the game a s a mod ...

Here is the video: http://youtube.com/watch?v=Q0qfoz0kcHc

And here the code:

Code: Select all

main()
{
	level.tearradius = 170;
	level.tearheight = 128;
	level.teargasfillduration = 7; // time until gas fills the area specified
	level.teargasduration = 23; // duration gas remains in area
	level.tearsufferingduration = 3; // (duration after leaving area of effect)
	
	level.teargrenadetimer = 4; // should match time to appearance of effect
	
	precacheShellShock("teargas");
	
	fgmonitor = maps\mp\gametypes\_perplayer::init("tear_grenade_monitor", ::startMonitoringTearUsage, ::stopMonitoringTearUsage);
	maps\mp\gametypes\_perplayer::enable(fgmonitor);
}

startMonitoringTearUsage()
{
	self thread monitorTearUsage();
}
stopMonitoringTearUsage(disconnected)
{
	self notify("stop_monitoring_tear_usage");
}

monitorTearUsage()
{
	self endon("stop_monitoring_tear_usage");
	
	wait .05;
	
	if (!self hasWeapon("tear_grenade_mp"))
		return;
	
	// when this player's tear grenade ammo goes down, assume the nearest "grenade" entity is a tear grenade.
	
	prevammo = self getammocount("tear_grenade_mp");
	while(1)
	{
		ammo = self getammocount("tear_grenade_mp");
		if (ammo < prevammo)
		{
			num = prevammo - ammo;
			iprintln(num);
			for (i = 0; i < num; i++)
			{
				grenades = getEntArray("grenade", "classname");
				bestdist = undefined;
				bestg = undefined;
				for (g = 0; g < grenades.size; g++)
				{
					if (!isdefined(grenades[g].teargrenade))
					{
						dist = distance(grenades[g].origin, self.origin + (0,0,48));
						if (!isdefined(bestdist) || dist < bestdist)
						{
							bestdist = dist;
							bestg = g;
						}
					}
				}
				if (isdefined(bestdist))
				{
					grenades[bestg].teargrenade = true;
					grenades[bestg] thread tearGrenade_think(self.pers["team"]);
				}
			}
		}
		prevammo = ammo;
		wait .05;
	}
}

tearGrenade_think(team)
{
	// wait for death
	
	// (grenade doesn't actually die until finished smoking)
	wait level.teargrenadetimer;
	
	ent = spawnstruct();
	ent thread tear(self.origin);
}

tear(pos)
{
	trig = spawn("trigger_radius", pos, 0, level.tearradius, level.tearheight);
	
	//thread drawcylinder(pos, level.tearradius, level.tearheight);
	
	starttime = gettime();
	
	self thread teartimer();
	self endon("tear_timeout");
	
	while(1)
	{
		trig waittill("trigger", player);
		
		if (player.sessionstate != "playing")
			continue;
		
		time = (gettime() - starttime) / 1000;
		
		currad = level.tearradius;
		curheight = level.tearheight;
		if (time < level.teargasfillduration) {
			currad = currad * (time / level.teargasfillduration);
			curheight = curheight * (time / level.teargasfillduration);
		}
		
		offset = (player.origin + (0,0,32)) - pos;
		offset2d = (offset[0], offset[1], 0);
		if (lengthsquared(offset2d) > currad*currad)
			continue;
		if (player.origin[2] - pos[2] > curheight)
			continue;
		
		player.teargasstarttime = gettime(); // purposely overriding old value
		if (!isdefined(player.teargassuffering))
			player thread teargassuffering();
	}
}
teartimer()
{
	wait level.teargasduration;
	self notify("tear_timeout");
}

teargassuffering()
{
	self endon("death");
	self endon("disconnect");
	
	self.teargassuffering = true;
	
	self shellshock("teargas", 60);
	
	while(1)
	{
		if (gettime() - self.teargasstarttime > level.tearsufferingduration * 1000)
			break;
		
		wait 1;
	}
	
	self shellshock("teargas", 1);
	
	self.teargassuffering = undefined;
}

drawcylinder(pos, rad, height)
{
	time = 0;
	while(1)
	{
		currad = rad;
		curheight = height;
		if (time < level.teargasfillduration) {
			currad = currad * (time / level.teargasfillduration);
			curheight = curheight * (time / level.teargasfillduration);
		}
		
		for (r = 0; r < 20; r++)
		{
			theta = r / 20 * 360;
			theta2 = (r + 1) / 20 * 360;
			
			line(pos + (cos(theta) * currad, sin(theta) * currad, 0), pos + (cos(theta2) * currad, sin(theta2) * currad, 0));
			line(pos + (cos(theta) * currad, sin(theta) * currad, curheight), pos + (cos(theta2) * currad, sin(theta2) * currad, curheight));
			line(pos + (cos(theta) * currad, sin(theta) * currad, 0), pos + (cos(theta) * currad, sin(theta) * currad, curheight));
		}
		time += .05;
		if (time > level.teargasduration)
			break;
		wait .05;
	}
}

steveuk
CJ G0D!
CJ G0D!
Posts: 1330
Joined: November 21st, 2006, 12:51 pm

Post by steveuk » December 17th, 2007, 3:24 am

Nice find poltergeistluxx

wounder why the disabled it.??
Still not sure if required for modding as the mods are for jumping, unless another modder might use it as a game feature in on of there mods.
Steve

JDogg
Too cool for CoDJumper
Too cool for CoDJumper
Posts: 3617
Joined: August 28th, 2007, 11:46 am
Location: Melbourne, Australia

Post by JDogg » December 17th, 2007, 6:01 am

steveuk wrote:Nice find poltergeistluxx

wounder why the disabled it.??
Still not sure if required for modding as the mods are for jumping, unless another modder might use it as a game feature in on of there mods.
Steve
Gas grenades cause lagg on servers
Image
Image

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » December 17th, 2007, 10:35 am

Yep, been looking at it, there are also many other things to find among the gsc files ;)
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

poltergeistluxx
CJ Wannabe
CJ Wannabe
Posts: 29
Joined: November 25th, 2007, 1:01 pm

Post by poltergeistluxx » December 17th, 2007, 1:25 pm

i'm searching for the charadcter.gsc or something like this i want to make a funny mod where the c4 can stick at the player ^^

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » December 17th, 2007, 5:57 pm

poltergeistluxx wrote:i'm searching for the charadcter.gsc or something like this i want to make a funny mod where the c4 can stick at the player ^^
Have you downloaded the rip from modcod4.com by Seven?
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Pedsdude
Site Admin
Site Admin
Posts: 15914
Joined: October 15th, 2004, 7:18 pm
Location: UK

Post by Pedsdude » December 18th, 2007, 4:20 am

Drofder2004 wrote:Yep, been looking at it, there are also many other things to find among the gsc files ;)
Such as? :)
Image
Image

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » December 18th, 2007, 10:16 am

Pedsdude wrote:
Drofder2004 wrote:Yep, been looking at it, there are also many other things to find among the gsc files ;)
Such as? :)
I am not at liberty to say. :P
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Marshall
CJ Spammer!
CJ Spammer!
Posts: 820
Joined: December 10th, 2005, 11:28 am
Location: UK

Post by Marshall » December 18th, 2007, 3:36 pm

So annoying going on different forums and seeing:

blah blah blah FOUND IN COD 4 MEMORY!

Come up with a half decent mod, explain were you got the resources.. then I'll be interested :)

atze<3
CJ G0D!
CJ G0D!
Posts: 1587
Joined: January 3rd, 2006, 9:38 am
Location: Germany

Post by atze<3 » December 18th, 2007, 4:11 pm

Marshall wrote:So annoying going on different forums and seeing:

blah blah blah FOUND IN COD 4 MEMORY!

Come up with a half decent mod, explain were you got the resources.. then I'll be interested :)

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » December 18th, 2007, 5:25 pm

Resources: ModCoD4.com
Sign up, download the Memory dump.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

poltergeistluxx
CJ Wannabe
CJ Wannabe
Posts: 29
Joined: November 25th, 2007, 1:01 pm

Post by poltergeistluxx » December 19th, 2007, 12:14 am

thanks for the link ^^
like it seems im not the first who find it :P

JDogg
Too cool for CoDJumper
Too cool for CoDJumper
Posts: 3617
Joined: August 28th, 2007, 11:46 am
Location: Melbourne, Australia

Post by JDogg » December 19th, 2007, 12:58 am

Marshall wrote:So annoying going on different forums and seeing:

blah blah blah FOUND IN COD 4 MEMORY!

Come up with a half decent mod, explain were you got the resources.. then I'll be interested :)
So true, who gives a shit what you find in memory, if you can't do anything with it?
Image
Image

User avatar
[SoE]_Zaitsev
Core Staff
Core Staff
Posts: 14220
Joined: October 21st, 2004, 7:17 pm
Location: Holland
Contact:

Post by [SoE]_Zaitsev » December 19th, 2007, 10:38 am

I dare to bet that it's just a matter of time before people find a way tbh.
matt101harris wrote:big cock was the first thing that came to my head lol

User avatar
Coontang
CJ G0D!
CJ G0D!
Posts: 1797
Joined: March 4th, 2007, 3:48 pm
Location: Painting by numbers

Post by Coontang » December 31st, 2007, 5:50 pm

Cant thisjust be put into a simple gas mod?
Image
JDogg: 'I have a video of me pissing, wanna see?'

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Amazon [Bot] and 2 guests