Code:
// Set damage
static id, damage
id = entity_get_edict(ent, EV_ENT_owner)
// damage lower than 1 has no point, so we round it down
damage = floatround(get_pcvar_float(cvar_explosedamage) - (get_pcvar_float(cvar_explosedamage) / NADE_EXPLOSION_RADIUS) * entity_range(ent, victim), floatround_floor)
// the target is out of the explosion range
if (!damage)
return;
// max CS name lenght is 31, not 32
static name[31]
get_user_name(victim, name, 30)
fm_set_user_health(victim, pev(victim, pev_health) - damage)
zp_colored_print(id, "%s Damage to^x03 %s^x01 ::^x04 %d damage", CHAT_PREFIX, name, damage)
__________________