Hello, so i cant figure it out how do i make that if armor is above 500 the infection bomb wont do anything to a player. Also the glow doesnt seem to appear for me... What im doing wrong? Can someone help? Thanks in advance.
Infection grenade -
PHP Code:
while ((victim = engfunc(EngFunc_FindEntityInSphere, victim, originF, NADE_EXPLOSION_RADIUS)) != 0)
{
// Only effect alive non-spawnprotected humans
if (!is_user_valid_alive(victim) || g_zombie[victim] || g_nodamage[victim])
continue;
static Float:armor
pev(victim, pev_armorvalue, armor)
// If he has above 500 reduce it - it also infects a player with it, idk why
if (get_user_armor(victim) <= 500)
{
set_pev(victim, pev_armorvalue, float(min(pev(victim, pev_armorvalue)-500, 0)))
fm_set_rendering(victim, kRenderFxGlowShell, 0, 255, 0, kRenderNormal, 25);
set_task(5.0, "remove_armor_glow", victim, _, _, "b")
}
/* Last human is killed
if (fnGetHumans() == 1)
{
ExecuteHamB(Ham_Killed, victim, attacker, 0)
continue;
}*/
// Infected victim's sound
ArrayGetString(grenade_infect_player, random_num(0, ArraySize(grenade_infect_player) - 1), sound, charsmax(sound))
emit_sound(victim, CHAN_VOICE, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
// Turn into zombie
zombieme(victim, attacker, 0, 0, 1, 1)
}
Here is the glow what should appear but it doesnt.
PHP Code:
public remove_armor_glow(id)
{
fm_set_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25);
}