I have two problem with forward ze_user_infected_pre
Posted: 04 Feb 2021, 20:46
Hi
I was want create plugin is make zombie is kill is not infect
Problem 1: When i use return 1 is became knock-back is stopped !
Problem 2: When health of the human became 0 is infect is not dead !
I was want create plugin is make zombie is kill is not infect
Problem 1: When i use return 1 is became knock-back is stopped !
Problem 2: When health of the human became 0 is infect is not dead !
- // forward pre-infection
- public ze_user_infected_pre(iVictim, iInfector, iDamage)
- {
- // Check from infector is valid
- if (iInfector != 0 && g_bIsSwarm)
- {
- // Check from damage is started
- if (g_bStartDamage)
- {
- // Get current health victim
- new iHealth = floatround(get_entvar(iVictim, var_health))
- if (iHealth > 0)
- {
- // Get new damage
- new iNewDamage = iDamage * get_pcvar_num(g_pCvarDamage)
- // Check from health victim is not equal zero
- if ((iHealth - iNewDamage) > 0)
- {
- // Damage victim
- set_entvar(iVictim, var_health, float(iHealth - iNewDamage))
- }
- else // Kill victim
- {
- // ExecuteHam(Ham_Killed, iVictim, iInfector) // I don't know it's not working !
- user_kill(iVictim)
- // Death message
- SendDeathMsg(iInfector, iVictim)
- // Update frags
- UpdateFrags(iInfector, iVictim, get_pcvar_num(g_pCvarFrag), get_pcvar_num(g_pCvarDeath), 1)
- }
- return 1
- }
- }
- }
- return 0
- }