Well i identify grenades like this, i don't even care about detonated or not right now.
Code:
edict_t *pent = NULL;
while ((pent = UTIL_FindEntityByClassname (pent, "grenade")) != NULL)
{
if (UTIL_GetGrenadeType (pent) == ... any type you want ...) // see below
{
// do what you want
}
}
and here the grenadetype thingy:
Code:
//////////////////////////////////
// UTIL_getGrenadeType function // - Stefan
//////////////////////////////////
int
UTIL_GetGrenadeType (edict_t * pEntity)
{
char model_name[32];
strcpy (model_name, STRING (pEntity->v.model));
if (strcmp (model_name, "models/w_hegrenade.mdl") == 0)
return 1; // He grenade
if (strcmp (model_name, "models/w_flashbang.mdl") == 0)
return 2; // FlashBang
if (strcmp (model_name, "models/w_smokegrenade.mdl") == 0)
return 3; // SmokeGrenade
if (strcmp (model_name, "models/w_c4.mdl") == 0)
return 4; // C4 Explosive
return 0;
}