Author |
Topic: Mine |
Ploxxy |
General Member Since: May 1, 2009 Posts: 170 Last: Aug 31, 2011 [view latest posts] |
|
|
|
|
IzNoGoD |
General Member Since: Nov 29, 2008 Posts: 694 Last: Nov 10, 2012 [view latest posts] |
|
|
|
Ploxxy |
General Member Since: May 1, 2009 Posts: 170 Last: Aug 31, 2011 [view latest posts] |
|
|
|
|
Dutch77 |
|
General Member Since: Oct 7, 2007 Posts: 48 Last: May 5, 2011 [view latest posts] |
|
|
|
Dutch77 |
|
General Member Since: Oct 7, 2007 Posts: 48 Last: May 5, 2011 [view latest posts] |
|
|
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 |
|
|
|
IzNoGoD |
General Member Since: Nov 29, 2008 Posts: 694 Last: Nov 10, 2012 [view latest posts] |
|
|
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();
}
|
|
|
|
Ploxxy |
General Member Since: May 1, 2009 Posts: 170 Last: Aug 31, 2011 [view latest posts] |
|
|
|
|
IzNoGoD |
General Member Since: Nov 29, 2008 Posts: 694 Last: Nov 10, 2012 [view latest posts] |
|
|
|
Dutch77 |
|
General Member Since: Oct 7, 2007 Posts: 48 Last: May 5, 2011 [view latest posts] |
|
|
|
liltc64 |
General Member Since: Feb 12, 2007 Posts: 906 Last: Oct 22, 2012 [view latest posts] |
|
|
|
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. |
|
|
|