I got a lil problem with this when i try to ignore the damage dealt to the victim, using SetHamParamFloat(4, 0.0) doesnt work, all normal damage is still being performed so then i tried to change the attackerid to the victimid so that zombie plague could not process this whole event as a possible infection. but this doesnt work neither.
Is it possible to change the damagebits to DMG_FALL and change the attackerid to the victimid? unless some1 can see why the damage would still be the normal damage, i dont see any other options.
Also the hamhook is not being executed on bots
PHP Code:
public plugin_init()
{
RegisterHam(Ham_TakeDamage, "player", "player_hurt_pre")
}
public player_hurt_pre(victim, inflictor, attacker, Float:damage)
{
if( attacker <= 0 || !pev_valid(attacker) || victim == attacker || !is_user_connected(attacker))
{
return HAM_IGNORED
}
//client_print(attacker, print_chat, "playerhurt_pre called, vic: %i & att: %i, vic zombie: %i, vic survivor: %i", victim, attacker, zp_get_user_zombie(victim), zp_get_user_survivor(victim))
new uspid = get_weaponid("weapon_usp")
new attweaponid = get_user_weapon(attacker)
client_print(attacker, print_chat, "good here 9, you need: %i, you have: %i", uspid, attweaponid)
if((attweaponid == CSW_USP) && zp_get_user_zombie(attacker) )
{
SetHamParamFloat(4, 0.0)
if ( !zp_get_user_zombie(victim) && !zp_get_user_survivor(victim))
{
new cl_name[46]
get_user_name(victim, cl_name, sizeof(cl_name))
client_print(attacker, print_chat, "good here 9.2, bool: %i, your zombie class: %i, you need: %i", g_bHas_T_pistol[attacker], zp_get_user_zombie_class(attacker), g_zclass_cell)
if( g_bHas_T_pistol[attacker] && zp_get_user_zombie_class(attacker) == g_zclass_cell) )
{
client_print(attacker, print_chat, "good here 10")
if( g_bHasImmunity[victim] )
{
client_print(victim, print_chat, "[ZP] Your Immunity against sleeper cell mutagens has succesfully warded off a mutagen attack.")
client_print(attacker, print_chat, "[ZP] %s has immunity against your sleeper cell mutagens", cl_name)
return HAM_SUPERCEDE
}
if( !task_exists(victim + TASK_CHECKHITS) )
{
set_task(3.0, "Check_vichits",victim + TASK_CHECKHITS)
}
g_Thits[victim]++
g_Thitsattacker[victim] = attacker
client_print(attacker, print_chat, "[ZP] Your T-Virus cell has hit %s, total hits on this player: %i", cl_name, g_Thits[victim])
}
}
SetHamParamInteger(3, victim)
return HAM_SUPERCEDE
}
return HAM_HANDLED
}
__________________