Raised This Month: $ Target: $400
 0% 

How to avoid damage for players from my team?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Depresie
Veteran Member
Join Date: Nov 2013
Old 03-22-2017 , 15:26   Re: How to avoid damage for players from my team?
Reply With Quote #2

PHP Code:
HamRadiusDamage(entFloat:radiusFloat:damagebits)  

    new 
target 0Float:origin[3], Float:o[3], maxplayers get_maxplayers(), los g_losFloat:fakeorig[3
    
pev(entpev_originorigin

    new 
owner pev(entpev_owner

    
xs_vec_copy(originfakeorig
    
fakeorig[2] += 2.0 

    
new iOwnerTeam get_user_team(owner)
    
    while(( 
target engfunc(EngFunc_FindEntityInSpheretargetoriginradius) ))  
    {   
        if (
maxplayers target
            break 

        if (!
is_user_alive(target)) 
            continue 

        if (
iOwnerTeam == get_user_team(target)) 
            continue 

        
pev(targetpev_origino)  

        if (
los && !is_in_los(fakeorigo)) 
            continue 

        
xs_vec_sub(originoo)  

        if (
xs_vec_len(o) > radius)  
            continue  

        
Ham_ExecDamageB(targetentpev(entpev_owner), damage * ((1.0 - (xs_vec_len(o) / radius))*2.0), HIT_GENERICbits)  

        
Create_TE_BEAMENTSenttargetg_lightningSpr01510201525500255
    } 

__________________

Last edited by Depresie; 03-22-2017 at 15:30.
Depresie 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 17:56.


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