Raised This Month: $ Target: $400
 0% 

need small fix


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
avril-lavigne
Banned
Join Date: Apr 2009
Old 02-08-2013 , 13:40   Re: need small fix
Reply With Quote #7

dont understand this should work> but


PHP Code:
public fw_HamTakeDamageiVictim iInflictor iAttacker Float:fDamage iBitDamage 
{   
   
    
    if ( 
IsPlayeriAttacker ) && fDamage 80 )    
    
teleport_behindiAttackeriVictim )
    

}


public 
teleport_behind(idtarget){
 
   new 
Float:vec[3], Float:origin[3], Float:fractionFloat:ftmp[3], Float:ftmp2[3], Float:ftmp3[3], Float:ftmp4[3], Float:len2trij
    
    velocity_by_aim
(target1vec)
    new 
Float:len floatsqroot(vec[0]*vec[0]+vec[1]*vec[1])
    
    
pev(targetpev_originorigin)
    
ftmp3[0] = origin[0]-vec[0]*50.0/len
    ftmp3
[1] = origin[1]-vec[1]*50.0/len
    ftmp3
[2] = origin[2]+5.0

    ftmp4
[0] = origin[0]-vec[0]*10.0/len
    ftmp4
[1] = origin[1]-vec[1]*10.0/len
    ftmp4
[2] = origin[2]+91.0
    
    
for(j=0j<20j++){
        if(
j<15){
            
_Vec3Set(ftmpftmp3)
        }else{
            
_Vec3Set(ftmpftmp4)
        }
        for(
i=0i<100i++){      
            
engfunc(EngFunc_TraceHullftmpftmp0HULL_HUMAN0tr)
            if(
get_tr2(trTR_StartSolid) || get_tr2(trTR_AllSolid)){
                
_Vec3AddScalar(ftmprandom_float(-10.010.0))
                continue
            }   
            
engfunc(EngFunc_TraceLineoriginftmpIGNORE_MONSTERS0tr)
            
get_tr2(trTR_flFractionfraction)
            break
        }
        if(
fraction == 1.0){
            
_Vec3Set(ftmp2ftmp)    
            
_Vec3Add(ftmp2, -origin)            
            
len2 len*floatsqroot(ftmp2[0]*ftmp2[0]+ftmp2[1]*ftmp2[1]+ftmp2[2]*ftmp2[2])
            if(
len2 100.0 || (ftmp2[0]*vec[0]+ftmp2[1]*vec[1])/len2 0.1){
                
fraction 0.0
                
continue
            }
            break
        }
    }

    if(
fraction !=1.0){
        
//failed to find correct position behind target
        
return
    }
    
    
set_pev(idpev_originftmp)
    
    
_Vec3Set(ftmp, -ftmp)        
    
_Vec3Add(ftmporigin)
    
_Vec3ToAngles(ftmpftmp)    
    
    
set_pev(idpev_anglesftmp)
    
set_pev(idpev_fixangle1)

I did as in your example just without console command
id = iAttacker , traget = iVictim
but its not working.
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc

Last edited by avril-lavigne; 02-08-2013 at 14:27.
avril-lavigne 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 20:34.


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