Quote:
Originally Posted by EFFx
I looked more wdo I thought were definitive codes for X distance, and I want to sample the distance from the closer, and I did not find it.
|
I'm not sure what you're trying to say but here's one way to get the distance. Of course it's not the complete code because I'm not sure what you want.
PHP Code:
public whatever()
{
new Float:kOrigin[ 3 ], Float:vOrigin[ 3 ];
pev( your_index, pev_origin, kOrigin )
pev( enemy_index, pev_origin, vOrigin )
new Float:iDist = get_distance_f( kOrigin, vOrigin )
new Float:iMeters = iDist * 0.0254 // This will convert it to meters.
//Add your hud here
}
__________________