Use this to draw little lines to indicate a which direction the player is pointing. Makes it easy to see if a person is aiming at you Code:
Vector CalcPViewAngles(int index){
cl_entity_s *ent = gEngfuncs.GetEntityByIndex(index);
Vector forward,right,up,newfwd;
VectorCopy(ent->origin, newfwd);
gEngfuncs.pfnAngleVectors(ent->angles, forward, right, up);
// Thanks tetsuo :P im a tard
newfwd = newfwd + forward * cvar.radar_fovdist; // radar_fovdist is an int, I use 300. change to suit your own taste
return newfwd;
}
This simply calculates a point in space that is X units in front of the player, I used 300 which seemed to work well on the radar of my size. Code:
void drawRadarFOV(float* origin, int playerindex, int width, int r,int g,int b, int size)
{
int startX, startY, endX, endY;
calcRadarPoint(origin, startX, startY);
calcRadarPoint(CalcPViewAngles(playerindex), endX, endY);
DrawLine(startX, startY, endX, endY, width, r, g, b, 255);
}
Credits: Tetsuo, OGC