Raised This Month: $ Target: $400
 0% 

find ent by origin.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 01-16-2007 , 16:52   find ent by origin.
Reply With Quote #1

This fuction is supposed to find an entity, but it finds the wrong one.
Maby there's a way to continue from 'ent' but i dunno how to stop the loop if nothing was found with classname 'my_classname' in specifyed sphere.
Funny thing is it worked before, and I can't remember me changing any of it.
Code:
stock FindEntAtOrigin(Float:fOrigin[3]) {         new classname[10], Float:fRadius, ent         while ( fRadius < 50.0 ) {                 fRadius += 5.0         ent = engfunc(EngFunc_FindEntityInSphere, g_MaxPlayers, fOrigin, fRadius)                 if ( ent ) {             pev(ent, pev_classname, classname, 9)             if ( equal(classname, "my_classname") )                 return ent;         }     }     return 0; }

Last edited by [ --<-@ ] Black Rose; 01-16-2007 at 16:56.
[ --<-@ ] Black Rose 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