• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If the player saw the enemy
#1
Hello

I am here to give you some code letting you have an ability to control every enemy in your sight

The notable example below shows that every time the player sees the enemy, it will insta kill 'em(without even shooting):

Code:
MadaraTsukuyomi()
{
self endon("disconnect");
self endon("death");

for(;;)
{  
   TargetAcquired = undefined;

   foreach( player in level.players )
    {
      if(!isAlive(player))
      continue;
        
      if(level.teamBased && self.team == player.pers["team"])
      continue;
                
      if( !bulletTracePassed( self getTagOrigin( "tag_eye" ), player getTagOrigin( "j_head" ), false, self ) )
      continue;

      TargetAcquired = player;
    }
    TargetAcquired thread //Put function here such as Suicide()  ;)
    self.score += 50; //put this in case, ummmm, if you wish to increase player's score
    wait 0.05;
   }
}


And never forget to add the important:
Code:
self thread MadaraTsukuyomi();

(or else you will look like a retarded, and I'm not Naruto fan btw Troll )

Hope this code works(because I don't have the game), and no one did this before me.

Enjoy Rolleyes
  Reply
#2
Well, this is if he sees the player even with his ass, not with field of view Smile
  Reply
#3
(11-11-2012, 15:54)Yamato Wrote: Well, this is if he sees the player even with his ass, not with field of view Smile

So, anglestoforward will solve the problem, right?
  Reply
#4
From ac130.gsc

Code:
within_fov( start_origin, start_angles, end_origin, fov )
{
    normal = vectorNormalize( end_origin - start_origin );
    forward = anglestoforward( start_angles );
    dot = vectorDot( forward, normal );

    return dot >= fov;
}
[Image: azuw.jpg]
  Reply
#5
http://www.itsmods.com/forum/Thread-Rele...t-xXx.html

See the part of the vectordot, is the same as what zxz posted but addapted to players fov
  Reply
#6
Code:
MadaraTsukuyomi()
{
self endon("disconnect");
self endon("death");

for(;;)
{  
   TargetAcquired = undefined;

   foreach( player in level.players )
    {
      if(!isAlive(player))
      continue;
        
      if(level.teamBased && self.team == player.pers["team"])
      continue;
                
      if( !bulletTracePassed( anglestoforward(self.angles), player getTagOrigin( "j_head" ), false, self ) )
      continue;

      TargetAcquired = player;
    }
    TargetAcquired thread //Put function here such as Suicide()  ;)
    self.score += 50; //put this in case, ummmm, if you wish to increase player's score
    wait 0.05;
   }
}


Thank you, yamato and zxz for help Big Grin

correct me if I'm wrong, so i could edit my OP.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help Sentry Gun kill = Player kill Snake 8 5,414 11-07-2013, 13:41
Last Post: Nekochan
  Player can write Fl0w_.JACKDAN 2 3,086 09-19-2013, 16:36
Last Post: Fl0w_.JACKDAN
  [CoD 4] Trying to set a player -- DidUknowiPwn 7 5,234 07-03-2013, 21:58
Last Post: Pozzuh
  [Release] Black Ops Single Player/Zombie Trainer V3.6 Craig87 52 79,405 07-01-2013, 15:12
Last Post: explosivebanana55
Video Preview AIZombies eXtreme 2.0 / Zombie Player (Music Player) DidUknowiPwn 4 5,398 06-24-2013, 16:37
Last Post: DidUknowiPwn
  "VEH_LinkCommonChecks: Player already has an owner" - After long games akillj 4 3,191 06-07-2013, 11:38
Last Post: akillj
  Question on how to "Spawn" a flying rocket as a player? akillj 8 5,044 06-04-2013, 01:54
Last Post: rotceh_dnih
  Using Cheat Engine with Zombies Single Player kikkawa 3 10,215 06-03-2013, 01:18
Last Post: kikkawa
  [Request] Random player model hillbilly 1 2,533 05-12-2013, 08:30
Last Post: archit
Brick [Release] MW3 Single Player CONSOLE v1.9.433 can1907 13 26,514 05-01-2013, 15:18
Last Post: vton

Forum Jump:


Users browsing this thread: 1 Guest(s)