Raised This Month: $ Target: $400
 0% 

help my with fm_find_ent? [class and in radius]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nightfall1
Senior Member
Join Date: Aug 2008
Old 04-29-2011 , 07:26   help my with fm_find_ent? [class and in radius]
Reply With Quote #1

PHP Code:
#define fm_find_ent_by_class(%1,%2) engfunc(EngFunc_FindEntityByString, %1, "classname", %2)
#define fm_find_ent_in_sphere(%1,%2,%3) engfunc(EngFunc_FindEntityInSphere, %1, %2, %3)
 
 
public thisIsPublic(id)
{
    
// Get origin
    
static Float:originF[3]
    
pev(idpev_originoriginF)
 
    new 
ent
    ent 
= -1
    
if((ent fm_find_ent_by_class(ent"func_breakable") | fm_find_ent_in_sphere(entoriginF150.0)) != 0)
    {
        
client_print(0print_center"HIT:%d"ent//- dev only
    
}

client_print worck but is not work for corect entity
the point is i need to find a class and find is in range
I also tried
PHP Code:
stock Float:fm_entity_range(ent1ent2) { 
 new 
Float:origin1[3], Float:origin2[3
 
pev(ent1pev_originorigin1
 
pev(ent2pev_originorigin2
 
 return 
get_distance_f(origin1origin2

__________________
SIGNATURE

Last edited by Nightfall1; 04-29-2011 at 07:29.
Nightfall1 is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 04-29-2011 , 07:56   Re: help my with fm_find_ent? [class and in radius]
Reply With Quote #2

PHP Code:
public thisIsPublic(id)
{
    static 
entFloat:originF[3], classname[32]

    
pev(idpev_originoriginF)
    
ent=fm_find_ent_in_sphere(entoriginF150.0)
    
    while (
pev_valid(ent))
    {
        
pev(entpev_classnameclassnamecharsmax(classname))
        
client_print(0print_chat"[DEBUG] find entity %d: %s"entclassname//- dev only
        
        
if (equal(classname"func_breakable"))
        {
            
client_print(0print_chat"found breakable!")
            
// do your code here
        
}
        
        
ent=fm_find_ent_in_sphere(entoriginF150.0)
    }

__________________

SonicSonedit is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-29-2011 , 07:59   Re: help my with fm_find_ent? [class and in radius]
Reply With Quote #3

http://www.amxmodx.org/funcwiki.php?go=func&id=390
__________________
Arkshine is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 04-29-2011 , 08:05   Re: help my with fm_find_ent? [class and in radius]
Reply With Quote #4

Arkshine
__________________

SonicSonedit is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-29-2011 , 08:06   Re: help my with fm_find_ent? [class and in radius]
Reply With Quote #5

And ?
__________________
Arkshine is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 04-29-2011 , 08:11   Re: help my with fm_find_ent? [class and in radius]
Reply With Quote #6

And he uses fm.
__________________

SonicSonedit is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-29-2011 , 08:23   Re: help my with fm_find_ent? [class and in radius]
Reply With Quote #7

Just because he tries something with fakemeta doesn't mean you can't advice him to use the appropriate native. Module has nothing to do here. find_sphere_class should be used.
__________________
Arkshine is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 04-29-2011 , 08:26   Re: help my with fm_find_ent? [class and in radius]
Reply With Quote #8

Arkshine
Don't you agree that it's better to use 1 module than 2 modules that do almost the same thing?
__________________

SonicSonedit is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-29-2011 , 08:48   Re: help my with fm_find_ent? [class and in radius]
Reply With Quote #9

Module has nothing to here. Just use intelligently the provided natives considering your needs whatever the modules. The less natives you call, the faster your plugin will be. There is a tutorial about that by the way.
__________________
Arkshine is offline
Nightfall1
Senior Member
Join Date: Aug 2008
Old 04-29-2011 , 08:53   Re: help my with fm_find_ent? [class and in radius]
Reply With Quote #10

Quote:
Originally Posted by SonicSonedit View Post
Arkshine
Don't you agree that it's better to use 1 module than 2 modules that do almost the same thing?
totally agree with you
I don't care how faster is engine, or my plugin (maybe if the delay more 5000 ms)
Thanks for support my
__________________
SIGNATURE
Nightfall1 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 04:27.


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