currently there is only a func to find by classname, target and targeetname
why not a dynamic one ?
if im right this function should make it ( i cannot code C/++ but i think its correct)
Code:
static cell AMX_NATIVE_CALL find_ent_by_keyvalue(AMX *amx, cell *params)
{
edict_t *pEnt = INDEXENT2(params[1]);
int len, len2;
char* sKeyName = MF_GetAmxString(amx, params[2], 0, &len);
char* sValue = MF_GetAmxString(amx, params[3], 0, &len2);
pEnt = FIND_ENTITY_BY_STRING(pEnt, sKeyName, sValue);
if (FNullEnt(pEnt))
return 0;
return ENTINDEX(pEnt);
}
and would be called like this:
Code:
find_ent_by_keyvalue( ent , keyname , keyvalue )
or maybe even make one to find ents with given keyname without specifying keyvalue
__________________