Hi !

I dont want to use scan_entity or c_scan on this calculations because i already use it and because of performance reasons.

In the next code i get the closest opponent detected and saved in the array to the each player using vec_dist.

But i need to enumerate / identify and count them say in a range of 1000 quants, without using slow instructions like scan_entity or c_scan, in a way that each player "knows" which and the number of opponents that are 1000 quants distance from him.

Is that possible? How can i do it?
Thanks in advance.

Code:
 

function ds_GET_OPPONENTS()
{
var minDist;
var i;
while (i < ds_numberOfEntities)
{
if (ds_scan_array_list[i])
{
my = ptr_for_handle(ds_scan_array_list[1]);
if (my)
{
if (my._ds_CLOSEST_OPPONENT_DIST < minDist)
{
ds_MOST_FREE_ENTITY = my;
minDist = my._ds_CLOSEST_OPPONENT_DIST;
}
}
}
i+=1;
}
return(minDist);
}