Hi,

I wrote some new code which doesn't use c_scan or c_trace and it almost works perfectly and it seems fairly fps friendly. There is still 1 problem, I can't seem to get the c_scan-like horizontal and vertical sector check working. The code is below, thanks alot by the way for all your time so far. I call the function once when the missile explodes:

Code:
//*CUSTOM explosion hit event*//
//for player weapons explosions//

function enemy_hitexplosion()
{
VECTOR scan_sector, enemypos_vec;

 for (you = ent_next (NULL); you; you = ent_next (you))
 {
  if (you.group == 3) // == ENEMY
  { 
   if (you.STATE != 5) //NOT DEAD
   {
    if (vec_dist(my.x, you.x) < my.AREAOFEFFECT) //WITHIN DISTANCE
    {
    //simulates c_scan sector scan	
    vec_set(scan_sector, vector(my.AREAOFEFFECT, my.AREAOFEFFECT, my.AREAOFEFFECT));		
    if (my.WEAPONSELECTED == 5) scan_sector.z = 50;
    vec_set(enemypos_vec, you.x);
    vec_to_ent(enemypos_vec, my);
    
    //WITHIN SECTOR RANGE
    if (enemypos_vec.x < my.x + scan_sector.x && enemypos_vec.x > my.x - scan_sector.x &&
     enemypos_vec.y < my.y + scan_sector.y && enemypos_vec.y > my.y - scan_sector.y &&
     enemypos_vec.z < my.z + scan_sector.z && enemypos_vec.z > my.z - scan_sector.z) 
    {
     //damage + effect + sound	
     effect(BloodGreen_Effect_base,6 + integer(random(4)),you.x,nullvector);
     ...
     //stun + death (on server)
     ...
    }    
    }
   }
  } 		
 }	
}



ps: the vec_dist check could be ommitted but I purely put it there to save fps (less vec_to_ent and vec_set has to be triggerred than).