Hello guys i wanna ask you about script for cod2 killing zombies with drone

Do you need help with something ZN related or something to complain about?
Post Reply
bingatra
Posts: 2
Joined: Fri Apr 29, 2016 10:49 am

Hello guys i wanna ask you about script for cod2 killing zombies with drone

Post by bingatra » Fri Apr 29, 2016 12:09 pm

this is the code i have problem in trace when i hit the zombies only when the ground and bullet contacts and the zombie around the ground of trace
can someone help to kill zombies when i shoot them directly?
hello mitch can you help me!!
  1. if(self attackbuttonpressed() && !self.uvgraketa && self.dragonfiretime>=2)
  2.  
  3.          {
  4.  
  5.          earthquake(0.1,0.1, self.origin, 40);
  6.  
  7.          vec=anglestoforward(self.thunder.angles);
  8.  
  9.          firePos = self.thunderposl.origin+ vector_scale(vec, 20);        
  10.  
  11.          firePos2 = self.thunderposr.origin+ vector_scale(vec, 20);
  12.  
  13.          self.dragonfiretime=0;
  14.  
  15.            
  16.  
  17.          
  18.  
  19.          fireForward =  firePos + vector_scale(vec, 5000);
  20.  
  21.          fireForward2 =  firePos2 + vector_scale(vec, 5000);
  22.  
  23.          playfx(level._effect["20mm_uvg"], self.thunderposl.origin, vectorNormalize(fireForward - firePos ) );
  24.  
  25.          playfx(level._effect["20mm_uvg"], self.thunderposr.origin, vectorNormalize(fireForward2 - firePos2 ) );
  26.  
  27.          
  28.  
  29.          self playSound( "uvgshot", self.thunder.origin );
  30.  
  31.          self thread cannonBulletthunder( firePos, vec, fireForward);
  32.  
  33.          self thread cannonBulletthunder( firePos2, vec, fireForward2);
  34.  
  35.          zoms=getentarray("script_model","classname");
  36.  
  37.             trace=bullettrace(self geteye()+(0,0,18),self geteye()+(20000*vec[0],20000*vec[1],20000*vec[2]+18),true,self);
  38.  
  39.             for(i=0;i<zoms.size;i++)
  40.  
  41.             if(isdefined(zoms.id))
  42.  
  43.             {
  44.  
  45.                {
  46.  
  47.                   {
  48.  
  49.                      if(distance(trace["position"],zoms.origin)<80)
  50.  
  51.                      {
  52.  
  53.                      earthquake(0.5,1, trace["position"], 80);
  54.  
  55.                      zoms FinishPlayerDamage (zoms, self, 50, 0, "MOD_RIFLE_BULLET", "d2_mp",zoms.origin, (0,0,0), "none",0);
  56.  
  57.                      {
  58.  
  59.                      if(!zoms.boss)
  60.  
  61.                      zoms.trig notify("damage",int(level.zommaxhealth/800)+5000,self,true);
  62.  
  63.                      else
  64.  
  65.                      zoms.trig notify("damage",int(level.zommaxhealth/1600)+5000,self,true);
  66.  
  67.                      }
  68.  
  69.                      }
  70.  
  71.                   }
  72.  
  73.                }
  74.  
  75.             }
  76.  
  77.          
  78.  
  79.          }

User avatar
Mitch
Site Admin
Posts: 192
Joined: Sat Mar 02, 2013 10:45 pm

Re: Hello guys i wanna ask you about script for cod2 killing zombies with drone

Post by Mitch » Wed May 25, 2016 11:10 pm

Hello bingatra,

What is the current result of the code?
And what do you want the code to do?
(if you can't explain it then make screenshots or a video)

I think if i understand your problem correctly it has to do with the bullet trace.
So see: https://znation.nl/cod4script/bullettrace.htm

If you need further help, you could post your problem on killtube.org. It has a few members who are still active (including me).
Image

bingatra
Posts: 2
Joined: Fri Apr 29, 2016 10:49 am

Re: Hello guys i wanna ask you about script for cod2 killing zombies with drone

Post by bingatra » Sat Jul 23, 2016 12:00 am

well it make like the zombies dies only when you shoot the ground they dont die when you hit them only when you shoot their legs how to fix it?


playfxontag(level._effect["20mm_uvg"], self.uvggun, "tag_flash_left");
playfxontag(level._effect["20mm_uvg"], self.uvggun, "tag_flash_right");
playfxontag(level._effect["rifle"], self.uvggun, "tag_flash_right");
playfxontag(level._effect["rifle"], self.uvggun, "tag_flash_left");
zoms=getentarray("script_model","classname");
trace=bullettrace(self geteye()+(0,0,18),self geteye()+(20000*vec[0],20000*vec[1],20000*vec[2]+18),true,self);
for(i=0;i<zoms.size;i++)
if(isdefined(zoms.id))
{
{
{
if(distance(trace["position"],zoms.origin)<80)
{
earthquake(0.5,1, trace["position"], 80);
zoms FinishPlayerDamage (zoms, self, 50, 0, "MOD_RIFLE_BULLET", "d2_mp",zoms.origin, (0,0,0), "none",0);
{
if(!zoms.boss)
zoms.trig notify("damage",int(level.zommaxhealth/800)+5000,self,true);
else
zoms.trig notify("damage",int(level.zommaxhealth/1600)+5000,self,true);
}
}
}
}
}

Post Reply