Raised This Month: $ Target: $400
 0% 

find_ent_in_sphere , finding opposite team players index?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 03-03-2017 , 15:43   Re: find_ent_in_sphere , finding opposite team players index?
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
PHP Code:
new Float:fOrigin[3], szClassname[32], iTeam get_user_team(id), iEnt
entity_get_vector
(idEV_VEC_originfOrigin)

while((
iEnt find_ent_in_sphere(iEntfOrigin300.0)) != 0)
{
    if(
id == iEnt)
        continue
        
    
entity_get_string(iEntEV_SZ_classnameszClassnamecharsmax(szClassname))
    
    if(
equal(szClassname"player"))
    {
        if(
iTeam != get_user_team(iEnt))
        {
            
// iEnt is an enemy...
        
}
    }

i guess a small optimization could be done by removing the classname check and use 1<=iEnt<=maxplayers instead
jimaway 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 20:59.


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