Try this:
Code:
public get_oriented_origin(id,Float:fDistance)
{
new Float:nOrigin[3]
new Float:vAngles[3] // plug in the view angles of the entity
new Float:vReturn[3] // to get out an origin fDistance away
entity_get_vector(id,EV_VEC_origin,nOrigin)
entity_get_vector(id,EV_VEC_v_angles,vAngles)
vReturn[0] = floatcos( vAngles[1], degrees ) * fDistance
vReturn[1] = floatsin( vAngles[1], degrees ) * fDistance
vReturn[2] = floatsin( -vAngles[0], degrees ) * fDistance
vReturn[0] =+ nOrigin[0]
vReturn[1] =+ nOrigin[1]
vReturn[2] =+ nOrigin[2]
return 1;
}
It may or may not work. First, it gets the angles and gets the vector direction they are looking in, multiplies it to get a specific distance, and then adds it to their origin.
Give it a shot.
__________________