Raised This Month: $51 Target: $400
 12% 

TR_TraceRayFilter Help (SOLVED)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Skippy
Senior Member
Join Date: Nov 2011
Old 12-26-2014 , 16:58   TR_TraceRayFilter Help (SOLVED)
Reply With Quote #1

I have the following code. I'm trying to get the person's name I am aiming at. The problem is I need it to be able to go through every wall or trigger until it hits a person.

Code:
public bool:TraceRayDontHitSelf(entity, mask, any:data)
{
    if(entity == data)
        return false;

    return true;
}  

public GetPlayerTarget(client)
{
    new ret = -1;
    
    new Float:pos[3], Float:ang[3];
    
    GetClientEyePosition(client, pos);
    GetClientEyeAngles(client, ang);
    
    TR_TraceRayFilter(pos, ang, MASK_SHOT, RayType_Infinite, TraceRayDontHitSelf, client);
    
    if(TR_DidHit() == true)
    {
        new ent = TR_GetEntityIndex();
        
        if(ent > 0 && ent < MAXPLAYERS)
            ret = ent;
    }
    
    return ret;
}
__________________
Plugins:
[Any] Aim Menu

Want a TF2 plugin? Feel free to pm me to discuss it.

Last edited by Skippy; 12-27-2014 at 05:08. Reason: Solved the issue
Skippy 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 18:21.


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