Raised This Month: $ Target: $400
 0% 

find ent by origin.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-16-2007 , 16:57   Re: find ent by origin.
Reply With Quote #2

The first argument for the FindEntity functions is the entity index (minus one) to start searching from. So, if you use 134, it will begin looking at entities 135 and onward. This is how you would process all entities in a sphere:

Code:
ent = g_MaxPlayers; while((ent = engfunc(EngFunc_FindEntityInSphere, ent, fOrigin, fRadius)) != 0) {      // whatever }

It keeps checking from ent and onwards. Since ent keeps getting updated as the last entity that it found, it never catches the same entity twice. It keeps going until the next entity found is returned 0, meaning there are no more.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
 



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 22:25.


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