AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP-ME] At the back function (https://forums.alliedmods.net/showthread.php?t=252977)

lovenina12 12-12-2014 18:25

[HELP-ME] At the back function
 
Hi guys,

I need a help with this function:

PHP Code:

stock bool:at_back(iAttackeriVictim)
{
    new 
bool:backstab=false
    
new Floatvec2LOS[2];
    new 
FloatvecForward[3];
    new 
FloatvecForward2D[2];
    
    
velocity_by_aimiAttacker1vecForward );
    
    
xs_vec_make2dvecForwardvec2LOS );
    
xs_vec_normalizevec2LOSvec2LOS );
    
    
peviVictimpev_anglesvecForward );
    
engfuncEngFunc_MakeVectorsvecForward );
    
global_getglb_v_forwardvecForward );
        
    
xs_vec_make2dvecForwardvecForward2D );
    if( 
xs_vec_dotvec2LOSvecForward2D ) > 0.1 )
    {
        
backstab true
    
}
    return 
backstab


I want to use this function without a target (iVictim), and transform the target to a player that is 100.0 distance and in the vision range of the iAttacker!

Sry bad english.

If you don't understood reply!


All times are GMT -4. The time now is 15:27.

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