Quote:
Originally Posted by P34nut
lol that code doesnt work... shall i post it here or are u going to fix it yourself?
|
Actually it does.
Works perfect, like a charm. No errors in compiling and no run time errors from server.
Though I did have to edit it just a bit but yeah.....works fine.
Maybe VEN can add it to his fakemeta_util, with your permission of course.
Code:
stock fm_radius_damage(Float:fExplodeAt[3], iDamageMultiplier, iRadiusMultiplier)
{
new ent = 0
while ((ent = fm_find_ent_in_sphere(ent, fExplodeAt, float(5 * iRadiusMultiplier))) > 0)
{
if (is_user_alive(ent) && !fm_get_user_godmode(ent))
{
new Float:plHealth
pev(ent, pev_health, plHealth)
plHealth - 10.0 + iDamageMultiplier
if (plHealth < 1)
{
user_kill(ent)
}
else
{
set_pev(ent, pev_health, plHealth)
}
}
}
ent = 0
while ((ent = fm_find_ent_in_sphere(ent, fExplodeAt, float(4 * iRadiusMultiplier))) > 0)
{
if (is_user_alive(ent) && !fm_get_user_godmode(ent))
{
new Float:plHealth
pev(ent, pev_health, plHealth)
plHealth - 25.0 + random_num(0, 2 * iDamageMultiplier)
if (plHealth < 1)
{
user_kill(ent)
}
else
{
set_pev(ent, pev_health, plHealth)
}
}
}
ent = 0
while ((ent = fm_find_ent_in_sphere(ent, fExplodeAt, float(3 * iRadiusMultiplier))) > 0)
{
if (is_user_alive(ent) && !fm_get_user_godmode(ent))
{
new Float:plHealth
pev(ent, pev_health, plHealth)
plHealth - 50.0 + random_num(0, 3 * iDamageMultiplier)
if (plHealth < 1)
{
user_kill(ent)
}
else
{
set_pev(ent, pev_health, plHealth)
}
}
}
ent = 0
while ((ent = fm_find_ent_in_sphere(ent, fExplodeAt, float(2 * iRadiusMultiplier))) > 0)
{
if (is_user_alive(ent) && !fm_get_user_godmode(ent))
{
user_kill(ent)
}
}
}