Raised This Month: $51 Target: $400
 12% 

How to get next (proximate) enemy?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 10-23-2012 , 12:42   How to get next (proximate) enemy?
Reply With Quote #1

How to get next (proximate) enemy?
__________________
kiki33hun is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 10-23-2012 , 12:49   Re: How to get next (proximate) enemy?
Reply With Quote #2

Give more information, that you want to do.
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 10-23-2012 , 13:06   Re: How to get next (proximate) enemy?
Reply With Quote #3

Opponent who is close to me!
__________________
kiki33hun is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 10-23-2012 , 15:00   Re: How to get next (proximate) enemy?
Reply With Quote #4

PHP Code:
GetClosestEnemyiPlayer ) {
  new 
FloatfDistances32 ], iTargets32 ];
  new 
iTargetsCount 0iTarget = -1;
  new 
FloatfClosest 999999.0;

  for( new 
1<= get_maxplayers( ); i++ ) {
    if( 
!= iPlayer && is_user_alive) && pev_valid) == && get_pdata_inti114 ) != get_pdata_intiPlayer114 ) )
      
fDistancesiTargetsCount ] = entity_rangeiPlayer);
      
iTargetsiTargetsCount ] = i;

      
iTargetsCount++;
  }

  for( new 
0iTargetsCounti++ ) {
    if( 
fDistances] < fClosest ) {
      
fClosest fDistances];

      
iTarget iTargets];
    }
  }

  return 
iTarget;
}

public Function( 
iPlayer ) {
  new 
iEnemy GetClosestEnemyiPlayer );

  if( 
Enemy != -) {
    
// iEnemy is closest!
  
}

  else {
    
// No iEnemy!
  
}

__________________

Last edited by claudiuhks; 10-23-2012 at 15:02.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-23-2012 , 15:06   Re: How to get next (proximate) enemy?
Reply With Quote #5

You may want to add some tracelines.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 10-23-2012 , 15:08   Re: How to get next (proximate) enemy?
Reply With Quote #6

Quote:
Originally Posted by ConnorMcLeod View Post
You may want to add some tracelines.
I like my way!
__________________
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
avril-lavigne
Banned
Join Date: Apr 2009
Old 10-24-2012 , 04:54   Re: How to get next (proximate) enemy?
Reply With Quote #7

Ok I have similar code.

I cant reset gametime when enemy visible / invisible


TIME VISIBLE is 46.44 // First time Ive seen an enemy
TIME VISIBLE is 0.00 // reset after this
TIME RESET is 0.00
TIME VISIBLE is 46.45 // 2nd time =- IT starts NOT from 0 !!!
TIME VISIBLE is 0.00
TIME RESET is 0.00
TIME VISIBLE is 46.46
TIME VISIBLE is 0.00
TIME RESET is 0.00

it really kills me.
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc

Last edited by avril-lavigne; 10-24-2012 at 06:14.
avril-lavigne is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode