If you are interested, here's this native you've used inside engine.cpp:
Code:
static cell AMX_NATIVE_CALL entity_range(AMX *amx, cell *params)
{
int idxa = params[1];
int idxb = params[2];
CHECK_ENTITY(idxa);
CHECK_ENTITY(idxb);
edict_t *pEntA = TypeConversion.id_to_edict(idxa);
edict_t *pEntB = TypeConversion.id_to_edict(idxb);
REAL fRet = (pEntA->v.origin - pEntB->v.origin).Length();
return amx_ftoc(fRet);
}
Basically it does the same as the first option you used, but definitely faster.
__________________