It doesn't slow it that much but it would be faster to store attached entities on creation.... unless your plugin doesn't make them, in that case, this searches for entities near players:
Code:
new g_iMaxPlayers
// plugin_init()
g_iMaxPlayers = get_maxplayers()
// your function
new const Float:fRadius = 8.0 // I really dunno how much to set here =) if it doesn't detect squat, increase
new Float:fOrigin[3]
new ent
for(new id = 1; id <= g_iMaxPlayers; id++)
{
if(is_user_alive(id))
{
entity_get_vector(id, EV_VEC_origin, fOrigin)
ent = g_iMaxPlayers // skip players from the search
while((ent = find_ent_in_sphere(ent, fOrigin, fRadius))
{
if(entity_get_int(ent, EV_ENT_aiment) == id && entity_get_int(ent, EV_INT_movetype) == MOVETYPE_FOLLOW)
{
// ent is attached to id
}
}
}
}
__________________