Ok, it's solved. If anyone is interested in the solution I found, here it is (
zombie_plague40.sma):
At the beginning
PHP Code:
new cvar_new_infection // For easily enabling/disabling infection block
new cNewInfection // For precaching the cvar value instead of calling get_pcvar_num in takeDamage
At plugin_init
PHP Code:
cvar_new_infection = register_cvar("zp_new_infection", "1")
at event_round_start
PHP Code:
cNewInfection = get_pcvar_num(cvar_new_infection) // Precaching...
at takeDamage, just after
PHP Code:
if (g_survround || g_nemround || g_swarmround || g_plagueround) // I removed last human check here (see later)
return HAM_IGNORED; // human is killed
we write...
PHP Code:
if(cNewInfection || fnGetHumans() == 1) // That should also work with last human
{
// Get victim armor
static Float:armor
pev(victim, pev_armorvalue, armor)
// If he has some armor, we reduce it just before reducing health (otherwise, armor would be useless in the gameplay)
if (armor > 0.0)
{
emit_sound(victim, CHAN_BODY, sound_armorhit, 1.0, ATTN_NORM, 0, PITCH_NORM)
if (armor - damage > 0.0)
set_pev(victim, pev_armorvalue, armor - damage)
else
cs_set_user_armor(victim, 0, CS_ARMOR_NONE)
return HAM_SUPERCEDE;
}
else // If there's no armor
return HAM_IGNORED; // We avoid calling zombieme function
}
And then we set zp_deathmatch to the desired value to infect death people (or making a better respawn plugin). I also recomend to make 6-7 zombies at the beginning instead of one. The results are wonderful.
I did those plugins, so if anyone wanted them, I would share them here.
__________________