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

Members Online

»
0 Active | 7 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 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
Category: CoD+UO General
General game questions, comments, and chat.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Changing Score points
danman181
General Member
Since: Oct 10, 2005
Posts: 51
Last: Aug 28, 2006
[view latest posts]
Level 3
Category: CoD+UO General
Posted: Tuesday, Aug. 15, 2006 12:33 am
How do you change the amount of points you get per kill, i saw a mod on a server one day that did this and i was wondering how you do that?

Thanks in advance
Share |
codmp
General Member
Since: Feb 7, 2006
Posts: 905
Last: Aug 1, 2011
[view latest posts]
Level 7
Category: CoD+UO General
Posted: Tuesday, Aug. 15, 2006 12:50 am
you could actually go into the stock pk3s and copy a gametype and rename it then scroll down to the code that looks like this

Code:
Callback_PlayerKilled(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc)
{
	self endon("spawned");
	
	if(self.sessionteam == "spectator")
		return;

	// If the player was killed by a head shot, let players know it was a head shot kill
	if(sHitLoc == "head" && sMeansOfDeath != "MOD_MELEE")
		sMeansOfDeath = "MOD_HEAD_SHOT";
		
	q = 2;
	p = 1;

	// send out an obituary message to all clients about the kill
	obituary(self, attacker, sWeapon, sMeansOfDeath);
	
	self.sessionstate = "dead";
	self.statusicon = "gfx/hud/hud@status_dead.tga";
	self.headicon = "";
	self.deaths++;

	lpselfnum = self getEntityNumber();
	lpselfname = self.name;
	lpselfteam = self.pers["team"];
	lpattackerteam = "";

	attackerNum = -1;
	if(isPlayer(attacker))
	{
		if(attacker == self) // killed himself
		{
			doKillcam = false;

			attacker.score = self.score + q;
			
			if(isdefined(attacker.reflectdamage))
				clientAnnouncement(attacker, &"MPSCRIPT_FRIENDLY_FIRE_WILL_NOT"); 
		}
		else
		{
			attackerNum = attacker getEntityNumber();
			doKillcam = true;

			if(self.pers["team"] == attacker.pers["team"]) // killed by a friendly
				attacker.score++;
			else
			{
				attacker.score--;

				teamscore = getTeamScore(attacker.pers["team"]);
				teamscore++;
				setTeamScore(attacker.pers["team"], teamscore);
			
				checkScoreLimit();
			}
		}

		lpattacknum = attacker getEntityNumber();
		lpattackname = attacker.name;
		lpattackerteam = attacker.pers["team"];
	}
	else // If you weren't killed by a player, you were in the wrong place at the wrong time
	{
		doKillcam = false;
		
		self.score++;

		lpattacknum = -1;
		lpattackname = "";
		lpattackerteam = "world";
	}

	logPrint("K;" + lpselfnum + ";" + lpselfteam + ";" + lpselfname + ";" + lpattacknum + ";" + lpattackerteam + ";" + lpattackname + ";" + sWeapon + ";" + iDamage + ";" + sMeansOfDeath + ";" + sHitLoc + "\n");

	// Stop thread if map ended on this death
	if(level.mapended)
		return;

	// Make the player drop his weapon
	self dropItem(self getcurrentweapon());
	
	// Make the player drop health
	self dropHealth();

	body = self cloneplayer();

	delay = 2;	// Delay the player becoming a spectator till after he's done dying
	wait delay;	// ?? Also required for Callback_PlayerKilled to complete before respawn/killcam can execute

	if(getcvarint("scr_forcerespawn") > 0)
		doKillcam = false;

	if(doKillcam)
		self thread killcam(attackerNum, delay);
	else
		self thread respawn();
}

(NOTE: this code taken from TDM script then modified by me and renamed to tdm2)

where it says attacker.score you change it from the ++ (adding one) to something like attacker.score = self.score + 2 . That would add 2 to your current score. You also use variables that would equal a certain value like 2, so you just put the variable in instead writing 2.



edited on Aug. 14, 2006 08:52 pm by codmp
Share |
general99
General Member
Since: Oct 31, 2004
Posts: 323
Last: Dec 18, 2013
[view latest posts]
Level 5
Category: CoD+UO General
Posted: Tuesday, Aug. 15, 2006 06:11 am
You would of course EXTRACT the gametype, modify it and save it to a mod. Do not alter the stock files.
Share |
codmp
General Member
Since: Feb 7, 2006
Posts: 905
Last: Aug 1, 2011
[view latest posts]
Level 7
Category: CoD+UO General
Posted: Tuesday, Aug. 15, 2006 07:24 am
exactly....also make sure when saving u either have zzz or user- in front of the name of your mod.

Also the break tags in the code aren't suppose to be there.

edited on Aug. 15, 2006 03:26 am by codmp
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty : CoD+UO General

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

»