It doesn't skip bots.
PHP Code:
static cell AMX_NATIVE_CALL find_sphere_class(AMX *amx, cell *params) // find_sphere_class(aroundent, _lookforclassname[], Float:radius, entlist[], maxents, Float:origin[3] = {0.0, 0.0, 0.0}); // 6 params
{
// params[1] = index to find around, if this is less than 1 then use around origin in last parameter.
// params[2] = classname to find
int len;
char* classToFind = MF_GetAmxString(amx, params[2], 0, &len);
// params[3] = radius, float...
REAL radius =amx_ctof(params[3]);
// params[4] = store ents in this list
cell *entList = MF_GetAmxAddr(amx, params[4]);
// params[5] = maximum ents to store in entlist[] in params[4]
// params[6] = origin, use this if params[1] is less than 1
vec3_t vecOrigin;
if (params[1] > 0) {
CHECK_ENTITY(params[1]);
edict_t* pEntity = TypeConversion.id_to_edict(params[1]);
vecOrigin = pEntity->v.origin;
} else {
cell *cAddr = MF_GetAmxAddr(amx, params[6]);
vecOrigin = Vector(amx_ctof(cAddr[0]), amx_ctof(cAddr[1]), amx_ctof(cAddr[2]));
}
int entsFound = 0;
edict_t* pSearchEnt = TypeConversion.id_to_edict(0);
while (entsFound < params[5]) {
pSearchEnt = FIND_ENTITY_IN_SPHERE(pSearchEnt, vecOrigin, radius); // takes const float origin
if (FNullEnt(pSearchEnt))
break;
else {
if (strcmp(STRING(pSearchEnt->v.classname), classToFind) == 0) {
// Add to entlist (params[4])
entList[entsFound++] = TypeConversion.edict_to_id(pSearchEnt); // raise entsFound
}
}
}
return entsFound;
}
__________________