Raised This Month: $ Target: $400
 0% 

Find all entitys around player ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 06-19-2014 , 09:18   Re: Find all entitys around player ?
Reply With Quote #1

find_ent_in_sphere
SpeeDeeR is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 06-19-2014 , 17:36   Re: Find all entitys around player ?
Reply With Quote #2

For finding all entities inside the sphere you usually use the native like this:

PHP Code:
new ent = -1;
while ((
ent find_ent_in_sphere(entoriginradius)) {
   
// new entity found

This way you start with entity -1 which will return the first entity inside the sphere, and then work your way up until you found the last one.
__________________
In Flames we trust!
Nextra is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 06-19-2014 , 20:03   Re: Find all entitys around player ?
Reply With Quote #3

Quote:
Originally Posted by SpeeDeeR View Post
Quote:
Originally Posted by Nextra View Post
For finding all entities inside the sphere you usually use the native like this:

PHP Code:
new ent = -1;
while ((
ent find_ent_in_sphere(entoriginradius)) {
   
// new entity found

This way you start with entity -1 which will return the first entity inside the sphere, and then work your way up until you found the last one.
Better to use find_sphere_class() . That way the module performs the entity search and will be more efficient.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 06-19-2014 , 21:23   Re: Find all entitys around player ?
Reply With Quote #4

Quote:
Originally Posted by hornet View Post
Better to use find_sphere_class() . That way the module performs the entity search and will be more efficient.
Well they are not the same thing. If you're not searching for a specific class but rather all entities around the player you can't use find_sphere_class. Otherwise you are correct though.
__________________
In Flames we trust!
Nextra 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:13.


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