I'm making a plugin for a "more realistic infection" for zp4.3, so I need to avoid instant infection. I want zombies to kill humans, and then the humans will respawn as zombies. (
I know it would be much easier with 5.0, in fact it's already done, but I prefer this older version)
I tried this
PHP Code:
public zp_user_infect_attempt(id, infector, nemesis)
{
// g_is_infection : True when it's infection mode or multi infection mode
// g_justDeath[id]: True when id has just been killed by a zombie. That allows to infect a human after his spawn
if(g_is_infection && !g_justDeath[id])
return ZP_PLUGIN_HANDLED;
return PLUGIN_CONTINUE;
}
and that correctly blocks infection, but no damage it's taken. So, I decided to call TakeDamage manually:
PHP Code:
public zp_user_infect_attempt(id, infector, nemesis)
{
if(g_is_infection && first_zombies && !g_justDeath[id]) {
new button = pev(infector, pev_button)
if(button == IN_ATTACK){
ExecuteHamB(Ham_TakeDamage, id, infector, infector, random_float(10.0,50.0), DMG_SLASH)
return ZP_PLUGIN_HANDLED;
}
else if(button == IN_ATTACK2){
ExecuteHamB(Ham_TakeDamage, id, infector, infector, random_float(50.0, 120.0), DMG_SLASH)
return ZP_PLUGIN_HANDLED;
}
else return ZP_PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
but this is shitty, and it's making a mess with ammopacks rewards.
Can someone help me with this? I think I will need to modify the zombie_plague40.sma directly, but I still hope to be able to do it with a plugin.
Thanks in advance
__________________