codjumper + unlock all weapons

Chat area specifically for CoDJumper

Moderator: Core Staff

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

Post by Drofder2004 » December 5th, 2007, 5:43 pm

I have no problem with people editing it, I just erm, would prefer to know what they have edited and why. There is nothing worse than seeing a whole load of gibberish added to a mod you are suppose to be working on. A lot of the stuff just well doesn't make much sense and because it is lots of variables, it is hard to find where they lead to and what they do.

I will be looking at both the edited version of the mod and the RAW modwarfare 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

Jeffro
CJ Donator
CJ Donator
Posts: 157
Joined: April 21st, 2006, 9:58 pm
Location: Netherlands
Contact:

Post by Jeffro » December 5th, 2007, 5:45 pm

Thats true, I know how a pain in the ass it is if you can't fidn all stuff you need to find. I script in php mostly but it is annoying yeah.

Jeffro
CJ Donator
CJ Donator
Posts: 157
Joined: April 21st, 2006, 9:58 pm
Location: Netherlands
Contact:

Post by Jeffro » December 5th, 2007, 5:52 pm

MY EDITS:

Code: Select all

doHUDMessages()
{
	self waittill("spawned_player");
	self iprintlnbold("Don't die so fast.");
	if(!isdefined(self.pers["cj_hudmsg"]))
	{
		wait 1;
		self iprintlnbold("Welcome to this server.");
		self iprintlnbold("Don't block other people.");
		wait 3;
		self iprintlnbold("Take turns when doing jumps!");
		wait 3;
		self iprintlnbold("Listen to the admins!");
		wait 6;
		self iprintlnbold("Use the Melee key (Default V) to save.");
		wait 6;
		self iprintlnbold("Use the Use key (Default F) to load.");
		self.pers["cj_hudmsg"] = true;
	}
}
Yes I know this is the same as codjumper for cod2 but it should work. Why it doesn't... I don't know.


Addes full position calculation code also from the cod2 mod.

Code: Select all

positions(range)
{
	if(!range)
		return true;

	// Get all players and pick out the ones that are playing
	allplayers = getentarray("player", "classname");
	players = [];
	for(i = 0; i < allplayers.size; i++)
	{
		if(allplayers[i].sessionstate == "playing")
			players[players.size] = allplayers[i];
	}

	// Get the players that are in range
	sortedplayers = sortByDist(players, self);

	// Need at least 2 players (myself + one team mate)
	if(sortedplayers.size<2)
		return false;

	// First player will be myself so check against second player
	distance = distance(self.saved_origin, sortedplayers[1].origin);
	if( distance <= range )
		return true;
	else
		return false;
}

sortByDist(points, startpoint, maxdist, mindist)
{
	if(!isdefined(points))
		return undefined;
	if(!isdefineD(startpoint))
		return undefined;

	if(!isdefined(mindist))
		mindist = -1000000;
	if(!isdefined(maxdist))
		maxdist = 1000000; // almost 16 miles, should cover everything.

	sortedpoints = [];

	max = points.size-1;
	for(i = 0; i < max; i++)
	{
		nextdist = 1000000;
		next = undefined;

		for(j = 0; j < points.size; j++)
		{
			thisdist = distance(startpoint.origin, points[j].origin);
			if(thisdist <= nextdist && thisdist <= maxdist && thisdist >= mindist)
			{
				next = j;
				nextdist = thisdist;
			}
		}

		if(!isdefined(next))
			break; // didn't find one that fit the range, stop trying

		sortedpoints[i] = points[next];

		// shorten the list, fewer compares
		points[next] = points[points.size-1]; // replace the closest point with the end of the list
		points[points.size-1] = undefined; // cut off the end of the list
	}

	sortedpoints[sortedpoints.size] = points[0]; // the last point in the list

	return sortedpoints;
}
The actual mod. Has been made in a way to enable air loading but disable air saving. (needed for jump maps and such later on.)

Code: Select all

