For finding all entities inside the sphere you usually use the native like this:
PHP Code:
new ent = -1;
while ((ent = find_ent_in_sphere(ent, origin, radius)) {
// new entity found
}
This way you start with entity -1 which will return the first entity inside the sphere, and then work your way up until you found the last one.
__________________