Raised This Month: $ Target: $400
 0% 

[Solved] About entity distance.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 11-06-2013 , 13:35   Re: [Help] About entity distance.
Reply With Quote #4

Code:
new mine = -1, Float:vecSrc[3], class[32];
vecSrc represents origin where next mine should be planted

const SEARCH_RADIUS = 15.0

while((mine=engfunc(EngFunc_FindEntityInSphere, mine, vecSrc, SEARCH_RADIUS))>0)
{
     entity_get_string(mine, EV_SZ_classname, class, charsmax(class));

     if( equal( class, "YOUR_MINE_CLASSNAME" ) )
     {
          /* mine has been already planted nearby */
          break;
      }
}
__________________


Last edited by NiHiLaNTh; 11-06-2013 at 13:37.
NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
 



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 23:18.


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