Hi guys,
I need a help with this function:
PHP Code:
stock bool:at_back(iAttacker, iVictim)
{
new bool:backstab=false
new Float: vec2LOS[2];
new Float: vecForward[3];
new Float: vecForward2D[2];
velocity_by_aim( iAttacker, 1, vecForward );
xs_vec_make2d( vecForward, vec2LOS );
xs_vec_normalize( vec2LOS, vec2LOS );
pev( iVictim, pev_angles, vecForward );
engfunc( EngFunc_MakeVectors, vecForward );
global_get( glb_v_forward, vecForward );
xs_vec_make2d( vecForward, vecForward2D );
if( xs_vec_dot( vec2LOS, vecForward2D ) > 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!