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
Author Message
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 03-22-2017 , 14:40   How to avoid damage for players from my team?
Reply With Quote #1

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

    
while(( target engfunc(EngFunc_FindEntityInSpheretargetoriginradius) )) 
    {  
        if (
maxplayers target)
            break

        if (!
is_user_alive(target))
            continue

        if (
target == owner)
            continue

        if (!
is_user_zombie(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)
    }

As you can see there is check for zombie. But I delete that check because I will use this for public mod. But then I have problem:
The damage is done for enemy team but also for the players from my team.
How can I block this to doo damage to players from my team?
Krtola is offline
Send a message via Skype™ to Krtola
 


Thread Tools
Display Modes

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