Raised This Month: $32 Target: $400
 8% 

Using find_ent_by_class?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 04-01-2007 , 04:16   Using find_ent_by_class?
Reply With Quote #1

I'm trying to figure out how to use find_ent_by_class to find all of the entities of a certain class.

I searched all over, I even saw a tutorial hawk did about find_ents...

He said something like...
Code:
while(ent = find_ent_by_class(ent, "classname") != 0) {     // something... }

That does not seem to work for me either...
Please can someone explain how to find every entity of that class and do stuff with it. Thanks
hlstriker is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 04-01-2007 , 04:32   Re: Using find_ent_by_class?
Reply With Quote #2

Quote:
new ent = -1
while((ent = find_ent_by_class(ent, "classname")))
{
// something...
}
VEN is offline
man_s_our
Senior Member
Join Date: Jul 2017
Location: aim_taliban
Old 03-20-2018 , 19:20   Re: Using find_ent_by_class?
Reply With Quote #3

I think that this function returns the smallest id that is greater than the index ent.
and when there is no entity that have such index the func return 0 and then te loop ends.
__________________

Last edited by man_s_our; 03-20-2018 at 19:22.
man_s_our is offline
man_s_our
Senior Member
Join Date: Jul 2017
Location: aim_taliban
Old 03-20-2018 , 19:28   Re: Using find_ent_by_class?
Reply With Quote #4

this loop can be interpreted as:

for_each ent in the_map do
something();
__________________
man_s_our 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 15:34.


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