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

Members Online

»
0 Active | 91 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

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
Page
Next Page
subscribe
Author Topic: Mine
Ploxxy
General Member
Since: May 1, 2009
Posts: 170
Last: Aug 31, 2011
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Tuesday, Nov. 23, 2010 08:56 pm
Due to me not knowing how to build a mine script, My friend taught me. I thank him for that. But now i have come into a problem. I dont know how to make it so if the person runs over the mine, it kills them, BUT whoever layed the mine, gets the kill. For testing i put self suicide(); but now i know the script works. i want it to work completely so could anyone help me?

Question: How do i make it so the person dies, but, the kill goes to the person who released the mine?

Please help.

S:Plox
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Tuesday, Nov. 23, 2010 10:21 pm
I can help you and i should still have you on xf.
Ask me tomorrow.
Share |
Ploxxy
General Member
Since: May 1, 2009
Posts: 170
Last: Aug 31, 2011
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Tuesday, Nov. 23, 2010 11:11 pm
Okay, but i recently deleted almost all of my xfire friends so ill have to readd you i think. and thanks
Share |
Dutch77
General Member
Since: Oct 7, 2007
Posts: 48
Last: May 5, 2011
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Wednesday, Nov. 24, 2010 11:27 pm
can you please post that part of code? It could be very helpful for me either.
Share |
Dutch77
General Member
Since: Oct 7, 2007
Posts: 48
Last: May 5, 2011
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Thursday, Nov. 25, 2010 10:11 pm
please I don't want to start a new topic for that

Code:

bombremote()
{
    startOrigin = self getEye()+(0,0,18);
    forward = anglesToForward( self getplayerangles() );
    forward = maps\mp\_utility::vectorScale( forward, 100000 );
    endOrigin = startOrigin + forward;
      
      trace = bulletTrace( startOrigin, endOrigin, false, self );
      angles = vectortoangles(vectornormalize(trace["normal"])) + (90,0,0);
	    
      bombremote = spawn("script_model", trace["position"]);
      bombremote.angles = angles;			
      bombremote setmodel("xmodel/mp_tntbomb");
			
while (1)
      {
      if(self UseButtonPressed()) 
          {
          self iprintln("!!!BOOM!!!");
          level._effect["mortexplosion"] = loadfx("fx/explosions/flak88_explosion.efx");
         playfx(level._effect["mortexplosion"], bombremote.origin);
         bombremote playSound("flak88_explode");
         radiusDamage (bombremote.origin+(0,0,30), 400, 200, 80);
         bombremote delete();
         return(0);
          }
          wait(0.05);
      }
			
}


I tried few things but it never worked :( Can someone show it on this piece of code?

edited on Nov. 25, 2010 05:12 pm by Dutch77
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Thursday, Nov. 25, 2010 11:29 pm
change to this:

Code:

bombremote()
{
    startOrigin = self getEye()+(0,0,18);
    forward = anglesToForward( self getplayerangles() );
    forward = maps\mp\_utility::vectorScale( forward, 100000 );
    endOrigin = startOrigin + forward;
      
      trace = bulletTrace( startOrigin, endOrigin, false, self );
      angles = vectortoangles(vectornormalize(trace["normal"])) + (90,0,0);
	    
      bombremote = spawn("script_model", trace["position"]);
      bombremote.angles = angles;			
      bombremote setmodel("xmodel/mp_tntbomb");
			
while (!self usebuttonpressed())
      wait 0.05;

self iprintln("!!!BOOM!!!");
          level._effect["mortexplosion"] = loadfx("fx/explosions/flak88_explosion.efx");
         playfx(level._effect["mortexplosion"], bombremote.origin);
         bombremote playSound("flak88_explode");
         radiusDamage (bombremote.origin+(0,0,30), 400, 200, 80);
         bombremote delete();		
}
Share |
Ploxxy
General Member
Since: May 1, 2009
Posts: 170
Last: Aug 31, 2011
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Friday, Nov. 26, 2010 02:58 am
i figured out the damage on my own by expirimenting with a line from the default tdm.gsc lol. found out how so iznogod when you went afk i think idk. lol i tested bymself. foundout how. so yea. :) lol. anyway yea iznogod fixed ur code but why the self iprintln("BOOM"); thats not needed at all. thats just a waste of time. and no offense but at my point of view. pointless...
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Friday, Nov. 26, 2010 07:41 am
all i did was fix the usebuttonpressed() stuff, nothing more, nothing less
Share |
Dutch77
General Member
Since: Oct 7, 2007
Posts: 48
Last: May 5, 2011
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Friday, Nov. 26, 2010 01:16 pm
thanks for advices (fixing/improving right now), but that wasn't what I asked for, what I needed. This script works fine... I just need: If bomb kill someone, then give kill to a person who planted the bomb.


Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Friday, Nov. 26, 2010 03:48 pm
Dutch think about it like this. say me and you are in a server. i shoot you in the face and you die it says i killed you. when i shoot you the script will run callback_playerdamage() and when you die it goes to callback_playerkilled(). if you acctualy take the time to look at the callback_playerdamage you can see alot of nice stuff you can do with that. now think about the mine, you want to do the same thing. so think of my mine as my rifle just the mine is on the ground instead of in my hands but its gona wana run threw the same process.

Callback_PlayerDamage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime)

you want to thread that from your mine script but you want to fill in the arguments so basicly play fill in the blanks with this. eInflictor would be the mine, eAttacker would be self, iDamage would be how much damage you want this mine to do and so for so try it you and see how it goes.
Share |
Restricted Access Topic is Locked
Page
Next Page
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

»