In case you or someone else could not use is_in_viewcone, there is another way - you need to loop through all alive players and use something like this
PHP Code:
#define MAX_ANGLE 3.1415 * 0.25 //these are radians, so PI (3.1415.....) equals 180 degrees
new Float:aim_vec[3] //aim vector of an entity
new Float:tar_vec[3] //vector pointing from entity to player (you get it when you subtract origins)
//you can skip aim_distance if you use native that returns normalized vector (in that case aim_distance will be 1.0)
new Float:aim_distance = floatsqroot(aim_vec[0]*aim_vec[0] + aim_vec[1]*aim_vec[1] + aim_vec[2]*aim_vec[2])
new Float:tar_distance = floatsqroot(tar_vec[0]*tar_vec[0] + tar_vec[1]*tar_vec[1] + tar_vec[2]*tar_vec[2])
new Float:cos_val = (aim_vec[0]*tar_vec[0] + aim_vec[1]*tar_vec[1] + aim_vec[2]*tar_vec[2]) / (aim_distance*tar_distance)
//now cos_val stores cosine of an angle between aim_vec and tar_vec
new Float:angle = floatacos(cos_val)
if(angle > MAX_ANGLE)
continue
//found matching player
__________________