Raised This Month: $ Target: $400
 0% 

Entity moving in front of player


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
NOVA GAMING
Member
Join Date: Apr 2020
Old 08-25-2021 , 08:21   Re: Entity moving in front of player
Reply With Quote #6

this is the Code i Used in my Old Plugin..

PHP Code:
if(pev_valid(ent)) 
    {
        
        new 
Float:vNewOrigin[3],Float:vNormal[3],Float:vTraceDirection[3], Float:vTraceEnd[3], Float:vOrigin[3]
        
        
pev(idpev_originvOrigin)
        
vOrigin[2]+=25
        
        velocity_by_aim
(id50vTraceDirection)
        
        
xs_vec_add(vTraceDirectionvOriginvTraceEnd)
        
        
engfunc(EngFunc_TraceLinevOriginvTraceEndDONT_IGNORE_MONSTERSid0)
        
        
get_tr2(0TR_vecEndPosvTraceEnd)
        
        new 
Float:TrAc[3]
        
TrAc[0]=vTraceEnd[0]
        
TrAc[1]=vTraceEnd[1]
        
TrAc[2]=-1000.0
        engfunc
(EngFunc_TraceLinevTraceEndTrAcDONT_IGNORE_MONSTERSid0)
        
        new 
Float:fFraction
        get_tr2
(0TR_flFractionfFraction)
        if(
fFraction 1.0)
        {
            
            
get_tr2(0TR_vecEndPosvTraceEnd);
            
get_tr2(0TR_vecPlaneNormalvNormal);
            
            
        }
        
        
xs_vec_add(vTraceEndvNormalvNewOrigin)
        
set_pev(entpev_originvNewOrigin );
        
    } 
here is the Video ( No advertising ..)

__________________
NOVA GAMING is offline
 


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 07:44.


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