_MeleeKey()
{
	self endon("end_saveposition_threads");
	self endon("disconnect");

	for(;;)
	{
		if(self meleeButtonPressed())
			{
				catch_next = false;
	
				for(i=0; i<=0.10; i+=0.01)
				{
					if(catch_next && self meleeButtonPressed())
					{
						wait 0.1;
						if(self isOnground())
						{
							self thread savePos();
							wait 1;
							break;
						}
					}
					else if(!(self meleeButtonPressed()))
						catch_next = true;
	
					wait 0.01;
				}
			}
		


		wait 0.05;
	}

}

_UseKey()
{
	self endon("end_saveposition_threads");
	self endon("disconnect");

	for(;;)
	{
		if(self useButtonPressed())
		{
			catch_next = false;

			for(i=0; i<=0.10; i+=0.01)
			{
				if(catch_next && self useButtonPressed())
				{
					wait 0.1;
					self thread loadPos();
					wait 1;
					break;
				}
				else if(!(self useButtonPressed()))
					catch_next = true;

				wait 0.01;
			}
		}

		wait 0.05;
	}
}

loadPos()
{
	//thread positions();
	
	if(!isDefined(self.saved_origin))
		{
		self iprintlnbold("^1T^7here is no previous position to load.");
		return;
		}
	else
	{
		if(self positions(55))
			{
			self iprintlnbold("^1P^7osition Occupied.");
			self iprintlnbold("^1P^7lease Wait.");
			return;
			}
		else
			{
			self setPlayerAngles(self.saved_angles); // angles need to come first
			self setOrigin(self.saved_origin);
			self iprintln("^2P^7revious position loaded.");
			}
	}
}

savePos()
{
	self.saved_origin = self.origin;
	self.saved_angles = self.angles;
	self iprintln("^2P^7osition saved.");
}
Thats all I did.

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

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

I couldn't find where you threaded "doHUDmessages();"
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

Jeffro
CJ Donator
CJ Donator
Posts: 157
Joined: April 21st, 2006, 9:58 pm
Location: Netherlands
Contact:

Post by Jeffro » December 5th, 2007, 5:58 pm

:oops: Oops xD

Stupid of me :P

Well thread it then ^_^

Also can we do Localized strings again so we can make this stuff a little easier :P



edit: so this would work? :)

Code: Select all

setup()
{
	for(;;)
	{
		level waittill("connecting", player);
		player thread _MeleeKey();
		player thread _UseKey();
		player thread doHUDMessages();
		player checkGrenade();
	}
}

Jeffro
CJ Donator
CJ Donator
Posts: 157
Joined: April 21st, 2006, 9:58 pm
Location: Netherlands
Contact:

Post by Jeffro » December 5th, 2007, 6:09 pm

Yup works :)

I learned another thing now. Thank you drofder :D

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

Post by Drofder2004 » December 5th, 2007, 6:10 pm

Jeffro wrote:Also can we do Localized strings again so we can make this stuff a little easier :P
I usually add this towards the end. I also know beta testers are having problems with it atm, so we shall wait.

congratulations on getting it working ;)
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

Jeffro
CJ Donator
CJ Donator
Posts: 157
Joined: April 21st, 2006, 9:58 pm
Location: Netherlands
Contact:

Post by Jeffro » December 5th, 2007, 7:51 pm

:) I hope this mod will be done soon so everyone can play ^_^

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

Post by steveuk » December 6th, 2007, 11:16 pm

Hows the new mod cumming, hope it'll be here soon, cant wait untill i and other people try it..
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 7th, 2007, 6:02 am

steveuk wrote:Hows the new mod cumming, hope it'll be here soon, cant wait untill i and other people try it..
Steve
I highly doubt the mod is "cumming"
Image
Image

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Post by Soviet » December 7th, 2007, 3:33 pm

Hey! no fair stealing my comment :(

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 7th, 2007, 6:42 pm

haha, had to see that coming!!

zomg, I made a joke!
matt101harris wrote:big cock was the first thing that came to my head lol

shadowrun
CJ Wannabe
CJ Wannabe
Posts: 8
Joined: December 15th, 2007, 11:56 am

Post by shadowrun » December 15th, 2007, 12:07 pm

As make in CODJUMPER MOD, In order to it acted SAVE POSITION on two persons??

Help!
Cod4 Jumper :)

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

Post by Drofder2004 » December 15th, 2007, 11:36 pm

Check the ANNOUNCEMENT section for the updated version (New & improved)
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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest