Raised This Month: $ Target: $400
 0% 

Solved Get 'Owner' of other third entity


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 06-28-2021 , 00:03   Re: Get 'Owner' of other third entity
Reply With Quote #3

I think as long as the entity deal damage via ExecuteHamB TakeDamge with correct attacker and victim input, it should work.

The attacker from those entity should be get from pev_owner

PHP Code:
public ShootEntity(id)
{
    new 
ent;
    
//Do usual create entity stuff ()
    //...
    
set_pev(entpev_ownerid)
    
//...
}

public 
ShootEntityTouch(entid_touched)
{
    
//Do the usual check stuff like valid, alive,...
    
static iOwneriOwner pev(entpev_owner)
    static 
iVictimiVitcim FM_NULLENT;
    static 
FloatfOrigin[3]; pev(entpev_originfOrigin);

    
//In loop-for or loop-while to check AoE damage
    
while((iVictim engfunc(EngFunc_FindEntityInSphereiVictimfOriginEXP_RADIUS)) > 0)
    {
        if(
is_user_alive(iVictim) && zp_get_user_zombie(iVictim))
        {
            
ExecuteHamB(Ham_TakeDamageiVictimentiOwnerDAMAGEDMG_GENERIC); //ent or iOwner is fine.
        
}
    }
    
//finish up

Some plugin used ent as attacker so that would lead to not passing though "player takedamage" forward
ExecuteHam also won't pass though takedamage forward, must be ExecuteHamB
__________________
My plugin:

Last edited by Celena Luna; 06-28-2021 at 00:12. Reason: more specific
Celena Luna 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 02:39.


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