Try this out
PHP Code:
stock radius_damage(const Float:origin[3], Float:max_damage, damage_type, Float:radius)
{
new id = -1
static Float:player_origin[3], Float:distance, Float:damage
while((id = engfunc(EngFunc_FindEntityInSphere, id, origin, radius)) != 0)
{
if(!is_user_alive(id))
continue
pev(id, pev_origin, player_origin)
distance = get_distance_f(origin, player_origin)
damage = max_damage - ((max_damage / radius) * distance)
new entity = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "trigger_hurt"))
if(entity)
{
new value[16]
float_to_str(damage * 2, value, 15)
dispatch_keyvalue(entity, "dmg", value)
num_to_str(damage_type, value, 15)
dispatch_keyvalue(entity, "damagetype", value)
dispatch_keyvalue(entity, "origin", "8192 8192 8192")
dllfunc(DLLFunc_Spawn, entity)
dllfunc(DLLFunc_Touch, entity, id)
engfunc(EngFunc_RemoveEntity, entity)
}
}
}
stock dispatch_keyvalue(entity, const key[], const value[])
{
static classname[32]
pev(entity, pev_classname, classname, 31)
set_kvd(0, KV_ClassName, classname)
set_kvd(0, KV_KeyName, key)
set_kvd(0, KV_Value, value)
set_kvd(0, KV_fHandled, 0)
return dllfunc(DLLFunc_KeyValue, entity, 0)
}
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.